Skip to content

Add Cloudflare Tunnel integration#39

Open
riccjohn wants to merge 2 commits into
mainfrom
add-cloudflare-tunnel
Open

Add Cloudflare Tunnel integration#39
riccjohn wants to merge 2 commits into
mainfrom
add-cloudflare-tunnel

Conversation

@riccjohn

Copy link
Copy Markdown
Owner

Summary

  • Add cloudflared Docker service for remote-managed Cloudflare Tunnel (token-based, no local config files)
  • Add forwardedHeaders.trustedIPs to Traefik's websecure entrypoint so real client IPs are correctly propagated from Cloudflare's edge
  • Document CLOUDFLARE_TUNNEL_TOKEN in .env.example (keeps Cloudflare vars together)
  • Add Cloudflare Tunnel setup section to README.md with all four manual dashboard steps

Details

cloudflared forwards inbound tunnel traffic to Traefik (https://traefik), so all existing label-based routing is unchanged. LAN access continues to work via the wildcard A record — the tunnel CNAME only applies when resolved via Cloudflare's public DNS.

The forwardedHeaders.trustedIPs block includes all published Cloudflare IPv4 ranges plus 127.0.0.1/32 and 172.16.0.0/12 (Docker bridge).

Test Plan

  • ./scripts/lint-config.sh exits clean — CLOUDFLARE_TUNNEL_TOKEN correctly wired in docker-compose.yml and .env.example
  • On server: add CLOUDFLARE_TUNNEL_TOKEN=<token> to .env, then docker compose up -d cloudflared — confirm container starts and connects
  • Verify homepage.woggles.work accessible externally after completing Cloudflare dashboard steps (tunnel public hostname + Access policy)
  • Verify all LAN services remain accessible

🤖 Generated with Claude Code

riccjohn and others added 2 commits May 26, 2026 15:18
- Add cloudflared Docker service (remote-managed tunnel, token-based auth)
- Add forwardedHeaders.trustedIPs to Traefik websecure entrypoint for correct
  client IP propagation from Cloudflare's edge
- Document CLOUDFLARE_TUNNEL_TOKEN in .env.example
- Add Cloudflare Tunnel setup section to README (dashboard steps for tunnel,
  public hostname, Access policy)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…gnore .light/

- Pin cloudflared image to 2026.5.1 instead of latest
- Add Cloudflare IPv6 edge ranges to traefik forwardedHeaders trustedIPs
- Fix README: update Cloudflare dashboard URLs to dash.cloudflare.com,
  add Origin server name field to public hostname table
- Add .light/ to .gitignore and remove all tracked session artifacts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant