chore(bridge): clean up docker-compose defaults
* Drop the obsolete top-level `version: "3.9"` key (Compose v2 ignores it with a warning). * Align `POSTGRES_DB` with the database name the bridge actually opens. main.go opens "whatsapp" unconditionally, so the previous "testdb" default makes the stack fail on first `docker compose up` with `pq: database "whatsapp" does not exist`. * Replace the public placeholder `API_KEY` / `JWT_SECRET` values with CHANGE_ME markers and an inline command for generating safe ones, so a user who copy-pastes the file can't accidentally bring up a bridge with publicly-known credentials. * Drop the hard-coded `WEBHOOK_URL` pointing at a private 192.168.x n8n instance and replace with a commented optional example. The env var is read with `os.Getenv`, so leaving it unset is supported.
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
version: "3.9"
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
wa:
|
wa:
|
||||||
build:
|
build:
|
||||||
@@ -13,9 +11,12 @@ services:
|
|||||||
POSTGRES_PASS: "test"
|
POSTGRES_PASS: "test"
|
||||||
POSTGRES_HOST: "postgres"
|
POSTGRES_HOST: "postgres"
|
||||||
POSTGRES_PORT: "5432"
|
POSTGRES_PORT: "5432"
|
||||||
API_KEY: "c3VwZXItbG9uZy1yYW5kb20tc3RyaW5nLW1pbmltdW0tb2YtNjQtY2hhcmFjdGVycy15b3UtbmVlZC10by1wYXN0ZS1oZXJl"
|
# Replace with two strong, independent random strings before bringing the stack up.
|
||||||
JWT_SECRET: "YW5vdGhlci1zdXBlci1sb25nLXJhbmRvbS1zdHJpbmctbWluaW11bS1vZi02NC1jaGFyYWN0ZXJzLXlvdS1uZWVkLXRvLXBhc3RlLWhlcmU="
|
# Suggested: openssl rand -base64 64 | tr -d '\n=' | tr '/+' '_-' | head -c 64
|
||||||
WEBHOOK_URL: "http://192.168.178.52:5678/webhook-test/whatsapp"
|
API_KEY: "CHANGE_ME_TO_A_LONG_RANDOM_STRING_AT_LEAST_64_CHARS_______________"
|
||||||
|
JWT_SECRET: "CHANGE_ME_TO_A_DIFFERENT_LONG_RANDOM_STRING_AT_LEAST_64_CHARS____"
|
||||||
|
# Optional: set this to forward every inbound message to a webhook (e.g. n8n).
|
||||||
|
# WEBHOOK_URL: "http://your-host:5678/webhook/whatsapp"
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080"
|
- "8080:8080"
|
||||||
volumes:
|
volumes:
|
||||||
@@ -37,7 +38,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: "test"
|
POSTGRES_USER: "test"
|
||||||
POSTGRES_PASSWORD: "test"
|
POSTGRES_PASSWORD: "test"
|
||||||
POSTGRES_DB: "testdb"
|
POSTGRES_DB: "whatsapp"
|
||||||
ports:
|
ports:
|
||||||
- "5432:5432"
|
- "5432:5432"
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
Reference in New Issue
Block a user