feat(gateway): add scoped proxy egress deployment

This commit is contained in:
wmq
2026-08-01 19:53:29 +08:00
parent 06112602ec
commit cf25d71fcf
14 changed files with 114 additions and 4 deletions
+2 -1
View File
@@ -31,6 +31,7 @@ const accountsFile = path.join(dataDir, 'accounts.json')
const webhookDeliveriesFile = path.join(dataDir, 'webhook-deliveries.json')
const outboundJobsFile = path.join(dataDir, 'outbound-jobs.json')
const gatewayToken = String(process.env.WHATSAPP_GATEWAY_TOKEN || '')
const defaultProxyUrl = String(process.env.WHATSAPP_DEFAULT_PROXY_URL || '').trim()
const maxMessagesPerChat = Math.max(2_000, Number(process.env.MAX_MESSAGES_PER_CHAT || 20_000))
const log = pino({ level: process.env.LOG_LEVEL || 'info' })
@@ -90,7 +91,7 @@ function accountWebhookSecret(account) {
}
function accountProxyUrl(account) {
return decryptCredential(account?.proxyUrlEncrypted || '')
return decryptCredential(account?.proxyUrlEncrypted || '') || defaultProxyUrl
}
function jsonSafe(value) {