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
+4
View File
@@ -1,5 +1,9 @@
FROM node:20-bookworm-slim
ARG DEBIAN_MIRROR=https://deb.debian.org/debian
ARG DEBIAN_SECURITY_MIRROR=https://deb.debian.org/debian-security
RUN sed -i "s|http://deb.debian.org/debian-security|${DEBIAN_SECURITY_MIRROR}|g; s|http://deb.debian.org/debian|${DEBIAN_MIRROR}|g" /etc/apt/sources.list.d/debian.sources
ENV NODE_ENV=production
WORKDIR /app
+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) {