trails/infrastructure
Ullrich Schäfer e2bf3ddb94
fix(infra): refuse compose up when production secrets are missing
infrastructure/docker-compose.yml had \`\${VAR:-default}\` fallbacks for
JWT_SECRET, SESSION_SECRET, and POSTGRES_PASSWORD that silently
substituted known-weak values (\`change-me-in-production\`, \`trails\`)
when the env wasn't set. A misconfigured prod deploy would happily come
up with these defaults — JWT/session forgery + a guessable Postgres
password.

Switched the four critical substitutions to \`\${VAR:?message}\` so
\`docker compose up\` fails loud instead. Mirrors the existing pattern
already used for BROUTER_URL/BROUTER_AUTH_TOKEN and (in staging) for
JWT_SECRET/SESSION_SECRET.

Sites fixed:
- journal:   DATABASE_URL (POSTGRES_PASSWORD), JWT_SECRET, SESSION_SECRET
- planner:   DATABASE_URL (POSTGRES_PASSWORD)
- postgres:  POSTGRES_PASSWORD (container itself)
- exporter:  DATA_SOURCE_NAME (POSTGRES_PASSWORD)
- staging:   both DATABASE_URLs

Production already provides all three via SOPS-encrypted
secrets.app.env, so this is a defense-in-depth change with no behavior
change on a properly-configured deploy.

Updated infrastructure/.env.example to make SESSION_SECRET explicit
(was missing) and call out the trio as required.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 22:59:09 +02:00
..
brouter-host Stop BRouter contention kills under rapid editing 2026-04-24 17:43:15 +02:00
grafana Stop the caddy-502-rate alert firing on every deploy 2026-04-26 11:51:13 +02:00
loki Pass Grafana env vars to Caddy container, fix Loki compactor config 2026-03-27 13:53:56 +01:00
postgres Add pg-boss background job queue with session expiry 2026-04-13 21:17:24 +02:00
prometheus BRouter host observability + docs 2026-04-23 23:10:45 +02:00
promtail Fix journal health check and improve log collection 2026-04-12 15:00:00 +02:00
scripts Add infrastructure: Terraform, Docker Compose, BRouter, CD pipeline (#2) 2026-03-22 13:32:01 +01:00
terraform Add staging + PR-preview environments on the flagship 2026-05-03 22:03:38 +02:00
.env.example fix(infra): refuse compose up when production secrets are missing 2026-05-25 22:59:09 +02:00
Caddyfile Update Caddyfile staging upstreams to ports 3110/3111 2026-05-03 22:48:53 +02:00
docker-compose.staging.yml fix(infra): refuse compose up when production secrets are missing 2026-05-25 22:59:09 +02:00
docker-compose.yml fix(infra): refuse compose up when production secrets are missing 2026-05-25 22:59:09 +02:00
secrets.app.env Archive komoot-import openspec change and update SOPS secrets 2026-05-23 21:33:53 +02:00
secrets.infra.env Provision Grafana Pushover contact point 2026-04-24 19:07:04 +02:00
staging.env.template Add staging + PR-preview environments on the flagship 2026-05-03 22:03:38 +02:00