add goatcounter tracking to all sites via nginx sub_filter
Deploy nginx / deploy (push) Successful in 4s

This commit is contained in:
2026-04-09 16:54:35 -04:00
parent 553b77788d
commit 449b763621
12 changed files with 38 additions and 2 deletions
+13
View File
@@ -133,6 +133,19 @@ If any secret is missing, deploy fails with an error (not a warning).
- **One domain per conf file** — `deploy.sh` derives the cert name from the
filename and collects all `server_name` values for that cert
## GoatCounter (analytics)
GoatCounter runs at `goatcounter.hantim.net` for privacy-friendly web analytics.
**Script injection:** nginx injects the GoatCounter tracking script into all
HTML responses via `sub_filter`. The shared include `conf.d/goatcounter.inc`
is added to each site's main HTTPS server block. New sites get it automatically
via `app.sh`.
**Config:** `docker/goatcounter/compose.yaml` uses the `baethon/goatcounter`
image. Password is stored in Bitwarden (`hantim-goatcounter-password`) and
injected via the `.env.keys` mechanism.
## URL routing
- All HTTP → HTTPS redirect