Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
fix(docker): forward DATABASE_SSL to the compose app container
Yudhi Armyndharis010bd4f0c5b0
diff --git a/docker-compose.dev.yml b/docker-compose.dev.ymlindex 82777ea30..9b339a97e 100644--- a/docker-compose.dev.yml+++ b/docker-compose.dev.yml@@ -177,6 +177,8 @@ services:- DATABASE_USERNAME=${DATABASE_USERNAME:-}- DATABASE_PASSWORD=${DATABASE_PASSWORD:-}- POSTGRES_SCHEMA=${POSTGRES_SCHEMA:-}+ - DATABASE_SSL=${DATABASE_SSL:-}+ - DATABASE_SSL_REJECT_UNAUTHORIZED=${DATABASE_SSL_REJECT_UNAUTHORIZED:-}- S3_ENDPOINT=${S3_ENDPOINT:-}- S3_BUCKET=${S3_BUCKET:-}- S3_REGION=${S3_REGION:-}diff --git a/docker-compose.yml b/docker-compose.ymlindex dedde4f64..41e591501 100644--- a/docker-compose.yml+++ b/docker-compose.yml@@ -131,6 +131,9 @@ services:# PostgreSQL schema (blank-forwarded like the other DATABASE_* keys so a dashboard-saved# POSTGRES_SCHEMA in data/.env.generated applies; a real host value pins). Ignored for sqlite.- POSTGRES_SCHEMA=${POSTGRES_SCHEMA:-}+ # TLS to a managed PostgreSQL, blank-forwarded the same way.+ - DATABASE_SSL=${DATABASE_SSL:-}+ - DATABASE_SSL_REJECT_UNAUTHORIZED=${DATABASE_SSL_REJECT_UNAUTHORIZED:-}- DATABASE_SYNCHRONIZE=${DATABASE_SYNCHRONIZE:-false}# Engine. Forwarded empty by default so the dashboard (Infrastructure > Engine) selects the# active engine via data/.env.generated (defaults to whatsapp-web.js); main.ts treats a blankdiff --git a/src/config/env-precedence.spec.ts b/src/config/env-precedence.spec.tsindex a6d93c46c..0abe1eb2b 100644--- a/src/config/env-precedence.spec.ts+++ b/src/config/env-precedence.spec.ts@@ -262,8 +262,7 @@ describe.each(['docker-compose.yml', 'docker-compose.dev.yml'])('every blank for/*** The rule above binds only the keys compose forwards blank. `.env.example`'s own header promises* something wider — "every setting the dashboard owns is commented out" — and the dashboard owns- * keys that have no blank forward at all (DATABASE_SSL, POSTGRES_BUILTIN, REDIS_BUILTIN,- * MINIO_BUILTIN, DATABASE_SSL_REJECT_UNAUTHORIZED, DATABASE_POOL_SIZE, REDIS_PASSWORD). Those slipped+ * keys that have no blank forward at all (POSTGRES_BUILTIN, REDIS_BUILTIN, MINIO_BUILTIN). Those slipped* past the compose-derived check and shipped uncommented, pinning the matching Infrastructure control* for anyone who ran the documented `cp .env.example .env`.*diff --git a/src/config/env-precedence.ts b/src/config/env-precedence.tsindex 38da765af..8a8cf45bb 100644--- a/src/config/env-precedence.ts+++ b/src/config/env-precedence.ts@@ -42,6 +42,9 @@ export const BLANK_SHADOWED_ENV_KEYS: string[] = ['DATABASE_PASSWORD',// PostgreSQL schema (dashboard-managed + compose blank-forwarded, like the other DATABASE_* keys)'POSTGRES_SCHEMA',+ // PostgreSQL TLS, same arrangement: a blank forward must not pin a dashboard-saved value off.+ 'DATABASE_SSL',+ 'DATABASE_SSL_REJECT_UNAUTHORIZED',// Storage selection + S3 details (#488)'STORAGE_TYPE','STORAGE_LOCAL_PATH',diff --git a/src/modules/docker/compose-parity.spec.ts b/src/modules/docker/compose-parity.spec.tsindex 635b3a13f..dfa9aa58c 100644--- a/src/modules/docker/compose-parity.spec.ts+++ b/src/modules/docker/compose-parity.spec.ts@@ -308,8 +308,6 @@ describe('DockerService managed specs ↔ docker-compose.yml parity', () => {POSTGRES_BUILTIN: 'dashboard-managed',REDIS_BUILTIN: 'dashboard-managed',MINIO_BUILTIN: 'dashboard-managed',- DATABASE_SSL: 'dashboard-managed',- DATABASE_SSL_REJECT_UNAUTHORIZED: 'dashboard-managed',QUEUE_ENABLED: 'dashboard-managed (.env.example documents that a host value is not forwarded)',// A typo or an absent value leaves these at the SECURE / documented-default state, so not// forwarding them cannot degrade a deployment.@@ -320,8 +318,6 @@ describe('DockerService managed specs ↔ docker-compose.yml parity', () => {POSTGRES_BUILTIN: 'dashboard-managed',REDIS_BUILTIN: 'dashboard-managed',MINIO_BUILTIN: 'dashboard-managed',- DATABASE_SSL: 'dashboard-managed',- DATABASE_SSL_REJECT_UNAUTHORIZED: 'dashboard-managed',WEBHOOK_SSRF_PROTECT: 'fails safe (default on)',// The dev stack manages no built-in datastores; its daemon is the host's local socket, and a// stray DOCKER_HOST would point the app at an unrelated daemon.