mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-16 13:34:20 +00:00
Compare commits
53 Commits
1.18.1
...
1.18.1-s.6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a9dab7cca | ||
|
|
889ab1f8a8 | ||
|
|
a9019cfb23 | ||
|
|
441d4bce6e | ||
|
|
dd1e681a9c | ||
|
|
a882619eaf | ||
|
|
f43baaaf1f | ||
|
|
c3dc0bd015 | ||
|
|
1fd2a0fae2 | ||
|
|
8ba5b43569 | ||
|
|
6deefcd003 | ||
|
|
4d6cea5fcd | ||
|
|
f175ac774f | ||
|
|
0fe2b24f6b | ||
|
|
6ad06e6faf | ||
|
|
d47faeced1 | ||
|
|
498f586eeb | ||
|
|
e94fc6bc65 | ||
|
|
0a1fe1b725 | ||
|
|
eb40b04b43 | ||
|
|
6685afdcf9 | ||
|
|
49232e32bf | ||
|
|
aec0aed211 | ||
|
|
d43b3176f5 | ||
|
|
190074ea0c | ||
|
|
c5a7719239 | ||
|
|
5eac131d2e | ||
|
|
0bc3276ee2 | ||
|
|
5073507b90 | ||
|
|
805e6f856a | ||
|
|
412a9b5294 | ||
|
|
fbf95c5363 | ||
|
|
b907850344 | ||
|
|
22116373e3 | ||
|
|
9757c3d8b6 | ||
|
|
f8b85d4b4e | ||
|
|
4651f19c53 | ||
|
|
4524bdc094 | ||
|
|
741850880e | ||
|
|
53e096f7cb | ||
|
|
3dfd7e8a43 | ||
|
|
db6e60d0a3 | ||
|
|
54d2d689c1 | ||
|
|
bb5853827b | ||
|
|
68f5512732 | ||
|
|
416e124c02 | ||
|
|
d3e4d8cda8 | ||
|
|
81972dbb73 | ||
|
|
b715786a1e | ||
|
|
ae24eb2d2c | ||
|
|
20fc59dcda | ||
|
|
93b09de425 | ||
|
|
bacc130453 |
112
.github/workflows/cicd.yml
vendored
112
.github/workflows/cicd.yml
vendored
@@ -414,28 +414,18 @@ jobs:
|
|||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Install cosign
|
- name: Install cosign
|
||||||
# cosign is used to sign and verify container images (key and keyless)
|
# cosign is used to sign container images using keyless (OIDC) signing
|
||||||
uses: sigstore/cosign-installer@cad07c2e89fa2edd6e2d7bab4c1aa38e53f76003 # v4.1.1
|
uses: sigstore/cosign-installer@cad07c2e89fa2edd6e2d7bab4c1aa38e53f76003 # v4.1.1
|
||||||
|
|
||||||
- name: Dual-sign and verify (GHCR & Docker Hub)
|
- name: Sign (GHCR, keyless)
|
||||||
# Sign each image by digest using keyless (OIDC) and key-based signing,
|
# Sign each GHCR image by digest using keyless (OIDC) signing via Sigstore/Rekor.
|
||||||
# then verify both the public key signature and the keyless OIDC signature.
|
# Signatures are stored in the registry alongside the image.
|
||||||
env:
|
env:
|
||||||
TAG: ${{ env.TAG }}
|
TAG: ${{ env.TAG }}
|
||||||
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
|
|
||||||
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
|
|
||||||
COSIGN_PUBLIC_KEY: ${{ secrets.COSIGN_PUBLIC_KEY }}
|
|
||||||
COSIGN_YES: "true"
|
COSIGN_YES: "true"
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
issuer="https://token.actions.githubusercontent.com"
|
|
||||||
id_regex="^https://github.com/${{ github.repository }}/.+" # accept this repo (all workflows/refs)
|
|
||||||
|
|
||||||
# Track failures
|
|
||||||
FAILED_TAGS=()
|
|
||||||
SUCCESSFUL_TAGS=()
|
|
||||||
|
|
||||||
# Determine if this is an RC release
|
# Determine if this is an RC release
|
||||||
IS_RC="false"
|
IS_RC="false"
|
||||||
if [[ "$TAG" == *"-rc."* ]]; then
|
if [[ "$TAG" == *"-rc."* ]]; then
|
||||||
@@ -463,95 +453,47 @@ jobs:
|
|||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Sign each image variant for both registries
|
FAILED_TAGS=()
|
||||||
for BASE_IMAGE in "${GHCR_IMAGE}" "${DOCKERHUB_IMAGE}"; do
|
SUCCESSFUL_TAGS=()
|
||||||
for IMAGE_TAG in "${IMAGE_TAGS[@]}"; do
|
|
||||||
echo "Processing ${BASE_IMAGE}:${IMAGE_TAG}"
|
|
||||||
TAG_FAILED=false
|
|
||||||
|
|
||||||
# Wrap the entire tag processing in error handling
|
for IMAGE_TAG in "${IMAGE_TAGS[@]}"; do
|
||||||
(
|
echo "Processing ${GHCR_IMAGE}:${IMAGE_TAG}"
|
||||||
set -e
|
TAG_FAILED=false
|
||||||
DIGEST="$(skopeo inspect --retry-times 3 docker://${BASE_IMAGE}:${IMAGE_TAG} | jq -r '.Digest')"
|
|
||||||
REF="${BASE_IMAGE}@${DIGEST}"
|
|
||||||
echo "Resolved digest: ${REF}"
|
|
||||||
|
|
||||||
echo "==> cosign sign (keyless) --recursive ${REF}"
|
(
|
||||||
cosign sign --recursive "${REF}"
|
set -e
|
||||||
|
DIGEST="$(skopeo inspect --retry-times 3 docker://${GHCR_IMAGE}:${IMAGE_TAG} | jq -r '.Digest')"
|
||||||
|
REF="${GHCR_IMAGE}@${DIGEST}"
|
||||||
|
echo "Resolved digest: ${REF}"
|
||||||
|
|
||||||
echo "==> cosign sign (key) --recursive ${REF}"
|
echo "==> cosign sign (keyless) --recursive ${REF}"
|
||||||
cosign sign --key env://COSIGN_PRIVATE_KEY --recursive "${REF}"
|
cosign sign --recursive "${REF}"
|
||||||
|
) || TAG_FAILED=true
|
||||||
|
|
||||||
# Retry wrapper for verification to handle registry propagation delays
|
if [ "$TAG_FAILED" = "true" ]; then
|
||||||
retry_verify() {
|
echo "⚠️ WARNING: Failed to sign ${GHCR_IMAGE}:${IMAGE_TAG}"
|
||||||
local cmd="$1"
|
FAILED_TAGS+=("${GHCR_IMAGE}:${IMAGE_TAG}")
|
||||||
local attempts=6
|
else
|
||||||
local delay=5
|
echo "✓ Successfully signed ${GHCR_IMAGE}:${IMAGE_TAG}"
|
||||||
local i=1
|
SUCCESSFUL_TAGS+=("${GHCR_IMAGE}:${IMAGE_TAG}")
|
||||||
until eval "$cmd"; do
|
fi
|
||||||
if [ $i -ge $attempts ]; then
|
|
||||||
echo "Verification failed after $attempts attempts"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
echo "Verification not yet available. Retry $i/$attempts after ${delay}s..."
|
|
||||||
sleep $delay
|
|
||||||
i=$((i+1))
|
|
||||||
delay=$((delay*2))
|
|
||||||
# Cap the delay to avoid very long waits
|
|
||||||
if [ $delay -gt 60 ]; then delay=60; fi
|
|
||||||
done
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "==> cosign verify (public key) ${REF}"
|
|
||||||
if retry_verify "cosign verify --key env://COSIGN_PUBLIC_KEY '${REF}' -o text"; then
|
|
||||||
VERIFIED_INDEX=true
|
|
||||||
else
|
|
||||||
VERIFIED_INDEX=false
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "==> cosign verify (keyless policy) ${REF}"
|
|
||||||
if retry_verify "cosign verify --certificate-oidc-issuer '${issuer}' --certificate-identity-regexp '${id_regex}' '${REF}' -o text"; then
|
|
||||||
VERIFIED_INDEX_KEYLESS=true
|
|
||||||
else
|
|
||||||
VERIFIED_INDEX_KEYLESS=false
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check if verification succeeded
|
|
||||||
if [ "${VERIFIED_INDEX}" != "true" ] && [ "${VERIFIED_INDEX_KEYLESS}" != "true" ]; then
|
|
||||||
echo "⚠️ WARNING: Verification not available for ${BASE_IMAGE}:${IMAGE_TAG}"
|
|
||||||
echo "This may be due to registry propagation delays. Continuing anyway."
|
|
||||||
fi
|
|
||||||
) || TAG_FAILED=true
|
|
||||||
|
|
||||||
if [ "$TAG_FAILED" = "true" ]; then
|
|
||||||
echo "⚠️ WARNING: Failed to sign/verify ${BASE_IMAGE}:${IMAGE_TAG}"
|
|
||||||
FAILED_TAGS+=("${BASE_IMAGE}:${IMAGE_TAG}")
|
|
||||||
else
|
|
||||||
echo "✓ Successfully signed and verified ${BASE_IMAGE}:${IMAGE_TAG}"
|
|
||||||
SUCCESSFUL_TAGS+=("${BASE_IMAGE}:${IMAGE_TAG}")
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# Report summary
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "=========================================="
|
echo "=========================================="
|
||||||
echo "Sign and Verify Summary"
|
echo "Sign Summary"
|
||||||
echo "=========================================="
|
echo "=========================================="
|
||||||
echo "Successful: ${#SUCCESSFUL_TAGS[@]}"
|
echo "Successful: ${#SUCCESSFUL_TAGS[@]}"
|
||||||
echo "Failed: ${#FAILED_TAGS[@]}"
|
echo "Failed: ${#FAILED_TAGS[@]}"
|
||||||
echo ""
|
|
||||||
|
|
||||||
if [ ${#FAILED_TAGS[@]} -gt 0 ]; then
|
if [ ${#FAILED_TAGS[@]} -gt 0 ]; then
|
||||||
echo "Failed tags:"
|
echo "Failed tags:"
|
||||||
for tag in "${FAILED_TAGS[@]}"; do
|
for tag in "${FAILED_TAGS[@]}"; do
|
||||||
echo " - $tag"
|
echo " - $tag"
|
||||||
done
|
done
|
||||||
echo ""
|
echo "⚠️ WARNING: Some tags failed to sign, but continuing anyway"
|
||||||
echo "⚠️ WARNING: Some tags failed to sign/verify, but continuing anyway"
|
|
||||||
else
|
else
|
||||||
echo "✓ All images signed and verified successfully!"
|
echo "✓ All images signed successfully!"
|
||||||
fi
|
fi
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { CommandModule } from "yargs";
|
import { CommandModule } from "yargs";
|
||||||
import { db, idpOidcConfig, licenseKey } from "@server/db";
|
import { db, idpOidcConfig, licenseKey, certificates, eventStreamingDestinations, alertWebhookActions } from "@server/db";
|
||||||
import { encrypt, decrypt } from "@server/lib/crypto";
|
import { encrypt, decrypt } from "@server/lib/crypto";
|
||||||
import { configFilePath1, configFilePath2 } from "@server/lib/consts";
|
import { configFilePath1, configFilePath2 } from "@server/lib/consts";
|
||||||
import { eq } from "drizzle-orm";
|
import { eq } from "drizzle-orm";
|
||||||
@@ -129,9 +129,15 @@ export const rotateServerSecret: CommandModule<
|
|||||||
console.log("\nReading encrypted data from database...");
|
console.log("\nReading encrypted data from database...");
|
||||||
const idpConfigs = await db.select().from(idpOidcConfig);
|
const idpConfigs = await db.select().from(idpOidcConfig);
|
||||||
const licenseKeys = await db.select().from(licenseKey);
|
const licenseKeys = await db.select().from(licenseKey);
|
||||||
|
const certs = await db.select().from(certificates);
|
||||||
|
const streamingDestinations = await db.select().from(eventStreamingDestinations);
|
||||||
|
const webhookActions = await db.select().from(alertWebhookActions);
|
||||||
|
|
||||||
console.log(`Found ${idpConfigs.length} OIDC IdP configuration(s)`);
|
console.log(`Found ${idpConfigs.length} OIDC IdP configuration(s)`);
|
||||||
console.log(`Found ${licenseKeys.length} license key(s)`);
|
console.log(`Found ${licenseKeys.length} license key(s)`);
|
||||||
|
console.log(`Found ${certs.length} certificate(s)`);
|
||||||
|
console.log(`Found ${streamingDestinations.length} event streaming destination(s)`);
|
||||||
|
console.log(`Found ${webhookActions.length} alert webhook action(s)`);
|
||||||
|
|
||||||
// Prepare all decrypted and re-encrypted values
|
// Prepare all decrypted and re-encrypted values
|
||||||
console.log("\nDecrypting and re-encrypting values...");
|
console.log("\nDecrypting and re-encrypting values...");
|
||||||
@@ -149,8 +155,27 @@ export const rotateServerSecret: CommandModule<
|
|||||||
encryptedInstanceId: string;
|
encryptedInstanceId: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type CertUpdate = {
|
||||||
|
certId: number;
|
||||||
|
encryptedCertFile: string | null;
|
||||||
|
encryptedKeyFile: string | null;
|
||||||
|
};
|
||||||
|
|
||||||
|
type StreamingDestinationUpdate = {
|
||||||
|
destinationId: number;
|
||||||
|
encryptedConfig: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
type WebhookActionUpdate = {
|
||||||
|
webhookActionId: number;
|
||||||
|
encryptedConfig: string;
|
||||||
|
};
|
||||||
|
|
||||||
const idpUpdates: IdpUpdate[] = [];
|
const idpUpdates: IdpUpdate[] = [];
|
||||||
const licenseKeyUpdates: LicenseKeyUpdate[] = [];
|
const licenseKeyUpdates: LicenseKeyUpdate[] = [];
|
||||||
|
const certUpdates: CertUpdate[] = [];
|
||||||
|
const streamingDestinationUpdates: StreamingDestinationUpdate[] = [];
|
||||||
|
const webhookActionUpdates: WebhookActionUpdate[] = [];
|
||||||
|
|
||||||
// Process idpOidcConfig entries
|
// Process idpOidcConfig entries
|
||||||
for (const idpConfig of idpConfigs) {
|
for (const idpConfig of idpConfigs) {
|
||||||
@@ -217,6 +242,70 @@ export const rotateServerSecret: CommandModule<
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Process certificate entries
|
||||||
|
for (const cert of certs) {
|
||||||
|
try {
|
||||||
|
const encryptedCertFile = cert.certFile
|
||||||
|
? encrypt(decrypt(cert.certFile, oldSecret), newSecret)
|
||||||
|
: null;
|
||||||
|
const encryptedKeyFile = cert.keyFile
|
||||||
|
? encrypt(decrypt(cert.keyFile, oldSecret), newSecret)
|
||||||
|
: null;
|
||||||
|
|
||||||
|
certUpdates.push({
|
||||||
|
certId: cert.certId,
|
||||||
|
encryptedCertFile,
|
||||||
|
encryptedKeyFile
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error(
|
||||||
|
`Error processing certificate ${cert.certId} (${cert.domain}):`,
|
||||||
|
error
|
||||||
|
);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Process eventStreamingDestinations entries
|
||||||
|
for (const dest of streamingDestinations) {
|
||||||
|
try {
|
||||||
|
const decryptedConfig = decrypt(dest.config, oldSecret);
|
||||||
|
const encryptedConfig = encrypt(decryptedConfig, newSecret);
|
||||||
|
|
||||||
|
streamingDestinationUpdates.push({
|
||||||
|
destinationId: dest.destinationId,
|
||||||
|
encryptedConfig
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error(
|
||||||
|
`Error processing event streaming destination ${dest.destinationId}:`,
|
||||||
|
error
|
||||||
|
);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Process alertWebhookActions entries
|
||||||
|
for (const webhook of webhookActions) {
|
||||||
|
try {
|
||||||
|
if (webhook.config == null) continue;
|
||||||
|
|
||||||
|
const decryptedConfig = decrypt(webhook.config, oldSecret);
|
||||||
|
const encryptedConfig = encrypt(decryptedConfig, newSecret);
|
||||||
|
|
||||||
|
webhookActionUpdates.push({
|
||||||
|
webhookActionId: webhook.webhookActionId,
|
||||||
|
encryptedConfig
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error(
|
||||||
|
`Error processing alert webhook action ${webhook.webhookActionId}:`,
|
||||||
|
error
|
||||||
|
);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Perform all database updates in a single transaction
|
// Perform all database updates in a single transaction
|
||||||
console.log("\nUpdating database in transaction...");
|
console.log("\nUpdating database in transaction...");
|
||||||
await db.transaction(async (trx) => {
|
await db.transaction(async (trx) => {
|
||||||
@@ -250,10 +339,50 @@ export const rotateServerSecret: CommandModule<
|
|||||||
instanceId: update.encryptedInstanceId
|
instanceId: update.encryptedInstanceId
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update certificate entries
|
||||||
|
for (const update of certUpdates) {
|
||||||
|
await trx
|
||||||
|
.update(certificates)
|
||||||
|
.set({
|
||||||
|
certFile: update.encryptedCertFile,
|
||||||
|
keyFile: update.encryptedKeyFile
|
||||||
|
})
|
||||||
|
.where(eq(certificates.certId, update.certId));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update event streaming destination entries
|
||||||
|
for (const update of streamingDestinationUpdates) {
|
||||||
|
await trx
|
||||||
|
.update(eventStreamingDestinations)
|
||||||
|
.set({ config: update.encryptedConfig })
|
||||||
|
.where(
|
||||||
|
eq(
|
||||||
|
eventStreamingDestinations.destinationId,
|
||||||
|
update.destinationId
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update alert webhook action entries
|
||||||
|
for (const update of webhookActionUpdates) {
|
||||||
|
await trx
|
||||||
|
.update(alertWebhookActions)
|
||||||
|
.set({ config: update.encryptedConfig })
|
||||||
|
.where(
|
||||||
|
eq(
|
||||||
|
alertWebhookActions.webhookActionId,
|
||||||
|
update.webhookActionId
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(`Rotated ${idpUpdates.length} OIDC IdP configuration(s)`);
|
console.log(`Rotated ${idpUpdates.length} OIDC IdP configuration(s)`);
|
||||||
console.log(`Rotated ${licenseKeyUpdates.length} license key(s)`);
|
console.log(`Rotated ${licenseKeyUpdates.length} license key(s)`);
|
||||||
|
console.log(`Rotated ${certUpdates.length} certificate(s)`);
|
||||||
|
console.log(`Rotated ${streamingDestinationUpdates.length} event streaming destination(s)`);
|
||||||
|
console.log(`Rotated ${webhookActionUpdates.length} alert webhook action(s)`);
|
||||||
|
|
||||||
// Update config file with new secret
|
// Update config file with new secret
|
||||||
console.log("\nUpdating config file...");
|
console.log("\nUpdating config file...");
|
||||||
@@ -270,6 +399,9 @@ export const rotateServerSecret: CommandModule<
|
|||||||
console.log(`\nSummary:`);
|
console.log(`\nSummary:`);
|
||||||
console.log(` - OIDC IdP configurations: ${idpUpdates.length}`);
|
console.log(` - OIDC IdP configurations: ${idpUpdates.length}`);
|
||||||
console.log(` - License keys: ${licenseKeyUpdates.length}`);
|
console.log(` - License keys: ${licenseKeyUpdates.length}`);
|
||||||
|
console.log(` - Certificates: ${certUpdates.length}`);
|
||||||
|
console.log(` - Event streaming destinations: ${streamingDestinationUpdates.length}`);
|
||||||
|
console.log(` - Alert webhook actions: ${webhookActionUpdates.length}`);
|
||||||
console.log(
|
console.log(
|
||||||
`\n IMPORTANT: Restart the server for the new secret to take effect.`
|
`\n IMPORTANT: Restart the server for the new secret to take effect.`
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -763,6 +763,7 @@
|
|||||||
"newtEndpoint": "Крайна точка",
|
"newtEndpoint": "Крайна точка",
|
||||||
"newtId": "Идентификационен номер",
|
"newtId": "Идентификационен номер",
|
||||||
"newtSecretKey": "Секретен ключ",
|
"newtSecretKey": "Секретен ключ",
|
||||||
|
"newtVersion": "Версия",
|
||||||
"architecture": "Архитектура",
|
"architecture": "Архитектура",
|
||||||
"sites": "Сайтове",
|
"sites": "Сайтове",
|
||||||
"siteWgAnyClients": "Използвайте клиент на WireGuard, за да се свържете. Ще трябва да използвате вътрешните ресурси чрез IP адреса на връстника.",
|
"siteWgAnyClients": "Използвайте клиент на WireGuard, за да се свържете. Ще трябва да използвате вътрешните ресурси чрез IP адреса на връстника.",
|
||||||
@@ -3201,5 +3202,6 @@
|
|||||||
"domainPickerWildcardSubdomainNotAllowed": "Уайлдкард подсайтове не са позволени.",
|
"domainPickerWildcardSubdomainNotAllowed": "Уайлдкард подсайтове не са позволени.",
|
||||||
"domainPickerWildcardCertWarning": "Ресурсите с уайлдкард може да изискват допълнителна конфигурация за правилна работа.",
|
"domainPickerWildcardCertWarning": "Ресурсите с уайлдкард може да изискват допълнителна конфигурация за правилна работа.",
|
||||||
"domainPickerWildcardCertWarningLink": "Научете повече",
|
"domainPickerWildcardCertWarningLink": "Научете повече",
|
||||||
"health": "Здраве"
|
"health": "Здраве",
|
||||||
|
"domainPendingErrorTitle": "Проблем при проверка"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -763,6 +763,7 @@
|
|||||||
"newtEndpoint": "Endpoint",
|
"newtEndpoint": "Endpoint",
|
||||||
"newtId": "ID",
|
"newtId": "ID",
|
||||||
"newtSecretKey": "Tajný klíč",
|
"newtSecretKey": "Tajný klíč",
|
||||||
|
"newtVersion": "Verze",
|
||||||
"architecture": "Architektura",
|
"architecture": "Architektura",
|
||||||
"sites": "Stránky",
|
"sites": "Stránky",
|
||||||
"siteWgAnyClients": "K připojení použijte jakéhokoli klienta WireGuard. Budete muset řešit interní zdroje pomocí klientské IP adresy.",
|
"siteWgAnyClients": "K připojení použijte jakéhokoli klienta WireGuard. Budete muset řešit interní zdroje pomocí klientské IP adresy.",
|
||||||
@@ -3201,5 +3202,6 @@
|
|||||||
"domainPickerWildcardSubdomainNotAllowed": "Zástupné poddomény nejsou povoleny.",
|
"domainPickerWildcardSubdomainNotAllowed": "Zástupné poddomény nejsou povoleny.",
|
||||||
"domainPickerWildcardCertWarning": "Zástupné zdroje mohou vyžadovat dodatečnou konfiguraci pro správnou funkci.",
|
"domainPickerWildcardCertWarning": "Zástupné zdroje mohou vyžadovat dodatečnou konfiguraci pro správnou funkci.",
|
||||||
"domainPickerWildcardCertWarningLink": "Zjistit více",
|
"domainPickerWildcardCertWarningLink": "Zjistit více",
|
||||||
"health": "Zdraví"
|
"health": "Zdraví",
|
||||||
|
"domainPendingErrorTitle": "Problém s ověřením"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -763,6 +763,7 @@
|
|||||||
"newtEndpoint": "Endpunkt",
|
"newtEndpoint": "Endpunkt",
|
||||||
"newtId": "ID",
|
"newtId": "ID",
|
||||||
"newtSecretKey": "Geheimnis",
|
"newtSecretKey": "Geheimnis",
|
||||||
|
"newtVersion": "Version",
|
||||||
"architecture": "Architektur",
|
"architecture": "Architektur",
|
||||||
"sites": "Standorte",
|
"sites": "Standorte",
|
||||||
"siteWgAnyClients": "Verwenden Sie jeden WireGuard-Client um sich zu verbinden. Sie müssen interne Ressourcen über die Peer-IP ansprechen.",
|
"siteWgAnyClients": "Verwenden Sie jeden WireGuard-Client um sich zu verbinden. Sie müssen interne Ressourcen über die Peer-IP ansprechen.",
|
||||||
@@ -3201,5 +3202,6 @@
|
|||||||
"domainPickerWildcardSubdomainNotAllowed": "Wildcard-Subdomains sind nicht erlaubt.",
|
"domainPickerWildcardSubdomainNotAllowed": "Wildcard-Subdomains sind nicht erlaubt.",
|
||||||
"domainPickerWildcardCertWarning": "Wildcard-Ressourcen erfordern möglicherweise zusätzliche Konfigurationen, um ordnungsgemäß zu funktionieren.",
|
"domainPickerWildcardCertWarning": "Wildcard-Ressourcen erfordern möglicherweise zusätzliche Konfigurationen, um ordnungsgemäß zu funktionieren.",
|
||||||
"domainPickerWildcardCertWarningLink": "Mehr erfahren",
|
"domainPickerWildcardCertWarningLink": "Mehr erfahren",
|
||||||
"health": "Gesundheit"
|
"health": "Gesundheit",
|
||||||
|
"domainPendingErrorTitle": "Verifizierungsproblem"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -763,6 +763,7 @@
|
|||||||
"newtEndpoint": "Endpoint",
|
"newtEndpoint": "Endpoint",
|
||||||
"newtId": "ID",
|
"newtId": "ID",
|
||||||
"newtSecretKey": "Secret",
|
"newtSecretKey": "Secret",
|
||||||
|
"newtVersion": "Version",
|
||||||
"architecture": "Architecture",
|
"architecture": "Architecture",
|
||||||
"sites": "Sites",
|
"sites": "Sites",
|
||||||
"siteWgAnyClients": "Use any WireGuard client to connect. You will have to address internal resources using the peer IP.",
|
"siteWgAnyClients": "Use any WireGuard client to connect. You will have to address internal resources using the peer IP.",
|
||||||
@@ -3201,5 +3202,6 @@
|
|||||||
"domainPickerWildcardSubdomainNotAllowed": "Wildcard subdomains are not allowed.",
|
"domainPickerWildcardSubdomainNotAllowed": "Wildcard subdomains are not allowed.",
|
||||||
"domainPickerWildcardCertWarning": "Wildcard resources may require additional configuration to work properly.",
|
"domainPickerWildcardCertWarning": "Wildcard resources may require additional configuration to work properly.",
|
||||||
"domainPickerWildcardCertWarningLink": "Learn more",
|
"domainPickerWildcardCertWarningLink": "Learn more",
|
||||||
"health": "Health"
|
"health": "Health",
|
||||||
|
"domainPendingErrorTitle": "Verification Issue"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -763,6 +763,7 @@
|
|||||||
"newtEndpoint": "Endpoint",
|
"newtEndpoint": "Endpoint",
|
||||||
"newtId": "ID",
|
"newtId": "ID",
|
||||||
"newtSecretKey": "Secreto",
|
"newtSecretKey": "Secreto",
|
||||||
|
"newtVersion": "Versión",
|
||||||
"architecture": "Arquitectura",
|
"architecture": "Arquitectura",
|
||||||
"sites": "Sitios",
|
"sites": "Sitios",
|
||||||
"siteWgAnyClients": "Usa cualquier cliente de Wirex para conectarte. Tendrás que dirigirte a los recursos internos usando la IP de compañeros.",
|
"siteWgAnyClients": "Usa cualquier cliente de Wirex para conectarte. Tendrás que dirigirte a los recursos internos usando la IP de compañeros.",
|
||||||
@@ -3201,5 +3202,6 @@
|
|||||||
"domainPickerWildcardSubdomainNotAllowed": "No se permiten subdominios comodín.",
|
"domainPickerWildcardSubdomainNotAllowed": "No se permiten subdominios comodín.",
|
||||||
"domainPickerWildcardCertWarning": "Los recursos comodín pueden requerir configuración adicional para funcionar correctamente.",
|
"domainPickerWildcardCertWarning": "Los recursos comodín pueden requerir configuración adicional para funcionar correctamente.",
|
||||||
"domainPickerWildcardCertWarningLink": "Más información",
|
"domainPickerWildcardCertWarningLink": "Más información",
|
||||||
"health": "Salud"
|
"health": "Salud",
|
||||||
|
"domainPendingErrorTitle": "Problema de verificación"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -763,6 +763,7 @@
|
|||||||
"newtEndpoint": "Endpoint",
|
"newtEndpoint": "Endpoint",
|
||||||
"newtId": "ID",
|
"newtId": "ID",
|
||||||
"newtSecretKey": "Secrète",
|
"newtSecretKey": "Secrète",
|
||||||
|
"newtVersion": "Version",
|
||||||
"architecture": "Architecture",
|
"architecture": "Architecture",
|
||||||
"sites": "Nœuds",
|
"sites": "Nœuds",
|
||||||
"siteWgAnyClients": "Utilisez n'importe quel client WireGuard pour vous connecter. Vous devrez adresser des ressources internes en utilisant l'adresse IP du pair.",
|
"siteWgAnyClients": "Utilisez n'importe quel client WireGuard pour vous connecter. Vous devrez adresser des ressources internes en utilisant l'adresse IP du pair.",
|
||||||
@@ -3201,5 +3202,6 @@
|
|||||||
"domainPickerWildcardSubdomainNotAllowed": "Les sous-domaines Joker ne sont pas autorisés.",
|
"domainPickerWildcardSubdomainNotAllowed": "Les sous-domaines Joker ne sont pas autorisés.",
|
||||||
"domainPickerWildcardCertWarning": "Les ressources Joker peuvent nécessiter une configuration supplémentaire pour fonctionner correctement.",
|
"domainPickerWildcardCertWarning": "Les ressources Joker peuvent nécessiter une configuration supplémentaire pour fonctionner correctement.",
|
||||||
"domainPickerWildcardCertWarningLink": "En savoir plus",
|
"domainPickerWildcardCertWarningLink": "En savoir plus",
|
||||||
"health": "Santé"
|
"health": "Santé",
|
||||||
|
"domainPendingErrorTitle": "Problème de vérification"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -763,6 +763,7 @@
|
|||||||
"newtEndpoint": "Endpoint",
|
"newtEndpoint": "Endpoint",
|
||||||
"newtId": "ID",
|
"newtId": "ID",
|
||||||
"newtSecretKey": "Segreto",
|
"newtSecretKey": "Segreto",
|
||||||
|
"newtVersion": "Versione",
|
||||||
"architecture": "Architettura",
|
"architecture": "Architettura",
|
||||||
"sites": "Siti",
|
"sites": "Siti",
|
||||||
"siteWgAnyClients": "Usa qualsiasi client WireGuard per connetterti. Dovrai indirizzare le risorse interne utilizzando l'IP del peer.",
|
"siteWgAnyClients": "Usa qualsiasi client WireGuard per connetterti. Dovrai indirizzare le risorse interne utilizzando l'IP del peer.",
|
||||||
@@ -3201,5 +3202,6 @@
|
|||||||
"domainPickerWildcardSubdomainNotAllowed": "I sottodomini wildcard non sono permessi.",
|
"domainPickerWildcardSubdomainNotAllowed": "I sottodomini wildcard non sono permessi.",
|
||||||
"domainPickerWildcardCertWarning": "Le risorse wildcard potrebbero richiedere configurazioni aggiuntive per funzionare correttamente.",
|
"domainPickerWildcardCertWarning": "Le risorse wildcard potrebbero richiedere configurazioni aggiuntive per funzionare correttamente.",
|
||||||
"domainPickerWildcardCertWarningLink": "Scopri di più",
|
"domainPickerWildcardCertWarningLink": "Scopri di più",
|
||||||
"health": "Salute"
|
"health": "Salute",
|
||||||
|
"domainPendingErrorTitle": "Problema di Verifica"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -763,6 +763,7 @@
|
|||||||
"newtEndpoint": "엔드포인트",
|
"newtEndpoint": "엔드포인트",
|
||||||
"newtId": "ID",
|
"newtId": "ID",
|
||||||
"newtSecretKey": "비밀",
|
"newtSecretKey": "비밀",
|
||||||
|
"newtVersion": "버전",
|
||||||
"architecture": "아키텍처",
|
"architecture": "아키텍처",
|
||||||
"sites": "사이트",
|
"sites": "사이트",
|
||||||
"siteWgAnyClients": "WireGuard 클라이언트를 사용하여 연결하십시오. 피어 IP를 사용하여 내부 리소스에 접근해야 합니다.",
|
"siteWgAnyClients": "WireGuard 클라이언트를 사용하여 연결하십시오. 피어 IP를 사용하여 내부 리소스에 접근해야 합니다.",
|
||||||
@@ -3201,5 +3202,6 @@
|
|||||||
"domainPickerWildcardSubdomainNotAllowed": "와일드카드 서브도메인은 허용되지 않습니다.",
|
"domainPickerWildcardSubdomainNotAllowed": "와일드카드 서브도메인은 허용되지 않습니다.",
|
||||||
"domainPickerWildcardCertWarning": "와일드카드 리소스는 올바르게 작동하려면 추가 구성이 필요할 수 있습니다.",
|
"domainPickerWildcardCertWarning": "와일드카드 리소스는 올바르게 작동하려면 추가 구성이 필요할 수 있습니다.",
|
||||||
"domainPickerWildcardCertWarningLink": "자세히 알아보기",
|
"domainPickerWildcardCertWarningLink": "자세히 알아보기",
|
||||||
"health": "건강"
|
"health": "건강",
|
||||||
|
"domainPendingErrorTitle": "확인 문제"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -763,6 +763,7 @@
|
|||||||
"newtEndpoint": "Endpoint",
|
"newtEndpoint": "Endpoint",
|
||||||
"newtId": "ID",
|
"newtId": "ID",
|
||||||
"newtSecretKey": "Sikkerhetsnøkkel",
|
"newtSecretKey": "Sikkerhetsnøkkel",
|
||||||
|
"newtVersion": "Versjon",
|
||||||
"architecture": "Arkitektur",
|
"architecture": "Arkitektur",
|
||||||
"sites": "Områder",
|
"sites": "Områder",
|
||||||
"siteWgAnyClients": "Bruk hvilken som helst WireGuard klient til å koble til. Du må adressere interne ressurser ved hjelp av peer IP.",
|
"siteWgAnyClients": "Bruk hvilken som helst WireGuard klient til å koble til. Du må adressere interne ressurser ved hjelp av peer IP.",
|
||||||
@@ -3201,5 +3202,6 @@
|
|||||||
"domainPickerWildcardSubdomainNotAllowed": "Jokertegnsubdomener er ikke tillatt.",
|
"domainPickerWildcardSubdomainNotAllowed": "Jokertegnsubdomener er ikke tillatt.",
|
||||||
"domainPickerWildcardCertWarning": "Jokertegnressurser kan kreve ekstra konfigurasjon for å fungere skikkelig.",
|
"domainPickerWildcardCertWarning": "Jokertegnressurser kan kreve ekstra konfigurasjon for å fungere skikkelig.",
|
||||||
"domainPickerWildcardCertWarningLink": "Lær mer",
|
"domainPickerWildcardCertWarningLink": "Lær mer",
|
||||||
"health": "Helse"
|
"health": "Helse",
|
||||||
|
"domainPendingErrorTitle": "Verifiseringsproblem"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -763,6 +763,7 @@
|
|||||||
"newtEndpoint": "Endpoint",
|
"newtEndpoint": "Endpoint",
|
||||||
"newtId": "ID",
|
"newtId": "ID",
|
||||||
"newtSecretKey": "Geheim",
|
"newtSecretKey": "Geheim",
|
||||||
|
"newtVersion": "Versie",
|
||||||
"architecture": "Architectuur",
|
"architecture": "Architectuur",
|
||||||
"sites": "Sites",
|
"sites": "Sites",
|
||||||
"siteWgAnyClients": "Gebruik een willekeurige WireGuard client om verbinding te maken. Je zult interne bronnen moeten aanspreken met behulp van de peer IP.",
|
"siteWgAnyClients": "Gebruik een willekeurige WireGuard client om verbinding te maken. Je zult interne bronnen moeten aanspreken met behulp van de peer IP.",
|
||||||
@@ -3168,7 +3169,7 @@
|
|||||||
"publicIpEndpoint": "Eindpunt",
|
"publicIpEndpoint": "Eindpunt",
|
||||||
"lastTriggeredAt": "Laatste Trigger",
|
"lastTriggeredAt": "Laatste Trigger",
|
||||||
"reject": "Afwijzen",
|
"reject": "Afwijzen",
|
||||||
"uptimeDaysAgo": "{count} days ago",
|
"uptimeDaysAgo": "{count} dagen geleden",
|
||||||
"uptimeToday": "Vandaag",
|
"uptimeToday": "Vandaag",
|
||||||
"uptimeNoDataAvailable": "Geen gegevens beschikbaar",
|
"uptimeNoDataAvailable": "Geen gegevens beschikbaar",
|
||||||
"uptimeSuffix": "werktijd",
|
"uptimeSuffix": "werktijd",
|
||||||
@@ -3201,5 +3202,6 @@
|
|||||||
"domainPickerWildcardSubdomainNotAllowed": "Wildcard-subdomeinen zijn niet toegestaan.",
|
"domainPickerWildcardSubdomainNotAllowed": "Wildcard-subdomeinen zijn niet toegestaan.",
|
||||||
"domainPickerWildcardCertWarning": "Wildcard-bronnen hebben mogelijk extra configuratie nodig om correct te werken.",
|
"domainPickerWildcardCertWarning": "Wildcard-bronnen hebben mogelijk extra configuratie nodig om correct te werken.",
|
||||||
"domainPickerWildcardCertWarningLink": "Meer informatie",
|
"domainPickerWildcardCertWarningLink": "Meer informatie",
|
||||||
"health": "Gezondheid"
|
"health": "Gezondheid",
|
||||||
|
"domainPendingErrorTitle": "Verificatieprobleem"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -763,6 +763,7 @@
|
|||||||
"newtEndpoint": "Endpoint",
|
"newtEndpoint": "Endpoint",
|
||||||
"newtId": "ID",
|
"newtId": "ID",
|
||||||
"newtSecretKey": "Sekret",
|
"newtSecretKey": "Sekret",
|
||||||
|
"newtVersion": "Wersja",
|
||||||
"architecture": "Architektura",
|
"architecture": "Architektura",
|
||||||
"sites": "Witryny",
|
"sites": "Witryny",
|
||||||
"siteWgAnyClients": "Użyj dowolnego klienta WireGuard, aby się połączyć. Będziesz musiał przekierować wewnętrzne zasoby za pomocą adresu IP.",
|
"siteWgAnyClients": "Użyj dowolnego klienta WireGuard, aby się połączyć. Będziesz musiał przekierować wewnętrzne zasoby za pomocą adresu IP.",
|
||||||
@@ -3201,5 +3202,6 @@
|
|||||||
"domainPickerWildcardSubdomainNotAllowed": "Uniwersalne subdomeny nie są dozwolone.",
|
"domainPickerWildcardSubdomainNotAllowed": "Uniwersalne subdomeny nie są dozwolone.",
|
||||||
"domainPickerWildcardCertWarning": "Uniwersalne zasoby mogą wymagać dodatkowej konfiguracji, aby działać poprawnie.",
|
"domainPickerWildcardCertWarning": "Uniwersalne zasoby mogą wymagać dodatkowej konfiguracji, aby działać poprawnie.",
|
||||||
"domainPickerWildcardCertWarningLink": "Dowiedz się więcej",
|
"domainPickerWildcardCertWarningLink": "Dowiedz się więcej",
|
||||||
"health": "Zdrowie"
|
"health": "Zdrowie",
|
||||||
|
"domainPendingErrorTitle": "Problem z weryfikacją"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -763,6 +763,7 @@
|
|||||||
"newtEndpoint": "Endpoint",
|
"newtEndpoint": "Endpoint",
|
||||||
"newtId": "ID",
|
"newtId": "ID",
|
||||||
"newtSecretKey": "Chave Secreta",
|
"newtSecretKey": "Chave Secreta",
|
||||||
|
"newtVersion": "Versão",
|
||||||
"architecture": "Arquitetura",
|
"architecture": "Arquitetura",
|
||||||
"sites": "sites",
|
"sites": "sites",
|
||||||
"siteWgAnyClients": "Use qualquer cliente do WireGuard para se conectar. Você terá que endereçar recursos internos usando o IP de pares.",
|
"siteWgAnyClients": "Use qualquer cliente do WireGuard para se conectar. Você terá que endereçar recursos internos usando o IP de pares.",
|
||||||
@@ -3201,5 +3202,6 @@
|
|||||||
"domainPickerWildcardSubdomainNotAllowed": "Subdomínios curinga não são permitidos.",
|
"domainPickerWildcardSubdomainNotAllowed": "Subdomínios curinga não são permitidos.",
|
||||||
"domainPickerWildcardCertWarning": "Recursos curinga podem exigir configurações adicionais para funcionarem corretamente.",
|
"domainPickerWildcardCertWarning": "Recursos curinga podem exigir configurações adicionais para funcionarem corretamente.",
|
||||||
"domainPickerWildcardCertWarningLink": "Saiba mais",
|
"domainPickerWildcardCertWarningLink": "Saiba mais",
|
||||||
"health": "Saúde"
|
"health": "Saúde",
|
||||||
|
"domainPendingErrorTitle": "Problema de Verificação"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -763,6 +763,7 @@
|
|||||||
"newtEndpoint": "Endpoint",
|
"newtEndpoint": "Endpoint",
|
||||||
"newtId": "ID",
|
"newtId": "ID",
|
||||||
"newtSecretKey": "Секретный ключ",
|
"newtSecretKey": "Секретный ключ",
|
||||||
|
"newtVersion": "Версия",
|
||||||
"architecture": "Архитектура",
|
"architecture": "Архитектура",
|
||||||
"sites": "Сайты",
|
"sites": "Сайты",
|
||||||
"siteWgAnyClients": "Для подключения используйте любой клиент WireGuard. Вы должны будете адресовать внутренние ресурсы, используя IP адрес пира.",
|
"siteWgAnyClients": "Для подключения используйте любой клиент WireGuard. Вы должны будете адресовать внутренние ресурсы, используя IP адрес пира.",
|
||||||
@@ -3201,5 +3202,6 @@
|
|||||||
"domainPickerWildcardSubdomainNotAllowed": "Wildcard поддомены не допускаются.",
|
"domainPickerWildcardSubdomainNotAllowed": "Wildcard поддомены не допускаются.",
|
||||||
"domainPickerWildcardCertWarning": "Wildcard ресурсы могут потребовать дополнительной настройки для правильной работы.",
|
"domainPickerWildcardCertWarning": "Wildcard ресурсы могут потребовать дополнительной настройки для правильной работы.",
|
||||||
"domainPickerWildcardCertWarningLink": "Узнать больше",
|
"domainPickerWildcardCertWarningLink": "Узнать больше",
|
||||||
"health": "Состояние"
|
"health": "Состояние",
|
||||||
|
"domainPendingErrorTitle": "Проблема с подтверждением"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -763,6 +763,7 @@
|
|||||||
"newtEndpoint": "Uç Nokta",
|
"newtEndpoint": "Uç Nokta",
|
||||||
"newtId": "Kimlik",
|
"newtId": "Kimlik",
|
||||||
"newtSecretKey": "Gizli",
|
"newtSecretKey": "Gizli",
|
||||||
|
"newtVersion": "Sürüm",
|
||||||
"architecture": "Mimari",
|
"architecture": "Mimari",
|
||||||
"sites": "Siteler",
|
"sites": "Siteler",
|
||||||
"siteWgAnyClients": "Herhangi bir WireGuard istemcisi kullanarak bağlanın. Dahili kaynaklara eş IP adresini kullanarak erişmeniz gerekecek.",
|
"siteWgAnyClients": "Herhangi bir WireGuard istemcisi kullanarak bağlanın. Dahili kaynaklara eş IP adresini kullanarak erişmeniz gerekecek.",
|
||||||
@@ -3201,5 +3202,6 @@
|
|||||||
"domainPickerWildcardSubdomainNotAllowed": "Genel alt alanlara izin verilmiyor.",
|
"domainPickerWildcardSubdomainNotAllowed": "Genel alt alanlara izin verilmiyor.",
|
||||||
"domainPickerWildcardCertWarning": "Genel kaynaklar düzgün çalışmak için ek yapılandırma gerektirebilir.",
|
"domainPickerWildcardCertWarning": "Genel kaynaklar düzgün çalışmak için ek yapılandırma gerektirebilir.",
|
||||||
"domainPickerWildcardCertWarningLink": "Daha fazla bilgi",
|
"domainPickerWildcardCertWarningLink": "Daha fazla bilgi",
|
||||||
"health": "Sağlık"
|
"health": "Sağlık",
|
||||||
|
"domainPendingErrorTitle": "Doğrulama Sorunu"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -763,6 +763,7 @@
|
|||||||
"newtEndpoint": "Endpoint",
|
"newtEndpoint": "Endpoint",
|
||||||
"newtId": "ID",
|
"newtId": "ID",
|
||||||
"newtSecretKey": "密钥",
|
"newtSecretKey": "密钥",
|
||||||
|
"newtVersion": "版本",
|
||||||
"architecture": "架构",
|
"architecture": "架构",
|
||||||
"sites": "站点",
|
"sites": "站点",
|
||||||
"siteWgAnyClients": "使用任何 WireGuard 客户端连接。您必须使用对等IP解决内部资源问题。",
|
"siteWgAnyClients": "使用任何 WireGuard 客户端连接。您必须使用对等IP解决内部资源问题。",
|
||||||
@@ -3201,5 +3202,6 @@
|
|||||||
"domainPickerWildcardSubdomainNotAllowed": "不允许使用通配符子域。",
|
"domainPickerWildcardSubdomainNotAllowed": "不允许使用通配符子域。",
|
||||||
"domainPickerWildcardCertWarning": "通配符资源可能需要额外配置才能正常工作。",
|
"domainPickerWildcardCertWarning": "通配符资源可能需要额外配置才能正常工作。",
|
||||||
"domainPickerWildcardCertWarningLink": "了解更多",
|
"domainPickerWildcardCertWarningLink": "了解更多",
|
||||||
"health": "健康"
|
"health": "健康",
|
||||||
|
"domainPendingErrorTitle": "验证问题"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,8 +122,6 @@ export enum ActionsEnum {
|
|||||||
createOrgDomain = "createOrgDomain",
|
createOrgDomain = "createOrgDomain",
|
||||||
deleteOrgDomain = "deleteOrgDomain",
|
deleteOrgDomain = "deleteOrgDomain",
|
||||||
restartOrgDomain = "restartOrgDomain",
|
restartOrgDomain = "restartOrgDomain",
|
||||||
sendUsageNotification = "sendUsageNotification",
|
|
||||||
sendTrialNotification = "sendTrialNotification",
|
|
||||||
createRemoteExitNode = "createRemoteExitNode",
|
createRemoteExitNode = "createRemoteExitNode",
|
||||||
updateRemoteExitNode = "updateRemoteExitNode",
|
updateRemoteExitNode = "updateRemoteExitNode",
|
||||||
getRemoteExitNode = "getRemoteExitNode",
|
getRemoteExitNode = "getRemoteExitNode",
|
||||||
|
|||||||
@@ -566,6 +566,17 @@ export const alertWebhookActions = pgTable("alertWebhookActions", {
|
|||||||
lastSentAt: bigint("lastSentAt", { mode: "number" }) // nullable
|
lastSentAt: bigint("lastSentAt", { mode: "number" }) // nullable
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const trialNotifications = pgTable("trialNotifications", {
|
||||||
|
notificationId: serial("notificationId").primaryKey(),
|
||||||
|
subscriptionId: varchar("subscriptionId", { length: 255 })
|
||||||
|
.notNull()
|
||||||
|
.references(() => subscriptions.subscriptionId, {
|
||||||
|
onDelete: "cascade"
|
||||||
|
}),
|
||||||
|
notificationType: varchar("notificationType", { length: 50 }).notNull(), // trial_ending_5d, trial_ending_24h, trial_ended
|
||||||
|
sentAt: bigint("sentAt", { mode: "number" }).notNull()
|
||||||
|
});
|
||||||
|
|
||||||
export type Approval = InferSelectModel<typeof approvals>;
|
export type Approval = InferSelectModel<typeof approvals>;
|
||||||
export type Limit = InferSelectModel<typeof limits>;
|
export type Limit = InferSelectModel<typeof limits>;
|
||||||
export type Account = InferSelectModel<typeof account>;
|
export type Account = InferSelectModel<typeof account>;
|
||||||
@@ -604,3 +615,12 @@ export type EventStreamingCursor = InferSelectModel<
|
|||||||
typeof eventStreamingCursors
|
typeof eventStreamingCursors
|
||||||
>;
|
>;
|
||||||
export type AlertResources = InferSelectModel<typeof alertResources>;
|
export type AlertResources = InferSelectModel<typeof alertResources>;
|
||||||
|
export type AlertHealthChecks = InferSelectModel<typeof alertHealthChecks>;
|
||||||
|
export type AlertSites = InferSelectModel<typeof alertSites>;
|
||||||
|
export type AlertRules = InferSelectModel<typeof alertRules>;
|
||||||
|
export type AlertEmailActions = InferSelectModel<typeof alertEmailActions>;
|
||||||
|
export type AlertEmailRecipients = InferSelectModel<
|
||||||
|
typeof alertEmailRecipients
|
||||||
|
>;
|
||||||
|
export type AlertWebhookActions = InferSelectModel<typeof alertWebhookActions>;
|
||||||
|
export type TrialNotification = InferSelectModel<typeof trialNotifications>;
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ import {
|
|||||||
targetHealthCheck,
|
targetHealthCheck,
|
||||||
users
|
users
|
||||||
} from "./schema";
|
} from "./schema";
|
||||||
|
import { serial, varchar } from "drizzle-orm/mysql-core";
|
||||||
|
import { pgTable } from "drizzle-orm/pg-core";
|
||||||
|
import { bigint } from "zod";
|
||||||
|
|
||||||
export const certificates = sqliteTable("certificates", {
|
export const certificates = sqliteTable("certificates", {
|
||||||
certId: integer("certId").primaryKey({ autoIncrement: true }),
|
certId: integer("certId").primaryKey({ autoIncrement: true }),
|
||||||
@@ -569,6 +572,19 @@ export const alertWebhookActions = sqliteTable("alertWebhookActions", {
|
|||||||
lastSentAt: integer("lastSentAt")
|
lastSentAt: integer("lastSentAt")
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const trialNotifications = sqliteTable("trialNotifications", {
|
||||||
|
notificationId: integer("notificationId").primaryKey({
|
||||||
|
autoIncrement: true
|
||||||
|
}),
|
||||||
|
subscriptionId: text("subscriptionId")
|
||||||
|
.notNull()
|
||||||
|
.references(() => subscriptions.subscriptionId, {
|
||||||
|
onDelete: "cascade"
|
||||||
|
}),
|
||||||
|
notificationType: text("notificationType").notNull(), // trial_ending_5d, trial_ending_24h, trial_ended
|
||||||
|
sentAt: integer("sentAt").notNull()
|
||||||
|
});
|
||||||
|
|
||||||
export type Approval = InferSelectModel<typeof approvals>;
|
export type Approval = InferSelectModel<typeof approvals>;
|
||||||
export type Limit = InferSelectModel<typeof limits>;
|
export type Limit = InferSelectModel<typeof limits>;
|
||||||
export type Account = InferSelectModel<typeof account>;
|
export type Account = InferSelectModel<typeof account>;
|
||||||
@@ -601,3 +617,10 @@ export type EventStreamingCursor = InferSelectModel<
|
|||||||
typeof eventStreamingCursors
|
typeof eventStreamingCursors
|
||||||
>;
|
>;
|
||||||
export type AlertResources = InferSelectModel<typeof alertResources>;
|
export type AlertResources = InferSelectModel<typeof alertResources>;
|
||||||
|
export type AlertHealthChecks = InferSelectModel<typeof alertHealthChecks>;
|
||||||
|
export type AlertSites = InferSelectModel<typeof alertSites>;
|
||||||
|
export type AlertRule = InferSelectModel<typeof alertRules>;
|
||||||
|
export type AlertEmailAction = InferSelectModel<typeof alertEmailActions>;
|
||||||
|
export type AlertEmailRecipient = InferSelectModel<typeof alertEmailRecipients>;
|
||||||
|
export type AlertWebhookAction = InferSelectModel<typeof alertWebhookActions>;
|
||||||
|
export type TrialNotification = InferSelectModel<typeof trialNotifications>;
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ export const NotifyTrialExpiring = ({
|
|||||||
|
|
||||||
<EmailText>
|
<EmailText>
|
||||||
Some features and resources may now be
|
Some features and resources may now be
|
||||||
restricted or disconnected. To restore full
|
restricted. To restore full
|
||||||
access and continue using all the features
|
access and continue using all the features
|
||||||
you had during your trial, please upgrade to
|
you had during your trial, please upgrade to
|
||||||
a paid plan.
|
a paid plan.
|
||||||
@@ -85,7 +85,7 @@ export const NotifyTrialExpiring = ({
|
|||||||
<strong>{orgName}</strong> will end on{" "}
|
<strong>{orgName}</strong> will end on{" "}
|
||||||
<strong>{trialEndsAt}</strong>
|
<strong>{trialEndsAt}</strong>
|
||||||
{isLastDay
|
{isLastDay
|
||||||
? " — that's tomorrow!"
|
? " - that's tomorrow!"
|
||||||
: `, in ${daysRemaining} days`}
|
: `, in ${daysRemaining} days`}
|
||||||
.
|
.
|
||||||
</EmailText>
|
</EmailText>
|
||||||
@@ -93,8 +93,7 @@ export const NotifyTrialExpiring = ({
|
|||||||
<EmailText>
|
<EmailText>
|
||||||
After your trial ends, your account will be
|
After your trial ends, your account will be
|
||||||
moved to the free plan and some
|
moved to the free plan and some
|
||||||
functionality may be restricted or your
|
functionality may be restricted.
|
||||||
sites may disconnect.
|
|
||||||
</EmailText>
|
</EmailText>
|
||||||
|
|
||||||
<EmailText>
|
<EmailText>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export const tier1LimitSet: LimitSet = {
|
|||||||
|
|
||||||
export const tier2LimitSet: LimitSet = {
|
export const tier2LimitSet: LimitSet = {
|
||||||
[FeatureId.USERS]: {
|
[FeatureId.USERS]: {
|
||||||
value: 100,
|
value: 50,
|
||||||
description: "Team limit"
|
description: "Team limit"
|
||||||
},
|
},
|
||||||
[FeatureId.SITES]: {
|
[FeatureId.SITES]: {
|
||||||
@@ -48,7 +48,7 @@ export const tier2LimitSet: LimitSet = {
|
|||||||
|
|
||||||
export const tier3LimitSet: LimitSet = {
|
export const tier3LimitSet: LimitSet = {
|
||||||
[FeatureId.USERS]: {
|
[FeatureId.USERS]: {
|
||||||
value: 500,
|
value: 250,
|
||||||
description: "Business limit"
|
description: "Business limit"
|
||||||
},
|
},
|
||||||
[FeatureId.SITES]: {
|
[FeatureId.SITES]: {
|
||||||
|
|||||||
@@ -131,41 +131,22 @@ export async function updateClientResources(
|
|||||||
: [];
|
: [];
|
||||||
|
|
||||||
const allSites: { siteId: number }[] = [];
|
const allSites: { siteId: number }[] = [];
|
||||||
|
|
||||||
if (resourceData.site) {
|
if (resourceData.site) {
|
||||||
let siteSingle;
|
// Look up site by niceId
|
||||||
const resourceSiteId = resourceData.site;
|
const [siteSingle] = await trx
|
||||||
|
.select({ siteId: sites.siteId })
|
||||||
if (resourceSiteId) {
|
.from(sites)
|
||||||
// Look up site by niceId
|
.where(
|
||||||
[siteSingle] = await trx
|
and(
|
||||||
.select({ siteId: sites.siteId })
|
eq(sites.niceId, resourceData.site),
|
||||||
.from(sites)
|
eq(sites.orgId, orgId)
|
||||||
.where(
|
|
||||||
and(
|
|
||||||
eq(sites.niceId, resourceSiteId),
|
|
||||||
eq(sites.orgId, orgId)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
.limit(1);
|
)
|
||||||
} else if (siteId) {
|
.limit(1);
|
||||||
// Use the provided siteId directly, but verify it belongs to the org
|
if (siteSingle) {
|
||||||
[siteSingle] = await trx
|
allSites.push(siteSingle);
|
||||||
.select({ siteId: sites.siteId })
|
|
||||||
.from(sites)
|
|
||||||
.where(
|
|
||||||
and(eq(sites.siteId, siteId), eq(sites.orgId, orgId))
|
|
||||||
)
|
|
||||||
.limit(1);
|
|
||||||
} else {
|
|
||||||
throw new Error(`Target site is required`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!siteSingle) {
|
|
||||||
throw new Error(
|
|
||||||
`Site not found: ${resourceSiteId} in org ${orgId}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
allSites.push(siteSingle);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resourceData.sites) {
|
if (resourceData.sites) {
|
||||||
@@ -180,15 +161,31 @@ export async function updateClientResources(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
.limit(1);
|
.limit(1);
|
||||||
if (!site) {
|
if (site) {
|
||||||
throw new Error(
|
allSites.push(site);
|
||||||
`Site not found: ${siteId} in org ${orgId}`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
allSites.push(site);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (siteId && allSites.length === 0) {
|
||||||
|
// only add if there are not provided sites
|
||||||
|
// Use the provided siteId directly, but verify it belongs to the org
|
||||||
|
const [siteSingle] = await trx
|
||||||
|
.select({ siteId: sites.siteId })
|
||||||
|
.from(sites)
|
||||||
|
.where(and(eq(sites.siteId, siteId), eq(sites.orgId, orgId)))
|
||||||
|
.limit(1);
|
||||||
|
if (siteSingle) {
|
||||||
|
allSites.push(siteSingle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (allSites.length === 0) {
|
||||||
|
throw new Error(
|
||||||
|
`No valid sites found for private private resource ${resourceNiceId} in org ${orgId}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (existingResource) {
|
if (existingResource) {
|
||||||
let domainInfo:
|
let domainInfo:
|
||||||
| { subdomain: string | null; domainId: string }
|
| { subdomain: string | null; domainId: string }
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
|
import path from "path";
|
||||||
import crypto from "crypto";
|
import crypto from "crypto";
|
||||||
import {
|
import {
|
||||||
certificates,
|
certificates,
|
||||||
@@ -274,12 +275,244 @@ function detectWildcard(
|
|||||||
return { wildcard: false, wildcardSan: null };
|
return { wildcard: false, wildcardSan: null };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface HttpCert {
|
||||||
|
wildcard: boolean;
|
||||||
|
altName: string;
|
||||||
|
certName: string;
|
||||||
|
commonName: string;
|
||||||
|
certFile: string;
|
||||||
|
keyFile: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function syncAcmeCertsFromHttp(endpoint: string): Promise<void> {
|
||||||
|
let response: Response;
|
||||||
|
try {
|
||||||
|
response = await fetch(endpoint);
|
||||||
|
} catch (err) {
|
||||||
|
logger.debug(
|
||||||
|
`acmeCertSync: could not reach HTTP endpoint ${endpoint}: ${err}`
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
logger.debug(
|
||||||
|
`acmeCertSync: HTTP endpoint returned status ${response.status}`
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let httpCerts: HttpCert[];
|
||||||
|
try {
|
||||||
|
httpCerts = await response.json();
|
||||||
|
} catch (err) {
|
||||||
|
logger.debug(
|
||||||
|
`acmeCertSync: could not parse JSON from HTTP endpoint: ${err}`
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Array.isArray(httpCerts) || httpCerts.length === 0) {
|
||||||
|
logger.debug(
|
||||||
|
`acmeCertSync: no certificates returned from HTTP endpoint`
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const cert of httpCerts) {
|
||||||
|
const domain = cert?.certName;
|
||||||
|
|
||||||
|
if (!domain || typeof domain !== "string") {
|
||||||
|
logger.debug(
|
||||||
|
`acmeCertSync: skipping HTTP cert with missing certName`
|
||||||
|
);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const certPem = cert.certFile;
|
||||||
|
const keyPem = cert.keyFile;
|
||||||
|
|
||||||
|
if (!certPem?.trim() || !keyPem?.trim()) {
|
||||||
|
logger.debug(
|
||||||
|
`acmeCertSync: skipping HTTP cert for ${domain} - empty certFile or keyFile`
|
||||||
|
);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const firstCertPemForValidation = extractFirstCert(certPem);
|
||||||
|
if (!firstCertPemForValidation) {
|
||||||
|
logger.debug(
|
||||||
|
`acmeCertSync: skipping HTTP cert for ${domain} - no PEM certificate block found`
|
||||||
|
);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
let validatedX509: crypto.X509Certificate;
|
||||||
|
try {
|
||||||
|
validatedX509 = new crypto.X509Certificate(
|
||||||
|
firstCertPemForValidation
|
||||||
|
);
|
||||||
|
} catch (err) {
|
||||||
|
logger.debug(
|
||||||
|
`acmeCertSync: skipping HTTP cert for ${domain} - invalid X.509 certificate: ${err}`
|
||||||
|
);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
crypto.createPrivateKey(keyPem);
|
||||||
|
} catch (err) {
|
||||||
|
logger.debug(
|
||||||
|
`acmeCertSync: skipping HTTP cert for ${domain} - invalid private key: ${err}`
|
||||||
|
);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const wildcard = cert.wildcard ?? false;
|
||||||
|
|
||||||
|
const existing = await db
|
||||||
|
.select()
|
||||||
|
.from(certificates)
|
||||||
|
.where(eq(certificates.domain, domain))
|
||||||
|
.limit(1);
|
||||||
|
|
||||||
|
let oldCertPem: string | null = null;
|
||||||
|
let oldKeyPem: string | null = null;
|
||||||
|
|
||||||
|
if (existing.length > 0 && existing[0].certFile) {
|
||||||
|
try {
|
||||||
|
const storedCertPem = decrypt(
|
||||||
|
existing[0].certFile,
|
||||||
|
config.getRawConfig().server.secret!
|
||||||
|
);
|
||||||
|
const wildcardUnchanged = existing[0].wildcard === wildcard;
|
||||||
|
if (storedCertPem === certPem && wildcardUnchanged) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
oldCertPem = storedCertPem;
|
||||||
|
if (existing[0].keyFile) {
|
||||||
|
try {
|
||||||
|
oldKeyPem = decrypt(
|
||||||
|
existing[0].keyFile,
|
||||||
|
config.getRawConfig().server.secret!
|
||||||
|
);
|
||||||
|
} catch (keyErr) {
|
||||||
|
logger.debug(
|
||||||
|
`acmeCertSync: could not decrypt stored key for ${domain}: ${keyErr}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
logger.debug(
|
||||||
|
`acmeCertSync: could not decrypt stored cert for ${domain}, will update: ${err}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let expiresAt: number | null = null;
|
||||||
|
try {
|
||||||
|
expiresAt = Math.floor(
|
||||||
|
new Date(validatedX509.validTo).getTime() / 1000
|
||||||
|
);
|
||||||
|
} catch (err) {
|
||||||
|
logger.debug(
|
||||||
|
`acmeCertSync: could not parse cert expiry for ${domain}: ${err}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const encryptedCert = encrypt(
|
||||||
|
certPem,
|
||||||
|
config.getRawConfig().server.secret!
|
||||||
|
);
|
||||||
|
const encryptedKey = encrypt(
|
||||||
|
keyPem,
|
||||||
|
config.getRawConfig().server.secret!
|
||||||
|
);
|
||||||
|
const now = Math.floor(Date.now() / 1000);
|
||||||
|
|
||||||
|
const domainId = await findDomainId(domain);
|
||||||
|
if (domainId) {
|
||||||
|
logger.debug(
|
||||||
|
`acmeCertSync: resolved domainId "${domainId}" for HTTP cert domain "${domain}"`
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
logger.debug(
|
||||||
|
`acmeCertSync: no matching domain record found for HTTP cert domain "${domain}"`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (existing.length > 0) {
|
||||||
|
logger.debug(
|
||||||
|
`acmeCertSync: updating existing certificate (HTTP) for ${domain} (expires ${expiresAt ? new Date(expiresAt * 1000).toISOString() : "unknown"})`
|
||||||
|
);
|
||||||
|
await db
|
||||||
|
.update(certificates)
|
||||||
|
.set({
|
||||||
|
certFile: encryptedCert,
|
||||||
|
keyFile: encryptedKey,
|
||||||
|
status: "valid",
|
||||||
|
expiresAt,
|
||||||
|
updatedAt: now,
|
||||||
|
wildcard,
|
||||||
|
...(domainId !== null && { domainId })
|
||||||
|
})
|
||||||
|
.where(eq(certificates.domain, domain));
|
||||||
|
|
||||||
|
await pushCertUpdateToAffectedNewts(
|
||||||
|
domain,
|
||||||
|
domainId,
|
||||||
|
oldCertPem,
|
||||||
|
oldKeyPem
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
logger.debug(
|
||||||
|
`acmeCertSync: inserting new certificate (HTTP) for ${domain} (expires ${expiresAt ? new Date(expiresAt * 1000).toISOString() : "unknown"})`
|
||||||
|
);
|
||||||
|
await db.insert(certificates).values({
|
||||||
|
domain,
|
||||||
|
domainId,
|
||||||
|
certFile: encryptedCert,
|
||||||
|
keyFile: encryptedKey,
|
||||||
|
status: "valid",
|
||||||
|
expiresAt,
|
||||||
|
createdAt: now,
|
||||||
|
updatedAt: now,
|
||||||
|
wildcard
|
||||||
|
});
|
||||||
|
|
||||||
|
await pushCertUpdateToAffectedNewts(domain, domainId, null, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function findAcmeJsonFiles(dirPath: string): string[] {
|
||||||
|
const results: string[] = [];
|
||||||
|
let entries: fs.Dirent[];
|
||||||
|
try {
|
||||||
|
entries = fs.readdirSync(dirPath, { withFileTypes: true });
|
||||||
|
} catch (err) {
|
||||||
|
logger.warn(
|
||||||
|
`acmeCertSync: could not read directory "${dirPath}": ${err}`
|
||||||
|
);
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
for (const entry of entries) {
|
||||||
|
const fullPath = path.join(dirPath, entry.name);
|
||||||
|
if (entry.isDirectory()) {
|
||||||
|
results.push(...findAcmeJsonFiles(fullPath));
|
||||||
|
} else if (entry.isFile() && entry.name === "acme.json") {
|
||||||
|
results.push(fullPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
async function syncAcmeCerts(acmeJsonPath: string): Promise<void> {
|
async function syncAcmeCerts(acmeJsonPath: string): Promise<void> {
|
||||||
let raw: string;
|
let raw: string;
|
||||||
try {
|
try {
|
||||||
raw = fs.readFileSync(acmeJsonPath, "utf8");
|
raw = fs.readFileSync(acmeJsonPath, "utf8");
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger.debug(`acmeCertSync: could not read ${acmeJsonPath}: ${err}`);
|
logger.warn(`acmeCertSync: could not read "${acmeJsonPath}": ${err}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -287,7 +520,9 @@ async function syncAcmeCerts(acmeJsonPath: string): Promise<void> {
|
|||||||
try {
|
try {
|
||||||
acmeJson = JSON.parse(raw);
|
acmeJson = JSON.parse(raw);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger.debug(`acmeCertSync: could not parse acme.json: ${err}`);
|
logger.warn(
|
||||||
|
`acmeCertSync: could not parse "${acmeJsonPath}" as JSON: ${err}`
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -389,11 +624,7 @@ async function syncAcmeCerts(acmeJsonPath: string): Promise<void> {
|
|||||||
const existing = await db
|
const existing = await db
|
||||||
.select()
|
.select()
|
||||||
.from(certificates)
|
.from(certificates)
|
||||||
.where(
|
.where(and(eq(certificates.domain, domain)))
|
||||||
and(
|
|
||||||
eq(certificates.domain, domain)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.limit(1);
|
.limit(1);
|
||||||
|
|
||||||
let oldCertPem: string | null = null;
|
let oldCertPem: string | null = null;
|
||||||
@@ -408,7 +639,7 @@ async function syncAcmeCerts(acmeJsonPath: string): Promise<void> {
|
|||||||
const wildcardUnchanged = existing[0].wildcard === wildcard;
|
const wildcardUnchanged = existing[0].wildcard === wildcard;
|
||||||
if (storedCertPem === certPem && wildcardUnchanged) {
|
if (storedCertPem === certPem && wildcardUnchanged) {
|
||||||
// logger.debug(
|
// logger.debug(
|
||||||
// `acmeCertSync: cert for ${domain} is unchanged, skipping`
|
// `acmeCertSync: cert for ${domain} is unchanged, skipping`
|
||||||
// );
|
// );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -547,19 +778,62 @@ export function initAcmeCertSync(): void {
|
|||||||
privateConfigData.acme?.acme_json_path ??
|
privateConfigData.acme?.acme_json_path ??
|
||||||
"config/letsencrypt/acme.json";
|
"config/letsencrypt/acme.json";
|
||||||
const intervalMs = privateConfigData.acme?.sync_interval_ms ?? 5000;
|
const intervalMs = privateConfigData.acme?.sync_interval_ms ?? 5000;
|
||||||
|
const httpEndpoint = privateConfigData.acme?.acme_http_endpoint;
|
||||||
|
|
||||||
logger.debug(
|
logger.debug(
|
||||||
`acmeCertSync: starting ACME cert sync from "${acmeJsonPath}" across all resolvers every ${intervalMs}ms`
|
`acmeCertSync: starting ACME cert sync from "${acmeJsonPath}" across all resolvers every ${intervalMs}ms`
|
||||||
);
|
);
|
||||||
|
if (httpEndpoint) {
|
||||||
|
logger.debug(
|
||||||
|
`acmeCertSync: also syncing from HTTP endpoint "${httpEndpoint}" every ${intervalMs}ms`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const runSync = () => {
|
||||||
|
if (httpEndpoint) {
|
||||||
|
syncAcmeCertsFromHttp(httpEndpoint).catch((err) => {
|
||||||
|
logger.error(`acmeCertSync: error during HTTP sync: ${err}`);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// only run the file-based sync if the HTTP endpoint is not configured, to avoid doubling up
|
||||||
|
let stat: fs.Stats | null = null;
|
||||||
|
try {
|
||||||
|
stat = fs.statSync(acmeJsonPath);
|
||||||
|
} catch (err) {
|
||||||
|
logger.warn(
|
||||||
|
`acmeCertSync: cannot stat path "${acmeJsonPath}": ${err}`
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stat.isDirectory()) {
|
||||||
|
const files = findAcmeJsonFiles(acmeJsonPath);
|
||||||
|
if (files.length === 0) {
|
||||||
|
logger.debug(
|
||||||
|
`acmeCertSync: no acme.json files found in directory "${acmeJsonPath}"`
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
logger.debug(
|
||||||
|
`acmeCertSync: found ${files.length} acme.json file(s) in directory "${acmeJsonPath}"`
|
||||||
|
);
|
||||||
|
for (const file of files) {
|
||||||
|
syncAcmeCerts(file).catch((err) => {
|
||||||
|
logger.error(
|
||||||
|
`acmeCertSync: error during sync of "${file}": ${err}`
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
syncAcmeCerts(acmeJsonPath).catch((err) => {
|
||||||
|
logger.error(`acmeCertSync: error during sync: ${err}`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// Run immediately on init, then on the configured interval
|
// Run immediately on init, then on the configured interval
|
||||||
syncAcmeCerts(acmeJsonPath).catch((err) => {
|
runSync();
|
||||||
logger.error(`acmeCertSync: error during initial sync: ${err}`);
|
|
||||||
});
|
|
||||||
|
|
||||||
setInterval(() => {
|
setInterval(runSync, intervalMs);
|
||||||
syncAcmeCerts(acmeJsonPath).catch((err) => {
|
|
||||||
logger.error(`acmeCertSync: error during sync: ${err}`);
|
|
||||||
});
|
|
||||||
}, intervalMs);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,12 +19,13 @@ import { eq, and, ne } from "drizzle-orm";
|
|||||||
|
|
||||||
export async function getOrgTierData(
|
export async function getOrgTierData(
|
||||||
orgId: string
|
orgId: string
|
||||||
): Promise<{ tier: Tier | null; active: boolean }> {
|
): Promise<{ tier: Tier | null; active: boolean; isTrial: boolean }> {
|
||||||
let tier: Tier | null = null;
|
let tier: Tier | null = null;
|
||||||
let active = false;
|
let active = false;
|
||||||
|
let isTrial = false;
|
||||||
|
|
||||||
if (build !== "saas") {
|
if (build !== "saas") {
|
||||||
return { tier, active };
|
return { tier, active, isTrial };
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -35,7 +36,7 @@ export async function getOrgTierData(
|
|||||||
.limit(1);
|
.limit(1);
|
||||||
|
|
||||||
if (!org) {
|
if (!org) {
|
||||||
return { tier, active };
|
return { tier, active, isTrial };
|
||||||
}
|
}
|
||||||
|
|
||||||
let orgIdToUse = org.orgId;
|
let orgIdToUse = org.orgId;
|
||||||
@@ -44,7 +45,7 @@ export async function getOrgTierData(
|
|||||||
logger.warn(
|
logger.warn(
|
||||||
`Org ${orgId} is not a billing org and does not have a billingOrgId`
|
`Org ${orgId} is not a billing org and does not have a billingOrgId`
|
||||||
);
|
);
|
||||||
return { tier, active };
|
return { tier, active, isTrial };
|
||||||
}
|
}
|
||||||
orgIdToUse = org.billingOrgId;
|
orgIdToUse = org.billingOrgId;
|
||||||
}
|
}
|
||||||
@@ -57,7 +58,7 @@ export async function getOrgTierData(
|
|||||||
.limit(1);
|
.limit(1);
|
||||||
|
|
||||||
if (!customer) {
|
if (!customer) {
|
||||||
return { tier, active };
|
return { tier, active, isTrial };
|
||||||
}
|
}
|
||||||
|
|
||||||
// Query for active subscriptions that are not license type
|
// Query for active subscriptions that are not license type
|
||||||
@@ -84,11 +85,13 @@ export async function getOrgTierData(
|
|||||||
tier = subscription.type;
|
tier = subscription.type;
|
||||||
active = true;
|
active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isTrial = subscription.trial ?? false;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// If org not found or error occurs, return null tier and inactive
|
// If org not found or error occurs, return null tier and inactive
|
||||||
// This is acceptable behavior as per the function signature
|
// This is acceptable behavior as per the function signature
|
||||||
}
|
}
|
||||||
|
|
||||||
return { tier, active };
|
return { tier, active, isTrial };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,173 +21,172 @@ import { getEnvOrYaml } from "@server/lib/getEnvOrYaml";
|
|||||||
|
|
||||||
const portSchema = z.number().positive().gt(0).lte(65535);
|
const portSchema = z.number().positive().gt(0).lte(65535);
|
||||||
|
|
||||||
export const privateConfigSchema = z.object({
|
export const privateConfigSchema = z
|
||||||
app: z
|
.object({
|
||||||
.object({
|
app: z
|
||||||
region: z.string().optional().default("default"),
|
.object({
|
||||||
base_domain: z.string().optional(),
|
region: z.string().optional().default("default"),
|
||||||
identity_provider_mode: z.enum(["global", "org"]).optional()
|
base_domain: z.string().optional(),
|
||||||
})
|
identity_provider_mode: z.enum(["global", "org"]).optional()
|
||||||
.optional()
|
})
|
||||||
.default({
|
.optional()
|
||||||
region: "default"
|
.default({
|
||||||
}),
|
region: "default"
|
||||||
server: z
|
}),
|
||||||
.object({
|
server: z
|
||||||
reo_client_id: z
|
.object({
|
||||||
.string()
|
reo_client_id: z
|
||||||
.optional()
|
.string()
|
||||||
.transform(getEnvOrYaml("REO_CLIENT_ID")),
|
.optional()
|
||||||
fossorial_api: z
|
.transform(getEnvOrYaml("REO_CLIENT_ID")),
|
||||||
.string()
|
fossorial_api: z
|
||||||
.optional()
|
.string()
|
||||||
.default("https://api.fossorial.io"),
|
.optional()
|
||||||
fossorial_api_key: z
|
.default("https://api.fossorial.io"),
|
||||||
.string()
|
fossorial_api_key: z
|
||||||
.optional()
|
.string()
|
||||||
.transform(getEnvOrYaml("FOSSORIAL_API_KEY"))
|
.optional()
|
||||||
})
|
.transform(getEnvOrYaml("FOSSORIAL_API_KEY"))
|
||||||
.optional()
|
})
|
||||||
.prefault({}),
|
.optional()
|
||||||
redis: z
|
.prefault({}),
|
||||||
.object({
|
redis: z
|
||||||
host: z.string(),
|
.object({
|
||||||
port: portSchema,
|
host: z.string(),
|
||||||
password: z
|
port: portSchema,
|
||||||
.string()
|
password: z
|
||||||
.optional()
|
.string()
|
||||||
.transform(getEnvOrYaml("REDIS_PASSWORD")),
|
.optional()
|
||||||
db: z.int().nonnegative().optional().default(0),
|
.transform(getEnvOrYaml("REDIS_PASSWORD")),
|
||||||
replicas: z
|
db: z.int().nonnegative().optional().default(0),
|
||||||
.array(
|
replicas: z
|
||||||
z.object({
|
.array(
|
||||||
host: z.string(),
|
z.object({
|
||||||
port: portSchema,
|
host: z.string(),
|
||||||
password: z.string().optional(),
|
port: portSchema,
|
||||||
db: z.int().nonnegative().optional().default(0)
|
password: z.string().optional(),
|
||||||
|
db: z.int().nonnegative().optional().default(0)
|
||||||
|
})
|
||||||
|
)
|
||||||
|
.optional(),
|
||||||
|
tls: z
|
||||||
|
.object({
|
||||||
|
rejectUnauthorized: z.boolean().optional().default(true)
|
||||||
})
|
})
|
||||||
)
|
.optional()
|
||||||
.optional(),
|
})
|
||||||
tls: z
|
.optional(),
|
||||||
.object({
|
gerbil: z
|
||||||
rejectUnauthorized: z
|
.object({
|
||||||
.boolean()
|
local_exit_node_reachable_at: z
|
||||||
.optional()
|
.string()
|
||||||
.default(true)
|
.optional()
|
||||||
})
|
.default("http://gerbil:3004")
|
||||||
.optional()
|
})
|
||||||
})
|
.optional()
|
||||||
.optional(),
|
.prefault({}),
|
||||||
gerbil: z
|
flags: z
|
||||||
.object({
|
.object({
|
||||||
local_exit_node_reachable_at: z
|
enable_redis: z.boolean().optional().default(false),
|
||||||
.string()
|
use_pangolin_dns: z.boolean().optional().default(false),
|
||||||
.optional()
|
use_org_only_idp: z.boolean().optional(),
|
||||||
.default("http://gerbil:3004")
|
enable_acme_cert_sync: z.boolean().optional().default(true)
|
||||||
})
|
})
|
||||||
.optional()
|
.optional()
|
||||||
.prefault({}),
|
.prefault({}),
|
||||||
flags: z
|
acme: z
|
||||||
.object({
|
.object({
|
||||||
enable_redis: z.boolean().optional().default(false),
|
acme_json_path: z
|
||||||
use_pangolin_dns: z.boolean().optional().default(false),
|
.string()
|
||||||
use_org_only_idp: z.boolean().optional(),
|
.optional()
|
||||||
enable_acme_cert_sync: z.boolean().optional().default(true)
|
.default("config/letsencrypt/acme.json"),
|
||||||
})
|
acme_http_endpoint: z.string().optional(),
|
||||||
.optional()
|
sync_interval_ms: z.number().optional().default(5000)
|
||||||
.prefault({}),
|
})
|
||||||
acme: z
|
.optional(),
|
||||||
.object({
|
branding: z
|
||||||
acme_json_path: z
|
.object({
|
||||||
.string()
|
app_name: z.string().optional(),
|
||||||
.optional()
|
background_image_path: z.string().optional(),
|
||||||
.default("config/letsencrypt/acme.json"),
|
colors: z
|
||||||
sync_interval_ms: z.number().optional().default(5000)
|
.object({
|
||||||
})
|
light: colorsSchema.optional(),
|
||||||
.optional(),
|
dark: colorsSchema.optional()
|
||||||
branding: z
|
|
||||||
.object({
|
|
||||||
app_name: z.string().optional(),
|
|
||||||
background_image_path: z.string().optional(),
|
|
||||||
colors: z
|
|
||||||
.object({
|
|
||||||
light: colorsSchema.optional(),
|
|
||||||
dark: colorsSchema.optional()
|
|
||||||
})
|
|
||||||
.optional(),
|
|
||||||
logo: z
|
|
||||||
.object({
|
|
||||||
light_path: z.string().optional(),
|
|
||||||
dark_path: z.string().optional(),
|
|
||||||
auth_page: z
|
|
||||||
.object({
|
|
||||||
width: z.number().optional(),
|
|
||||||
height: z.number().optional()
|
|
||||||
})
|
|
||||||
.optional(),
|
|
||||||
navbar: z
|
|
||||||
.object({
|
|
||||||
width: z.number().optional(),
|
|
||||||
height: z.number().optional()
|
|
||||||
})
|
|
||||||
.optional()
|
|
||||||
})
|
|
||||||
.optional(),
|
|
||||||
footer: z
|
|
||||||
.array(
|
|
||||||
z.object({
|
|
||||||
text: z.string(),
|
|
||||||
href: z.string().optional()
|
|
||||||
})
|
})
|
||||||
)
|
.optional(),
|
||||||
.optional(),
|
logo: z
|
||||||
hide_auth_layout_footer: z.boolean().optional().default(false),
|
.object({
|
||||||
login_page: z
|
light_path: z.string().optional(),
|
||||||
.object({
|
dark_path: z.string().optional(),
|
||||||
subtitle_text: z.string().optional()
|
auth_page: z
|
||||||
})
|
.object({
|
||||||
.optional(),
|
width: z.number().optional(),
|
||||||
signup_page: z
|
height: z.number().optional()
|
||||||
.object({
|
})
|
||||||
subtitle_text: z.string().optional()
|
.optional(),
|
||||||
})
|
navbar: z
|
||||||
.optional(),
|
.object({
|
||||||
resource_auth_page: z
|
width: z.number().optional(),
|
||||||
.object({
|
height: z.number().optional()
|
||||||
show_logo: z.boolean().optional(),
|
})
|
||||||
hide_powered_by: z.boolean().optional(),
|
.optional()
|
||||||
title_text: z.string().optional(),
|
})
|
||||||
subtitle_text: z.string().optional()
|
.optional(),
|
||||||
})
|
footer: z
|
||||||
.optional(),
|
.array(
|
||||||
emails: z
|
z.object({
|
||||||
.object({
|
text: z.string(),
|
||||||
signature: z.string().optional(),
|
href: z.string().optional()
|
||||||
colors: z
|
|
||||||
.object({
|
|
||||||
primary: z.string().optional()
|
|
||||||
})
|
})
|
||||||
.optional()
|
)
|
||||||
})
|
.optional(),
|
||||||
.optional()
|
hide_auth_layout_footer: z.boolean().optional().default(false),
|
||||||
})
|
login_page: z
|
||||||
.optional(),
|
.object({
|
||||||
stripe: z
|
subtitle_text: z.string().optional()
|
||||||
.object({
|
})
|
||||||
secret_key: z
|
.optional(),
|
||||||
.string()
|
signup_page: z
|
||||||
.optional()
|
.object({
|
||||||
.transform(getEnvOrYaml("STRIPE_SECRET_KEY")),
|
subtitle_text: z.string().optional()
|
||||||
webhook_secret: z
|
})
|
||||||
.string()
|
.optional(),
|
||||||
.optional()
|
resource_auth_page: z
|
||||||
.transform(getEnvOrYaml("STRIPE_WEBHOOK_SECRET")),
|
.object({
|
||||||
// s3Bucket: z.string(),
|
show_logo: z.boolean().optional(),
|
||||||
// s3Region: z.string().default("us-east-1"),
|
hide_powered_by: z.boolean().optional(),
|
||||||
// localFilePath: z.string().optional()
|
title_text: z.string().optional(),
|
||||||
})
|
subtitle_text: z.string().optional()
|
||||||
.optional()
|
})
|
||||||
})
|
.optional(),
|
||||||
|
emails: z
|
||||||
|
.object({
|
||||||
|
signature: z.string().optional(),
|
||||||
|
colors: z
|
||||||
|
.object({
|
||||||
|
primary: z.string().optional()
|
||||||
|
})
|
||||||
|
.optional()
|
||||||
|
})
|
||||||
|
.optional()
|
||||||
|
})
|
||||||
|
.optional(),
|
||||||
|
stripe: z
|
||||||
|
.object({
|
||||||
|
secret_key: z
|
||||||
|
.string()
|
||||||
|
.optional()
|
||||||
|
.transform(getEnvOrYaml("STRIPE_SECRET_KEY")),
|
||||||
|
webhook_secret: z
|
||||||
|
.string()
|
||||||
|
.optional()
|
||||||
|
.transform(getEnvOrYaml("STRIPE_WEBHOOK_SECRET"))
|
||||||
|
// s3Bucket: z.string(),
|
||||||
|
// s3Region: z.string().default("us-east-1"),
|
||||||
|
// localFilePath: z.string().optional()
|
||||||
|
})
|
||||||
|
.optional()
|
||||||
|
})
|
||||||
.transform((data) => {
|
.transform((data) => {
|
||||||
// this to maintain backwards compatibility with the old config file
|
// this to maintain backwards compatibility with the old config file
|
||||||
const identityProviderMode = data.app?.identity_provider_mode;
|
const identityProviderMode = data.app?.identity_provider_mode;
|
||||||
|
|||||||
@@ -30,8 +30,10 @@ import {
|
|||||||
userOrgRoles,
|
userOrgRoles,
|
||||||
siteProvisioningKeyOrg,
|
siteProvisioningKeyOrg,
|
||||||
siteProvisioningKeys,
|
siteProvisioningKeys,
|
||||||
|
alertRules,
|
||||||
|
targetHealthCheck
|
||||||
} from "@server/db";
|
} from "@server/db";
|
||||||
import { and, eq } from "drizzle-orm";
|
import { and, eq, isNull } from "drizzle-orm";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the maximum allowed retention days for a given tier
|
* Get the maximum allowed retention days for a given tier
|
||||||
@@ -318,6 +320,14 @@ async function disableFeature(
|
|||||||
await disableSiteProvisioningKeys(orgId);
|
await disableSiteProvisioningKeys(orgId);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case TierFeature.AlertingRules:
|
||||||
|
await disableAlertingRules(orgId);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TierFeature.StandaloneHealthChecks:
|
||||||
|
await disableStandaloneHealthChecks(orgId);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
logger.warn(
|
logger.warn(
|
||||||
`Unknown feature ${feature} for org ${orgId}, skipping`
|
`Unknown feature ${feature} for org ${orgId}, skipping`
|
||||||
@@ -360,8 +370,7 @@ async function disableFullRbac(orgId: string): Promise<void> {
|
|||||||
async function disableSiteProvisioningKeys(orgId: string): Promise<void> {
|
async function disableSiteProvisioningKeys(orgId: string): Promise<void> {
|
||||||
const rows = await db
|
const rows = await db
|
||||||
.select({
|
.select({
|
||||||
siteProvisioningKeyId:
|
siteProvisioningKeyId: siteProvisioningKeyOrg.siteProvisioningKeyId
|
||||||
siteProvisioningKeyOrg.siteProvisioningKeyId
|
|
||||||
})
|
})
|
||||||
.from(siteProvisioningKeyOrg)
|
.from(siteProvisioningKeyOrg)
|
||||||
.where(eq(siteProvisioningKeyOrg.orgId, orgId));
|
.where(eq(siteProvisioningKeyOrg.orgId, orgId));
|
||||||
@@ -525,6 +534,29 @@ async function disablePasswordExpirationPolicies(orgId: string): Promise<void> {
|
|||||||
logger.info(`Disabled password expiration policies for org ${orgId}`);
|
logger.info(`Disabled password expiration policies for org ${orgId}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function disableAlertingRules(orgId: string): Promise<void> {
|
||||||
|
await db
|
||||||
|
.update(alertRules)
|
||||||
|
.set({ enabled: false })
|
||||||
|
.where(eq(alertRules.orgId, orgId));
|
||||||
|
|
||||||
|
logger.info(`Disabled all alert rules for org ${orgId}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function disableStandaloneHealthChecks(orgId: string): Promise<void> {
|
||||||
|
await db
|
||||||
|
.update(targetHealthCheck)
|
||||||
|
.set({ hcEnabled: false })
|
||||||
|
.where(
|
||||||
|
and(
|
||||||
|
eq(targetHealthCheck.orgId, orgId),
|
||||||
|
isNull(targetHealthCheck.targetId)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
logger.info(`Disabled standalone health checks for org ${orgId}`);
|
||||||
|
}
|
||||||
|
|
||||||
async function disableAutoProvisioning(orgId: string): Promise<void> {
|
async function disableAutoProvisioning(orgId: string): Promise<void> {
|
||||||
// Get all IDP IDs for this org through the idpOrg join table
|
// Get all IDP IDs for this org through the idpOrg join table
|
||||||
const orgIdps = await db
|
const orgIdps = await db
|
||||||
|
|||||||
@@ -174,6 +174,19 @@ export async function handleSubscriptionCreated(
|
|||||||
// TODO: update user in Sendy
|
// TODO: update user in Sendy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// delete the trial subscrition if we have one
|
||||||
|
await db
|
||||||
|
.delete(subscriptions)
|
||||||
|
.where(
|
||||||
|
and(
|
||||||
|
eq(
|
||||||
|
subscriptions.customerId,
|
||||||
|
subscription.customer as string
|
||||||
|
),
|
||||||
|
eq(subscriptions.trial, true)
|
||||||
|
)
|
||||||
|
);
|
||||||
} else if (type === "license") {
|
} else if (type === "license") {
|
||||||
logger.debug(
|
logger.debug(
|
||||||
`License subscription created for org ${customer.orgId}, no lifecycle handling needed.`
|
`License subscription created for org ${customer.orgId}, no lifecycle handling needed.`
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ export async function createCertificate(
|
|||||||
|
|
||||||
let domainToWrite = domain;
|
let domainToWrite = domain;
|
||||||
if (
|
if (
|
||||||
domainRecord.type == "wildcard" &&
|
domainRecord.type == "wildcard" && // this is to fix the wildcard certs for traefik in self hosted NOT ON THE CLOUD
|
||||||
domainRecord.preferWildcardCert &&
|
domainRecord.preferWildcardCert &&
|
||||||
!domain.startsWith("*.")
|
!domain.startsWith("*.")
|
||||||
) {
|
) {
|
||||||
@@ -89,6 +89,16 @@ export async function createCertificate(
|
|||||||
domainToWrite = parts.slice(1).join(".");
|
domainToWrite = parts.slice(1).join(".");
|
||||||
domainToWrite = `*.${domainToWrite}`;
|
domainToWrite = `*.${domainToWrite}`;
|
||||||
}
|
}
|
||||||
|
} else if (domainRecord.type == "ns") {
|
||||||
|
// first if we have a * in the domain for this case we dont want to include it because it will mess with the cert generator so remove it
|
||||||
|
if (domain.startsWith("*.")) {
|
||||||
|
domain = domain.slice(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
const parts = domain.split(".");
|
||||||
|
if (parts.length > 2) {
|
||||||
|
domainToWrite = parts.slice(1).join(".");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// No cert found, create a new one in pending state
|
// No cert found, create a new one in pending state
|
||||||
|
|||||||
@@ -67,24 +67,20 @@ if (build == "saas") {
|
|||||||
verifyApiKeyIsRoot,
|
verifyApiKeyIsRoot,
|
||||||
certificates.syncCertToNewts
|
certificates.syncCertToNewts
|
||||||
);
|
);
|
||||||
|
|
||||||
|
authenticated.post(
|
||||||
|
`/org/:orgId/send-usage-notification`,
|
||||||
|
verifyApiKeyIsRoot, // We are the only ones who can use root key so its fine
|
||||||
|
org.sendUsageNotification
|
||||||
|
);
|
||||||
|
|
||||||
|
authenticated.post(
|
||||||
|
`/org/:orgId/send-trial-notification`,
|
||||||
|
verifyApiKeyIsRoot,
|
||||||
|
org.sendTrialNotification
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
authenticated.post(
|
|
||||||
`/org/:orgId/send-usage-notification`,
|
|
||||||
verifyApiKeyIsRoot, // We are the only ones who can use root key so its fine
|
|
||||||
verifyApiKeyHasAction(ActionsEnum.sendUsageNotification),
|
|
||||||
logActionAudit(ActionsEnum.sendUsageNotification),
|
|
||||||
org.sendUsageNotification
|
|
||||||
);
|
|
||||||
|
|
||||||
authenticated.post(
|
|
||||||
`/org/:orgId/send-trial-notification`,
|
|
||||||
verifyApiKeyIsRoot,
|
|
||||||
verifyApiKeyHasAction(ActionsEnum.sendTrialNotification),
|
|
||||||
logActionAudit(ActionsEnum.sendTrialNotification),
|
|
||||||
org.sendTrialNotification
|
|
||||||
);
|
|
||||||
|
|
||||||
authenticated.delete(
|
authenticated.delete(
|
||||||
"/idp/:idpId",
|
"/idp/:idpId",
|
||||||
verifyApiKeyIsRoot,
|
verifyApiKeyIsRoot,
|
||||||
|
|||||||
@@ -104,8 +104,9 @@ export async function deleteMyAccount(
|
|||||||
(r) => r.isBillingOrg && r.isOwner
|
(r) => r.isBillingOrg && r.isOwner
|
||||||
)?.orgId;
|
)?.orgId;
|
||||||
if (primaryOrgId) {
|
if (primaryOrgId) {
|
||||||
const { tier, active } = await getOrgTierData(primaryOrgId);
|
const { tier, active, isTrial } =
|
||||||
if (active && tier) {
|
await getOrgTierData(primaryOrgId);
|
||||||
|
if (active && tier && !isTrial) {
|
||||||
return next(
|
return next(
|
||||||
createHttpError(
|
createHttpError(
|
||||||
HttpCode.BAD_REQUEST,
|
HttpCode.BAD_REQUEST,
|
||||||
|
|||||||
@@ -42,9 +42,12 @@ async function query(siteId?: number, niceId?: string, orgId?: string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export type GetSiteResponse = NonNullable<
|
type SiteQueryRow = NonNullable<Awaited<ReturnType<typeof query>>>;
|
||||||
Awaited<ReturnType<typeof query>>
|
|
||||||
>["sites"] & { newtId: string | null };
|
export type GetSiteResponse = SiteQueryRow["sites"] & {
|
||||||
|
newtId: string | null;
|
||||||
|
newtVersion: string | null;
|
||||||
|
};
|
||||||
|
|
||||||
registry.registerPath({
|
registry.registerPath({
|
||||||
method: "get",
|
method: "get",
|
||||||
@@ -100,7 +103,8 @@ export async function getSite(
|
|||||||
|
|
||||||
const data: GetSiteResponse = {
|
const data: GetSiteResponse = {
|
||||||
...site.sites,
|
...site.sites,
|
||||||
newtId: site.newt ? site.newt.newtId : null
|
newtId: site.newt ? site.newt.newtId : null,
|
||||||
|
newtVersion: site.newt?.version ?? null
|
||||||
};
|
};
|
||||||
|
|
||||||
return response<GetSiteResponse>(res, {
|
return response<GetSiteResponse>(res, {
|
||||||
|
|||||||
@@ -496,11 +496,6 @@ export async function createSiteResource(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await rebuildClientAssociationsFromSiteResource(
|
|
||||||
newSiteResource,
|
|
||||||
trx
|
|
||||||
); // we need to call this because we added to the admin role
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!newSiteResource) {
|
if (!newSiteResource) {
|
||||||
@@ -526,6 +521,22 @@ export async function createSiteResource(
|
|||||||
await createCertificate(domainId, fullDomain, db);
|
await createCertificate(domainId, fullDomain, db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Run in the background after the response is sent. Wrapped in its
|
||||||
|
// own transaction so it always executes on the primary — avoiding any
|
||||||
|
// replica-lag issues while still allowing the HTTP response to return
|
||||||
|
// early.
|
||||||
|
db.transaction(async (trx) => {
|
||||||
|
await rebuildClientAssociationsFromSiteResource(
|
||||||
|
newSiteResource!,
|
||||||
|
trx
|
||||||
|
);
|
||||||
|
}).catch((err) => {
|
||||||
|
logger.error(
|
||||||
|
`Error rebuilding client associations for site resource ${newSiteResource!.siteResourceId}:`,
|
||||||
|
err
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
return response(res, {
|
return response(res, {
|
||||||
data: newSiteResource,
|
data: newSiteResource,
|
||||||
success: true,
|
success: true,
|
||||||
|
|||||||
@@ -63,17 +63,26 @@ export async function deleteSiteResource(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
await db.transaction(async (trx) => {
|
// Delete the site resource
|
||||||
// Delete the site resource
|
const [removedSiteResource] = await db
|
||||||
const [removedSiteResource] = await trx
|
.delete(siteResources)
|
||||||
.delete(siteResources)
|
.where(eq(siteResources.siteResourceId, siteResourceId))
|
||||||
.where(eq(siteResources.siteResourceId, siteResourceId))
|
.returning();
|
||||||
.returning();
|
|
||||||
|
|
||||||
|
// Run in the background after the response is sent. Wrapped in its
|
||||||
|
// own transaction so it always executes on the primary — avoiding any
|
||||||
|
// replica-lag issues while still allowing the HTTP response to return
|
||||||
|
// early.
|
||||||
|
db.transaction(async (trx) => {
|
||||||
await rebuildClientAssociationsFromSiteResource(
|
await rebuildClientAssociationsFromSiteResource(
|
||||||
removedSiteResource,
|
removedSiteResource,
|
||||||
trx
|
trx
|
||||||
);
|
);
|
||||||
|
}).catch((err) => {
|
||||||
|
logger.error(
|
||||||
|
`Error rebuilding client associations for site resource ${removedSiteResource!.siteResourceId}:`,
|
||||||
|
err
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
logger.info(`Deleted site resource ${siteResourceId}`);
|
logger.info(`Deleted site resource ${siteResourceId}`);
|
||||||
|
|||||||
@@ -431,9 +431,6 @@ export async function updateSiteResource(
|
|||||||
})
|
})
|
||||||
.returning();
|
.returning();
|
||||||
|
|
||||||
// wait some time to allow for messages to be handled
|
|
||||||
await new Promise((resolve) => setTimeout(resolve, 750));
|
|
||||||
|
|
||||||
const sshPamSet =
|
const sshPamSet =
|
||||||
isLicensedSshPam &&
|
isLicensedSshPam &&
|
||||||
(authDaemonPort !== undefined ||
|
(authDaemonPort !== undefined ||
|
||||||
@@ -556,11 +553,6 @@ export async function updateSiteResource(
|
|||||||
}))
|
}))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
await rebuildClientAssociationsFromSiteResource(
|
|
||||||
updatedSiteResource,
|
|
||||||
trx
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
// Update the site resource
|
// Update the site resource
|
||||||
const sshPamSet =
|
const sshPamSet =
|
||||||
@@ -690,7 +682,24 @@ export async function updateSiteResource(
|
|||||||
}
|
}
|
||||||
|
|
||||||
logger.info(`Updated site resource ${siteResourceId}`);
|
logger.info(`Updated site resource ${siteResourceId}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Background: wait for removal messages to propagate, then rebuild
|
||||||
|
// associations for the re-created resource. Own transaction ensures
|
||||||
|
// execution on the primary against fully committed state.
|
||||||
|
(async () => {
|
||||||
|
await db.transaction(async (trx) => {
|
||||||
|
if (!updatedSiteResource) {
|
||||||
|
throw new Error("No updated resource found after update");
|
||||||
|
}
|
||||||
|
if (sitesChanged) {
|
||||||
|
await new Promise((resolve) => setTimeout(resolve, 750));
|
||||||
|
await rebuildClientAssociationsFromSiteResource(
|
||||||
|
updatedSiteResource,
|
||||||
|
trx
|
||||||
|
);
|
||||||
|
}
|
||||||
await handleMessagingForUpdatedSiteResource(
|
await handleMessagingForUpdatedSiteResource(
|
||||||
existingSiteResource,
|
existingSiteResource,
|
||||||
updatedSiteResource,
|
updatedSiteResource,
|
||||||
@@ -700,7 +709,12 @@ export async function updateSiteResource(
|
|||||||
})),
|
})),
|
||||||
trx
|
trx
|
||||||
);
|
);
|
||||||
}
|
});
|
||||||
|
})().catch((err) => {
|
||||||
|
logger.error(
|
||||||
|
`Error rebuilding client associations for site resource ${updatedSiteResource?.siteResourceId}:`,
|
||||||
|
err
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
return response(res, {
|
return response(res, {
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ export default async function migration() {
|
|||||||
thc."targetId",
|
thc."targetId",
|
||||||
t."siteId",
|
t."siteId",
|
||||||
s."orgId",
|
s."orgId",
|
||||||
|
r."name" AS "resourceName",
|
||||||
|
t."ip",
|
||||||
|
t."port",
|
||||||
thc."hcEnabled",
|
thc."hcEnabled",
|
||||||
thc."hcPath",
|
thc."hcPath",
|
||||||
thc."hcScheme",
|
thc."hcScheme",
|
||||||
@@ -33,13 +36,17 @@ export default async function migration() {
|
|||||||
thc."hcTlsServerName"
|
thc."hcTlsServerName"
|
||||||
FROM "targetHealthCheck" thc
|
FROM "targetHealthCheck" thc
|
||||||
JOIN "targets" t ON thc."targetId" = t."targetId"
|
JOIN "targets" t ON thc."targetId" = t."targetId"
|
||||||
JOIN "sites" s ON t."siteId" = s."siteId"`
|
JOIN "sites" s ON t."siteId" = s."siteId"
|
||||||
|
JOIN "resources" r ON t."resourceId" = r."resourceId"`
|
||||||
);
|
);
|
||||||
const existingHealthChecks = healthChecksQuery.rows as {
|
const existingHealthChecks = healthChecksQuery.rows as {
|
||||||
targetHealthCheckId: number;
|
targetHealthCheckId: number;
|
||||||
targetId: number;
|
targetId: number;
|
||||||
siteId: number;
|
siteId: number;
|
||||||
orgId: string;
|
orgId: string;
|
||||||
|
resourceName: string;
|
||||||
|
ip: string;
|
||||||
|
port: number;
|
||||||
hcEnabled: boolean;
|
hcEnabled: boolean;
|
||||||
hcPath: string | null;
|
hcPath: string | null;
|
||||||
hcScheme: string | null;
|
hcScheme: string | null;
|
||||||
@@ -385,6 +392,7 @@ export default async function migration() {
|
|||||||
"targetId",
|
"targetId",
|
||||||
"orgId",
|
"orgId",
|
||||||
"siteId",
|
"siteId",
|
||||||
|
"name",
|
||||||
"hcEnabled",
|
"hcEnabled",
|
||||||
"hcPath",
|
"hcPath",
|
||||||
"hcScheme",
|
"hcScheme",
|
||||||
@@ -405,6 +413,7 @@ export default async function migration() {
|
|||||||
${hc.targetId},
|
${hc.targetId},
|
||||||
${hc.orgId},
|
${hc.orgId},
|
||||||
${hc.siteId},
|
${hc.siteId},
|
||||||
|
${`Resource ${hc.resourceName} - ${hc.ip}:${hc.port}`},
|
||||||
${hc.hcEnabled},
|
${hc.hcEnabled},
|
||||||
${hc.hcPath},
|
${hc.hcPath},
|
||||||
${hc.hcScheme},
|
${hc.hcScheme},
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ export default async function migration() {
|
|||||||
thc."targetId",
|
thc."targetId",
|
||||||
t."siteId",
|
t."siteId",
|
||||||
s."orgId",
|
s."orgId",
|
||||||
|
r."name" AS "resourceName",
|
||||||
|
t."ip",
|
||||||
|
t."port",
|
||||||
thc."hcEnabled",
|
thc."hcEnabled",
|
||||||
thc."hcPath",
|
thc."hcPath",
|
||||||
thc."hcScheme",
|
thc."hcScheme",
|
||||||
@@ -39,13 +42,17 @@ export default async function migration() {
|
|||||||
thc."hcTlsServerName"
|
thc."hcTlsServerName"
|
||||||
FROM 'targetHealthCheck' thc
|
FROM 'targetHealthCheck' thc
|
||||||
JOIN 'targets' t ON thc."targetId" = t."targetId"
|
JOIN 'targets' t ON thc."targetId" = t."targetId"
|
||||||
JOIN 'sites' s ON t."siteId" = s."siteId"`
|
JOIN 'sites' s ON t."siteId" = s."siteId"
|
||||||
|
JOIN 'resources' r ON t."resourceId" = r."resourceId"`
|
||||||
)
|
)
|
||||||
.all() as {
|
.all() as {
|
||||||
targetHealthCheckId: number;
|
targetHealthCheckId: number;
|
||||||
targetId: number;
|
targetId: number;
|
||||||
siteId: number;
|
siteId: number;
|
||||||
orgId: string;
|
orgId: string;
|
||||||
|
resourceName: string;
|
||||||
|
ip: string;
|
||||||
|
port: number;
|
||||||
hcEnabled: number;
|
hcEnabled: number;
|
||||||
hcPath: string | null;
|
hcPath: string | null;
|
||||||
hcScheme: string | null;
|
hcScheme: string | null;
|
||||||
@@ -392,6 +399,7 @@ export default async function migration() {
|
|||||||
"targetId",
|
"targetId",
|
||||||
"orgId",
|
"orgId",
|
||||||
"siteId",
|
"siteId",
|
||||||
|
"name",
|
||||||
"hcEnabled",
|
"hcEnabled",
|
||||||
"hcPath",
|
"hcPath",
|
||||||
"hcScheme",
|
"hcScheme",
|
||||||
@@ -407,7 +415,7 @@ export default async function migration() {
|
|||||||
"hcStatus",
|
"hcStatus",
|
||||||
"hcHealth",
|
"hcHealth",
|
||||||
"hcTlsServerName"
|
"hcTlsServerName"
|
||||||
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`
|
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`
|
||||||
);
|
);
|
||||||
|
|
||||||
const insertAll = db.transaction(() => {
|
const insertAll = db.transaction(() => {
|
||||||
@@ -417,6 +425,7 @@ export default async function migration() {
|
|||||||
hc.targetId,
|
hc.targetId,
|
||||||
hc.orgId,
|
hc.orgId,
|
||||||
hc.siteId,
|
hc.siteId,
|
||||||
|
`Resource ${hc.resourceName} - ${hc.ip}:${hc.port}`,
|
||||||
hc.hcEnabled,
|
hc.hcEnabled,
|
||||||
hc.hcPath,
|
hc.hcPath,
|
||||||
hc.hcScheme,
|
hc.hcScheme,
|
||||||
|
|||||||
@@ -81,10 +81,10 @@ export default function ProductUpdates({
|
|||||||
|
|
||||||
const showNewVersionPopup = Boolean(
|
const showNewVersionPopup = Boolean(
|
||||||
latestVersion &&
|
latestVersion &&
|
||||||
valid(latestVersion) &&
|
valid(latestVersion) &&
|
||||||
valid(currentVersion) &&
|
valid(currentVersion) &&
|
||||||
ignoredVersionUpdate !== latestVersion &&
|
ignoredVersionUpdate !== latestVersion &&
|
||||||
gt(latestVersion, currentVersion)
|
gt(latestVersion, currentVersion)
|
||||||
);
|
);
|
||||||
|
|
||||||
const filteredUpdates = data.updates.filter(
|
const filteredUpdates = data.updates.filter(
|
||||||
@@ -103,40 +103,51 @@ export default function ProductUpdates({
|
|||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<div className="flex flex-col gap-1">
|
<div className="flex flex-col gap-1">
|
||||||
{filteredUpdates.length > 1 && (
|
{filteredUpdates.length > 0 && (
|
||||||
<small
|
<div className="mt-3 flex flex-col gap-2">
|
||||||
className={cn(
|
{filteredUpdates.length > 1 && (
|
||||||
"text-xs text-muted-foreground flex items-center gap-1 mt-2",
|
<small
|
||||||
showMoreUpdatesText
|
className={cn(
|
||||||
? "animate-in fade-in duration-300"
|
"text-xs text-muted-foreground flex items-center gap-1",
|
||||||
: "opacity-0"
|
showMoreUpdatesText
|
||||||
|
? "animate-in fade-in duration-300"
|
||||||
|
: "opacity-0"
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<BellIcon className="flex-none size-3" />
|
||||||
|
<span>
|
||||||
|
{showNewVersionPopup
|
||||||
|
? t("productUpdateMoreInfo", {
|
||||||
|
noOfUpdates:
|
||||||
|
filteredUpdates.length
|
||||||
|
})
|
||||||
|
: t("productUpdateInfo", {
|
||||||
|
noOfUpdates:
|
||||||
|
filteredUpdates.length
|
||||||
|
})}
|
||||||
|
</span>
|
||||||
|
</small>
|
||||||
)}
|
)}
|
||||||
>
|
<ProductUpdatesListPopup
|
||||||
<BellIcon className="flex-none size-3" />
|
updates={filteredUpdates}
|
||||||
<span>
|
show={filteredUpdates.length > 0}
|
||||||
{showNewVersionPopup
|
onDimissAll={() =>
|
||||||
? t("productUpdateMoreInfo", {
|
setProductUpdatesRead([
|
||||||
noOfUpdates: filteredUpdates.length
|
...productUpdatesRead,
|
||||||
})
|
...filteredUpdates.map(
|
||||||
: t("productUpdateInfo", {
|
(update) => update.id
|
||||||
noOfUpdates: filteredUpdates.length
|
)
|
||||||
})}
|
])
|
||||||
</span>
|
}
|
||||||
</small>
|
onDimiss={(id) =>
|
||||||
|
setProductUpdatesRead([
|
||||||
|
...productUpdatesRead,
|
||||||
|
id
|
||||||
|
])
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
<ProductUpdatesListPopup
|
|
||||||
updates={filteredUpdates}
|
|
||||||
show={filteredUpdates.length > 0}
|
|
||||||
onDimissAll={() =>
|
|
||||||
setProductUpdatesRead([
|
|
||||||
...productUpdatesRead,
|
|
||||||
...filteredUpdates.map((update) => update.id)
|
|
||||||
])
|
|
||||||
}
|
|
||||||
onDimiss={(id) =>
|
|
||||||
setProductUpdatesRead([...productUpdatesRead, id])
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<NewVersionAvailable
|
<NewVersionAvailable
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||||
import { useSiteContext } from "@app/hooks/useSiteContext";
|
import { useSiteContext } from "@app/hooks/useSiteContext";
|
||||||
import {
|
import {
|
||||||
InfoSection,
|
InfoSection,
|
||||||
@@ -9,77 +9,137 @@ import {
|
|||||||
InfoSectionTitle
|
InfoSectionTitle
|
||||||
} from "@app/components/InfoSection";
|
} from "@app/components/InfoSection";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
import { useEnvContext } from "@app/hooks/useEnvContext";
|
|
||||||
|
|
||||||
type SiteInfoCardProps = {};
|
type SiteInfoCardProps = {};
|
||||||
|
|
||||||
export default function SiteInfoCard({}: SiteInfoCardProps) {
|
function formatPublicEndpoint(endpoint: string) {
|
||||||
const { site, updateSite } = useSiteContext();
|
return endpoint.includes(":")
|
||||||
const t = useTranslations();
|
? endpoint.substring(0, endpoint.lastIndexOf(":"))
|
||||||
const { env } = useEnvContext();
|
: endpoint;
|
||||||
|
}
|
||||||
|
|
||||||
const getConnectionTypeString = (type: string) => {
|
export default function SiteInfoCard({}: SiteInfoCardProps) {
|
||||||
if (type === "newt") {
|
const { site } = useSiteContext();
|
||||||
return "Newt";
|
const t = useTranslations();
|
||||||
} else if (type === "wireguard") {
|
|
||||||
return "WireGuard";
|
const identifierSection = (
|
||||||
} else if (type === "local") {
|
<InfoSection>
|
||||||
return t("local");
|
<InfoSectionTitle>{t("identifier")}</InfoSectionTitle>
|
||||||
} else {
|
<InfoSectionContent>{site.niceId}</InfoSectionContent>
|
||||||
return t("unknown");
|
</InfoSection>
|
||||||
}
|
);
|
||||||
};
|
|
||||||
|
const statusSection = (
|
||||||
|
<InfoSection>
|
||||||
|
<InfoSectionTitle>{t("status")}</InfoSectionTitle>
|
||||||
|
<InfoSectionContent>
|
||||||
|
{site.online ? (
|
||||||
|
<div className="text-green-500 flex items-center space-x-2">
|
||||||
|
<div className="w-2 h-2 bg-green-500 rounded-full"></div>
|
||||||
|
<span>{t("online")}</span>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div className="text-neutral-500 flex items-center space-x-2">
|
||||||
|
<div className="w-2 h-2 bg-neutral-500 rounded-full"></div>
|
||||||
|
<span>{t("offline")}</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</InfoSectionContent>
|
||||||
|
</InfoSection>
|
||||||
|
);
|
||||||
|
|
||||||
|
const endpointSection = site.endpoint ? (
|
||||||
|
<InfoSection>
|
||||||
|
<InfoSectionTitle>{t("publicIpEndpoint")}</InfoSectionTitle>
|
||||||
|
<InfoSectionContent>
|
||||||
|
{formatPublicEndpoint(site.endpoint)}
|
||||||
|
</InfoSectionContent>
|
||||||
|
</InfoSection>
|
||||||
|
) : null;
|
||||||
|
|
||||||
|
if (site.type === "newt") {
|
||||||
|
return (
|
||||||
|
<Alert>
|
||||||
|
<AlertDescription>
|
||||||
|
<InfoSections cols={site.endpoint ? 5 : 4}>
|
||||||
|
{identifierSection}
|
||||||
|
{statusSection}
|
||||||
|
<InfoSection>
|
||||||
|
<InfoSectionTitle>
|
||||||
|
{t("connectionType")}
|
||||||
|
</InfoSectionTitle>
|
||||||
|
<InfoSectionContent>Newt</InfoSectionContent>
|
||||||
|
</InfoSection>
|
||||||
|
<InfoSection>
|
||||||
|
<InfoSectionTitle>
|
||||||
|
{t("newtVersion")}
|
||||||
|
</InfoSectionTitle>
|
||||||
|
<InfoSectionContent>
|
||||||
|
{site.newtVersion
|
||||||
|
? `v${site.newtVersion}`
|
||||||
|
: "-"}
|
||||||
|
</InfoSectionContent>
|
||||||
|
</InfoSection>
|
||||||
|
{endpointSection}
|
||||||
|
</InfoSections>
|
||||||
|
</AlertDescription>
|
||||||
|
</Alert>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (site.type === "wireguard") {
|
||||||
|
return (
|
||||||
|
<Alert>
|
||||||
|
<AlertDescription>
|
||||||
|
<InfoSections cols={site.endpoint ? 4 : 3}>
|
||||||
|
{identifierSection}
|
||||||
|
{statusSection}
|
||||||
|
<InfoSection>
|
||||||
|
<InfoSectionTitle>
|
||||||
|
{t("connectionType")}
|
||||||
|
</InfoSectionTitle>
|
||||||
|
<InfoSectionContent>WireGuard</InfoSectionContent>
|
||||||
|
</InfoSection>
|
||||||
|
{endpointSection}
|
||||||
|
</InfoSections>
|
||||||
|
</AlertDescription>
|
||||||
|
</Alert>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (site.type === "local") {
|
||||||
|
return (
|
||||||
|
<Alert>
|
||||||
|
<AlertDescription>
|
||||||
|
<InfoSections cols={site.endpoint ? 3 : 2}>
|
||||||
|
{identifierSection}
|
||||||
|
<InfoSection>
|
||||||
|
<InfoSectionTitle>
|
||||||
|
{t("connectionType")}
|
||||||
|
</InfoSectionTitle>
|
||||||
|
<InfoSectionContent>
|
||||||
|
{t("local")}
|
||||||
|
</InfoSectionContent>
|
||||||
|
</InfoSection>
|
||||||
|
{endpointSection}
|
||||||
|
</InfoSections>
|
||||||
|
</AlertDescription>
|
||||||
|
</Alert>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Alert>
|
<Alert>
|
||||||
<AlertDescription>
|
<AlertDescription>
|
||||||
<InfoSections cols={site.endpoint ? 4 : 3}>
|
<InfoSections cols={site.endpoint ? 3 : 2}>
|
||||||
<InfoSection>
|
{identifierSection}
|
||||||
<InfoSectionTitle>{t("identifier")}</InfoSectionTitle>
|
|
||||||
<InfoSectionContent>{site.niceId}</InfoSectionContent>
|
|
||||||
</InfoSection>
|
|
||||||
{(site.type == "newt" || site.type == "wireguard") && (
|
|
||||||
<>
|
|
||||||
<InfoSection>
|
|
||||||
<InfoSectionTitle>
|
|
||||||
{t("status")}
|
|
||||||
</InfoSectionTitle>
|
|
||||||
<InfoSectionContent>
|
|
||||||
{site.online ? (
|
|
||||||
<div className="text-green-500 flex items-center space-x-2">
|
|
||||||
<div className="w-2 h-2 bg-green-500 rounded-full"></div>
|
|
||||||
<span>{t("online")}</span>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<div className="text-neutral-500 flex items-center space-x-2">
|
|
||||||
<div className="w-2 h-2 bg-neutral-500 rounded-full"></div>
|
|
||||||
<span>{t("offline")}</span>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</InfoSectionContent>
|
|
||||||
</InfoSection>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
<InfoSection>
|
<InfoSection>
|
||||||
<InfoSectionTitle>
|
<InfoSectionTitle>
|
||||||
{t("connectionType")}
|
{t("connectionType")}
|
||||||
</InfoSectionTitle>
|
</InfoSectionTitle>
|
||||||
<InfoSectionContent>
|
<InfoSectionContent>{t("unknown")}</InfoSectionContent>
|
||||||
{getConnectionTypeString(site.type)}
|
|
||||||
</InfoSectionContent>
|
|
||||||
</InfoSection>
|
</InfoSection>
|
||||||
{site.endpoint && (
|
{endpointSection}
|
||||||
<InfoSection>
|
|
||||||
<InfoSectionTitle>
|
|
||||||
{t("publicIpEndpoint")}
|
|
||||||
</InfoSectionTitle>
|
|
||||||
<InfoSectionContent>
|
|
||||||
{site.endpoint.includes(":")
|
|
||||||
? site.endpoint.substring(0, site.endpoint.lastIndexOf(":"))
|
|
||||||
: site.endpoint}
|
|
||||||
</InfoSectionContent>
|
|
||||||
</InfoSection>
|
|
||||||
)}
|
|
||||||
</InfoSections>
|
</InfoSections>
|
||||||
</AlertDescription>
|
</AlertDescription>
|
||||||
</Alert>
|
</Alert>
|
||||||
|
|||||||
@@ -113,10 +113,10 @@ export function ResourceTargetAddressItem({
|
|||||||
? selectedSite?.name
|
? selectedSite?.name
|
||||||
: t("siteSelect")}
|
: t("siteSelect")}
|
||||||
</span>
|
</span>
|
||||||
<CaretSortIcon className="ml-2h-4 w-4 shrink-0 opacity-50" />
|
<CaretSortIcon className="ml-2 h-4 w-4 shrink-0 opacity-50" />
|
||||||
</Button>
|
</Button>
|
||||||
</PopoverTrigger>
|
</PopoverTrigger>
|
||||||
<PopoverContent className="p-0 w-45">
|
<PopoverContent className="p-0">
|
||||||
<SitesSelector
|
<SitesSelector
|
||||||
orgId={orgId}
|
orgId={orgId}
|
||||||
selectedSite={selectedSite}
|
selectedSite={selectedSite}
|
||||||
@@ -225,7 +225,6 @@ export function ResourceTargetAddressItem({
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user