feat(proxy): support external TLS termination

This commit is contained in:
2026-08-05 00:09:30 +00:00
parent a08bc60496
commit 163f408873
5 changed files with 33 additions and 1 deletions
+12
View File
@@ -52,6 +52,18 @@ export const validateEnvironment = (env) => {
errors.push('DOMAIN must be a hostname without a scheme, path, or port');
}
const caddySiteAddress = env.CADDY_SITE_ADDRESS?.trim() ?? '';
if (caddySiteAddress) {
try {
const parsed = new URL(caddySiteAddress);
if (!['http:', 'https:'].includes(parsed.protocol) || parsed.hostname !== domain || parsed.pathname !== '/') {
errors.push('CADDY_SITE_ADDRESS must be http://DOMAIN or https://DOMAIN');
}
} catch {
errors.push('CADDY_SITE_ADDRESS must be http://DOMAIN or https://DOMAIN');
}
}
const email = env.ACME_EMAIL?.trim() ?? '';
if (email && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) errors.push('ACME_EMAIL must be a valid email address');