- Caddyfile moves to config/ (directory mount) so 'caddy reload' sees the new file; the handler reloads gracefully instead of restarting - template validate: runs 'caddy validate' with the image Caddy uses - http:// catch-all aborts plain-HTTP requests for unknown hosts / bare IP; known hosts keep the automatic HTTPS redirect (tested) - read_header timeout 10s (default 1 min) - body_limit snippet: 1MB static sites, tinyauth, repaircafe; 10MB Pocket ID, Changedetection, ByteStash, Gotify, iGotify; 20MB Baikal - dns: remove grist, habits, office, podcasts, pdftools (nothing serves them) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
19 lines
644 B
YAML
19 lines
644 B
YAML
# roles/docker/handlers/main.yml
|
|
# Graceful: new config without dropping connections. If the new config
|
|
# fails to load, Caddy keeps running the old one and the deploy fails.
|
|
- name: reload caddy
|
|
ansible.builtin.command: docker exec caddy-caddy-1 caddy reload --config /etc/caddy/Caddyfile --adapter caddyfile
|
|
|
|
- name: restart crowdsec
|
|
community.docker.docker_compose_v2:
|
|
project_src: /opt/stacks/crowdsec
|
|
files:
|
|
- compose.yml
|
|
state: restarted
|
|
|
|
- name: restart obsidian-livesync
|
|
community.docker.docker_compose_v2:
|
|
project_src: /opt/stacks/obsidian-livesync
|
|
files:
|
|
- docker-compose.yml
|
|
state: restarted |