feat(gateway): add scoped proxy egress deployment
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user