trails/infrastructure
Ullrich Schäfer d8fd4ff655
security: bind Caddy admin API to loopback, split metrics to :2020
The flagship Caddy ran its admin API on 0.0.0.0:2019, reachable by
every container on the Docker network. The admin API can rewrite
routes and proxy targets, so a journal/planner RCE could repoint
traffic with no further auth. (The brouter-host Caddyfile already
binds admin to localhost; the flagship didn't.)

The admin endpoint also served Prometheus metrics (global `metrics`
option → admin endpoint), and Prometheus scrapes caddy:2019
cross-container — so admin couldn't just move to loopback without
breaking metrics. Split them:

- admin localhost:2019 (loopback only). All reloads are in-container
  (`docker compose exec caddy caddy reload`) so they use this endpoint
  unaffected.
- a dedicated `:2020` server exposes the read-only metrics handler;
  prometheus.yml now scrapes caddy:2020.

Validated with `caddy validate` + `caddy adapt` against caddy:2:
admin.listen=localhost:2019, srv on :2020 carries the metrics handler,
the :443 site is unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 07:56:30 +02:00
..
brouter-host Stop BRouter contention kills under rapid editing 2026-04-24 17:43:15 +02:00
caddy security: bind Caddy admin API to loopback, split metrics to :2020 2026-06-11 07:56:30 +02:00
grafana feat(infra): self-monitor the observability stack + Overpass alert 2026-06-09 12:21:16 +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 security: bind Caddy admin API to loopback, split metrics to :2020 2026-06-11 07:56:30 +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
docker-compose.staging.yml feat(journal): Garmin activity import — provider, webhook pipeline, backfill (§1–5) 2026-06-07 17:47:22 +02:00
docker-compose.yml refactor(infra): mount config dirs not single files; reload on deploy 2026-06-09 13:10:35 +02:00
secrets.app.env feat(staging): enable federation on persistent staging 2026-06-06 15:45:44 +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