caddy + pihole: make both boot-persistent and self-healing
Caddy left compose.yaml for a quadlet unit (caddy.service): joins dankclaw_default for container-name upstreams, Pull=never for the local-only image, Porkbun credentials via /home/dank/Containers/caddy/env written by deploy from .env, bare-IP-catch-all health check. deploy_caddy installs, enables, and starts the unit after retiring the bare container (state is in host volumes). Pi-hole: the repo now owns the sysctl drop-in (dankclaw/pihole/sysctl/99-dnsmasq.conf, ip_unprivileged_port_start=53); deploy_pihole installs it to /etc/sysctl.d/, stages conflicting later-sorted drop-ins in the home trash, and applies 'sysctl --system' (the boot code path). This fixes the 2026-08-26 crash loop (port-53 bind denied, restart counter 1645) caused by a second drop-in resetting the value to 80. Tests: new caddy_quadlet.bats seam; caddyfile/deployment_flow assertions repointed from the removed compose service to the quadlet; pihole.bats pins the sysctl drop-in and its deployment; test-changed.sh routes dankclaw/caddy/ and the pihole subtree to their seams. Docs: Caddy, Pi-hole, Dankclaw Stack, work log.
This commit is contained in:
1 parent
66b58a127b
commit
8660209c35
14 files changed
+248
-60
No files matched your search
+4
-40
@@ -310,44 +310,8 @@ services:
|
||||
authentik-postgres:
|
||||
condition: service_healthy
|
||||
|
||||
# --- Reverse proxy + homepage (the homelab's single Caddy) ---------------
|
||||
# The Caddyfile mounted here is the RENDERED copy (basicauth hash filled in
|
||||
# from the host .env by scripts/deploy.sh); the repo copy carries the
|
||||
# REPLACE_WITH_HASH placeholder. Certs/config live under
|
||||
# Caddy (the homelab's single reverse proxy) left compose on 2026-08-26:
|
||||
# it is boot-persistent via its Quadlet unit (dankclaw/caddy/quadlet/
|
||||
# caddy.container), installed by deploy_caddy in scripts/deploy-remote.sh.
|
||||
# The rendered Caddyfile, certs, and config still live under
|
||||
# /home/dank/Containers/caddy (rootless-writable).
|
||||
caddy:
|
||||
# Locally built: stock Caddy + the Porkbun DNS provider
|
||||
# (dankclaw/caddy/Containerfile). See that file for build instructions.
|
||||
image: franksdank/caddy-porkbun:latest
|
||||
container_name: caddy
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
environment:
|
||||
# Consumed by the Caddyfile's acme_dns block (DNS-01 wildcard certs).
|
||||
PORKBUN_API_KEY: ${PORKBUN_API_KEY}
|
||||
PORKBUN_API_SECRET_KEY: ${PORKBUN_API_SECRET_KEY}
|
||||
volumes:
|
||||
- /home/dank/Containers/caddy/Caddyfile:/etc/caddy/Caddyfile:ro
|
||||
- /home/dank/Containers/caddy/data:/data
|
||||
- /home/dank/Containers/caddy/config:/config
|
||||
# The homepage: the host's /srv/homepage. The deploy copies the static
|
||||
# files there; the status checker writes status.json and the deploy
|
||||
# writes deployed.js there. (Not the repo's shared/homepage, which
|
||||
# lacks the generated files.)
|
||||
- /srv/homepage:/srv/homepage:ro
|
||||
depends_on:
|
||||
- authentik-server
|
||||
- comfyui
|
||||
- hermes
|
||||
- grafana
|
||||
- prometheus
|
||||
- loki
|
||||
healthcheck:
|
||||
# The bare-IP catch-all answers 302 (curl -f passes on <400); this
|
||||
# proves Caddy itself is serving without touching any upstream.
|
||||
test: ["CMD", "curl", "-sf", "-o", "/dev/null", "http://localhost:80/"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
Reference in new issue
Block a user