The Gatekeeper — Traefik Reverse Proxy
The Gatekeeper (docker-traefik) guards the threshold of the noosphere, routing traffic across shrines and ceremonies.
Configuration
Section titled “Configuration”- Static config:
traefik.ymlgenerated by Nix (symlinkL+to the store) - Dynamic config:
traefik_dynamic.ymlunsealed by sops to/srv/docker/traefik/conf/ - Certificates:
acme.json(permissions0600mandatory) - Access logs:
/srv/docker/traefik/logs/traefik.log(JSON, rotated daily for 14 days)
Entrypoints
Section titled “Entrypoints”| Entrypoint | Port | Role |
|---|---|---|
web | 80 | Redirect to HTTPS |
websecure | 443 | TLS, timeout 600s |
traefik | 127.0.0.1:8080 | API/dashboard/ping (local only) |
Health Check
Section titled “Health Check”docker exec traefik traefik healthcheck# orcurl -s http://127.0.0.1:8080/pingOnboarding a Service Behind the Gatekeeper
Section titled “Onboarding a Service Behind the Gatekeeper”In the service’s docker-*.nix file, add these labels:
labels = { "traefik.enable" = "true"; "traefik.http.routers.<name>.rule" = "Host(`myservice.friloux.me`)"; "traefik.http.routers.<name>.tls" = "true"; "traefik.http.routers.<name>.tls.certresolver" = "lets-encrypt"; "traefik.docker.network" = "web"; "traefik.http.services.<name>.loadbalancer.server.port" = "PORT"; "traefik.http.routers.<name>.middlewares" = "crowdsec@file,rate-limit@file,security-headers@file"; "friloux.me/health-watch" = "true"; # always last};networks = ["web"];CrowdSec Dependency
Section titled “CrowdSec Dependency”Traefik starts only after CrowdSec (after = ["crowdsec.service"]).
If CrowdSec fails, Traefik will not awaken.
Certificate Renewal
Section titled “Certificate Renewal”Let’s Encrypt renews automatically via TLS challenge. In case of trouble:
# View renewal logsdocker logs traefik 2>&1 | grep -i "acme\|cert\|renew"
# Force renewal (delete existing cert)# Warning: Let's Encrypt limits to 5 attempts per domain per hourdocker stop traefikrm /srv/docker/traefik/acme.jsontouch /srv/docker/traefik/acme.json && chmod 600 /srv/docker/traefik/acme.jsondocker start traefik