Cut the edge over from nginx and certbot to Caddy
Test and deploy / test (push) Successful in 3m30s
Test and deploy / deploy (push) Has been cancelled

Caddy takes nginx's place in compose: ports 80/443, the fixed address
172.28.255.251 that cloudflared pins the public names to, the network
aliases, the healthcheck and the autoheal label. nginx and certbot are
removed from compose; Caddy already holds its own certificates in
./caddy/data, obtained while it ran beside nginx. `traffic` now tails
logs/caddy/payloads.log, and the dev override switches Caddy to its dev
sites instead of putting nginx in DEV_MODE.

Docs and comments that described nginx's behaviour now describe Caddy's:
CLAUDE.md, DEPLOYMENT.md (topology, boot paths, TLS, rate limits, runbook
with a rollback, rough edges), the READMEs, .env.example and the comments
in the backend, Python service, Vue source and infra files. nginx/ and
certbot/ stay in the repo as the rollback until this has settled.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-11-17 23:28:28 +00:00
co-authored by Claude Opus 5.5
parent e09b90afaa
commit daa2a465fb
54 changed files with 547 additions and 655 deletions
+21 -26
View File
@@ -7,8 +7,7 @@
# it parses the file, before any container exists. This is how container
# names and published ports are built.
# 2. `env_file: ./.env` on a service. Injects the WHOLE file as environment
# variables inside that container. nginx, backend, db, icecast2,
# certbot and gitea all do this.
# variables inside that container. backend, db and icecast2 do this.
# The `python` and `jobs` services deliberately do neither wholesale — each
# uses an explicit `environment:` allow-list, so neither sees the site's
# database password, the JWT secret, or any key it does not use.
@@ -54,7 +53,7 @@ POSTGRES_TRACKER_USER=tracker
POSTGRES_TRACKER_PASSWORD=
# --- Gitea -------------------------------------------------------------------
# GITEA_HOST is the container name AND the nginx upstream host.
# GITEA_HOST is the container name AND the Caddy upstream host.
# The three secrets below are passed as GITEA__section__KEY overrides so the
# committed app.ini.template can keep those fields blank. Generate each as a
# long random hex string.
@@ -125,14 +124,10 @@ ADZUNA_APP_ID=
ADZUNA_APP_KEY=
REED_API_KEY=
# --- Services that nginx substitutes but no longer runs -----------------------
# Kept because nginx/entrypoint.sh lists them in its envsubst allow-list; no
# compose service uses them today. Harmless if blank.
# --- SilverBullet (notes) ---------------------------------------------------
# Two instances over the same vault: the admin-only editor at /sb/, and the
# public read-only notes site at /notes/ (which replaced Quartz). All four
# default in nginx/entrypoint.sh and docker-compose.yml, so they can be left
# default in docker-compose.yml (the caddy service's list), so they can be left
# blank.
SILVERBULLET_HOST=silverbullet
SILVERBULLET_PORT=3000
@@ -142,8 +137,8 @@ SILVERBULLET_PUBLIC_PORT=3000
SILVERBULLET_GIT_INTERVAL=
# --- Go backend --------------------------------------------------------------
# BACKEND_HOST is the container name and the nginx upstream.
# BACKEND_ENDPOINT is the public URL prefix nginx mounts the API at and then
# BACKEND_HOST is the container name and the Caddy upstream.
# BACKEND_ENDPOINT is the public URL prefix Caddy mounts the API at and then
# strips; the Vue app's GraphQL client assumes /api.
# BACKEND_SECRET signs the JWTs stored in the auth cookies — rotating it logs
# everyone out.
@@ -173,7 +168,7 @@ SPOTIFY_AUTH_STATE=
# ICECAST_SOURCE_PASSWORD is used TWICE: liquidsoap authenticates to icecast
# with it, and a live-broadcasting client authenticates to the liquidsoap
# harbor port with it. Anyone holding it can take over the stream.
# LIQUIDSOAP_HARBOR_PORT is the only non-nginx port published to the host.
# LIQUIDSOAP_HARBOR_PORT is the only non-Caddy port published to the host.
ICECAST_SOURCE_PASSWORD=
ICECAST_RELAY_PASSWORD=
ICECAST_ADMIN_USER=
@@ -185,10 +180,11 @@ LIQUIDSOAP_HARBOR_MOUNT=/live
LIQUIDSOAP_HARBOR_PORT=8001
# --- TLS / identity ----------------------------------------------------------
# DOMAIN is the APEX domain with no scheme and no www; certbot requests both
# it and www.DOMAIN on one certificate, and nginx canonicalises to www.
# EMAIL is the Let's Encrypt account address for certbot. Caddy registers
# its ACME account without one (Let's Encrypt no longer sends expiry notices).
# DOMAIN is the APEX domain with no scheme and no www; Caddy gets a
# certificate for it and for www.DOMAIN, and canonicalises to www.
# EMAIL was certbot's Let's Encrypt account address. Nothing reads it since
# the move to Caddy, which registers its ACME account without one; it stays
# for the nginx/certbot rollback (DEPLOYMENT.md §7).
DOMAIN=
EMAIL=
@@ -199,13 +195,12 @@ EMAIL=
# dashboard, not here; see "Cloudflare Tunnel" in DEPLOYMENT.md. Blank leaves
# the container restarting with an error and the site reachable directly.
CLOUDFLARE_TUNNEL_TOKEN=
# Cloudflare API token for the DNS-01 challenge (My Profile -> API Tokens ->
# Create Token -> "Edit zone DNS", limited to this zone). Set, the certificate
# renews without any inbound port, so the router's 80/443 forwards can close.
# certbot: blank falls back to HTTP-01 on port 80.
# Caddy (caddy/sites/prod.caddy) has no fallback and also needs Zone -> Zone
# -> Read on the same zone, so add that permission to the token. Changing it
# needs `docker compose up -d caddy`.
# Cloudflare API token for Caddy's DNS-01 challenge (caddy/sites/prod.caddy):
# My Profile -> API Tokens -> Create Token -> "Edit zone DNS", limited to this
# zone, then add Zone -> Zone -> Read on the same zone (the template only has
# DNS -> Edit). Certificates are issued and renewed with no inbound port, so
# the router forwards nothing. Required in production: Caddy has no HTTP
# challenge to fall back to. Changing it needs `docker compose up -d caddy`.
CLOUDFLARE_DNS_API_TOKEN=
# --- Third-party API keys (backend) ------------------------------------------
@@ -286,14 +281,14 @@ TRACKER_TZ=Europe/London
# --- Receipt printer (/receipt/) ---------------------------------------------
# Not a container here: `receipt serve` (adamf/receipt_maker) runs on stppi,
# which reaches the printer over the home LAN, and nginx proxies to it over
# which reaches the printer over the home LAN, and Caddy proxies to it over
# Tailscale.
# host:port of that server, by Tailscale IP. Blank points nowhere and
# /receipt/ answers "offline".
RECEIPT_WEB_UPSTREAM=100.107.152.119:8765
# Shared secret nginx adds as X-Receipt-Token; the same value as
# Shared secret Caddy adds as X-Receipt-Token; the same value as
# RECEIPT_WEB_TOKEN in stppi's ~/.config/receipt-web.env. Generate with
# `openssl rand -hex 32`. Changing it needs `docker compose up -d nginx`.
# `openssl rand -hex 32`. Changing it needs `docker compose up -d caddy`.
RECEIPT_WEB_TOKEN=
# TfL Unified API key (500 req/min); used by the Python hotel finder
@@ -318,7 +313,7 @@ S3_SECRET_ACCESS_KEY=
# Blank keeps uploads on disk. Set to http://garage:3900 (after running
# garage/bootstrap.sh) to store new public uploads in the bucket; recreate the
# backend after changing it. If a write to Garage fails the backend logs it and
# writes to disk instead, and nginx serves the file from there.
# writes to disk instead, and Caddy serves the file from there.
S3_ENDPOINT=
# Optional; these defaults match garage.toml and bootstrap.sh.
S3_REGION=garage