Skip to content

feat: integrate Caddy as default SSL terminator & reverse proxy (#1012)#1014

Open
gildesmarais wants to merge 3 commits into
mainfrom
feat/1012-caddy-to-the-stack
Open

feat: integrate Caddy as default SSL terminator & reverse proxy (#1012)#1014
gildesmarais wants to merge 3 commits into
mainfrom
feat/1012-caddy-to-the-stack

Conversation

@gildesmarais

Copy link
Copy Markdown
Member

Summary

Closes #1012

Integrates Caddy as the built-in SSL/TLS terminator and reverse proxy in both compose files. The stack now works out-of-the-box over HTTPS with no extra setup.

Changes

  • docker-compose.quickstart.yml: Added caddy:2-alpine service on https://localhost:4000 (Caddy's local CA). Removed direct ports from html2rss-web.
  • docker-compose.yml: Added caddy:2-alpine on ports 80/443 with automatic Let's Encrypt for production. Removed direct ports from html2rss-web.
  • bin/quickstart-verify: Updated contract assertions to check port mapping on the caddy service.

Security

  • X-Forwarded-For and X-Real-IP headers are sanitized using Caddy's {client_ip} placeholder, preventing IP-spoofing rate-limit bypasses.
  • Caddy Admin API disabled by default (admin off).
  • CADDY_GLOBAL_OPTIONS env var supported for CDN/load-balancer operators to configure trusted_proxies without modifying compose files.

Verification

  • bin/quickstart-verify passes ✅
  • make ready passes (252 examples, 0 failures) ✅
  • Local stack started; curl -k -I https://localhost:4000/api/v1/health returned HTTP/2 401 via Caddy

- Add caddy:2-alpine service to docker-compose.quickstart.yml listening
  on https://localhost:4000 using Caddy's local CA
- Add caddy:2-alpine service to docker-compose.yml listening on ports 80/443
  with automatic HTTPS via Let's Encrypt for production
- Remove direct host port mappings from html2rss-web in both compose files
- Sanitize X-Forwarded-For and X-Real-IP headers using {client_ip} placeholder
  to prevent rate-limit bypass via IP spoofing
- Disable Caddy admin API by default (admin off) to reduce attack surface
- Support CADDY_GLOBAL_OPTIONS env var for CDN/load-balancer trusted_proxies config
- Update bin/quickstart-verify to assert port mapping on caddy service

Closes #1012
@gildesmarais gildesmarais force-pushed the feat/1012-caddy-to-the-stack branch from 7eae13d to fd933d9 Compare June 12, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use Caddy as SSL Terminator & Reverse Proxy to solve SSL issues and mitigate IP spoofing

1 participant