Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
fix(docker): forward the legacy S3 credential names in the dev stack
Yudhi Armyndharis0fadbcee50f2
diff --git a/docker-compose.dev.yml b/docker-compose.dev.ymlindex c9b9c763c..2448a5e80 100644--- a/docker-compose.dev.yml+++ b/docker-compose.dev.yml@@ -187,6 +187,8 @@ services:- S3_REGION=${S3_REGION:-}- S3_ACCESS_KEY_ID=${S3_ACCESS_KEY_ID:-}- S3_SECRET_ACCESS_KEY=${S3_SECRET_ACCESS_KEY:-}+ - S3_ACCESS_KEY=${S3_ACCESS_KEY:-}+ - S3_SECRET_KEY=${S3_SECRET_KEY:-}- REDIS_ENABLED=${REDIS_ENABLED:-}- REDIS_HOST=${REDIS_HOST:-}- REDIS_PORT=${REDIS_PORT:-}diff --git a/src/modules/docker/compose-s3-credentials.spec.ts b/src/modules/docker/compose-s3-credentials.spec.tsnew file mode 100644index 000000000..53d98b270--- /dev/null+++ b/src/modules/docker/compose-s3-credentials.spec.ts@@ -0,0 +1,29 @@+import { readFileSync } from 'fs';+import { join } from 'path';++// js-yaml has no bundled types here; require + cast (matches the compose-parity.spec.ts pattern).+// eslint-disable-next-line @typescript-eslint/no-require-imports+const yaml = require('js-yaml') as { load: (src: string) => unknown };++/**+ * The storage layer reads S3_ACCESS_KEY / S3_SECRET_KEY when the canonical pair is unset, and+ * .env.example promises older setups keep working. A Compose file only passes on the variables it+ * lists, so one that forwards just the canonical pair leaves such a setup without credentials.+ */+describe.each(['docker-compose.yml', 'docker-compose.dev.yml'])('%s forwards the S3 credentials', file => {+ const compose = yaml.load(readFileSync(join(__dirname, '../../..', file), 'utf8')) as {+ services: Record<string, { environment?: string[] | Record<string, string> }>;+ };+ // docker-proxy and minio list their environment as a map; the API service lists it as KEY=value.+ const api = Object.values(compose.services).find(+ service => Array.isArray(service.environment) && service.environment.some(e => e.startsWith('S3_ACCESS_KEY_ID=')),+ );++ it('finds the service that carries the canonical pair', () => {+ expect(api).toBeDefined();+ });++ it.each(['S3_ACCESS_KEY_ID', 'S3_SECRET_ACCESS_KEY', 'S3_ACCESS_KEY', 'S3_SECRET_KEY'])('forwards %s', name => {+ expect(api?.environment).toContain(`${name}=\${${name}:-}`);+ });+});