Repository navigation
feat(cloudflare): manage tunnel routes, DNS and Access with OpenTofu - #3138
Merged
Merged
Conversation
Add cloudflare/ with the tunnel's published applications and their CNAMEs as code. All public hosts now go to https://traefik:443 with the hostname as SNI, instead of the host IP. makstra.xyz is dropped. A GitHub Actions workflow plans on PRs and applies on main, with state in R2. Renovate tracks the provider and OpenTofu without automerge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Import the 13 tunnel CNAMEs, the reusable "Allow users" policy and the arl, spotizerr and deemix Access apps. Deemix's app-scoped policy becomes a reusable "Allow guests" policy; its email addresses come from the ACCESS_GUEST_EMAILS secret, since this repo is public. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dashboard routes only set origin_server_name, so cloudflared already verifies Traefik's certificate. Also drop tags = [] from the Access apps; the imported apps have none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MichielMak
enabled auto-merge (squash)
October 24, 2026 15:29
MichielMak
approved these changes
Oct 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the Cloudflare Tunnel config out of the dashboard and into
cloudflare/, managed by OpenTofu.What's in it
cloudflare/tunnel.tf: the tunnel's published applications and their CNAMEs. Public hosts are a plain list (public_hosts); webhook-only hosts have a path regex (webhook_routes).https://traefik:443instead ofhttps://192.168.178.4:443. Each route sends its own hostname as SNI (origin_server_name), whichauthalready needed.makstra.xyzis dropped.cloudflare/access.tf: the Access apps forarl,spotizerranddeemix, and the reusable "Allow users" policy (the Authentik users group).ACCESS_GUEST_EMAILSsecret (a JSON list), because this repo and its Actions logs are public.cloudflare/imports.tf: import blocks for everything that already exists (tunnel config, 13 CNAMEs, Access apps and policy), so the first apply adopts it instead of recreating it..github/workflows/cloudflare.yml:tofu planon PRs,tofu applyon merge tomain. State is in the R2 buckettofu-state, with lockfile-based locking.terraformmanager enabled. Provider and OpenTofu updates are grouped and not automerged, because merging applies to the live config.Not managed (still in the dashboard)
makstra.xyzzone.Before merging
traefik:443,makstra.xyzgone, a new "Allow guests" policy, and deemix's policy list.🤖 Generated with Claude Code