Subdomain routing rules
-
Reserve the apex and
home.00000041.xyzfor Home Assistant. Both live in the sharedhomelabingress and are served by either replica, so HA at the apex survives joe-host being off. Never put them on a second tunnel. -
Route every other service through
homelab, using only joe-host’scloudflaredcontainer. One lowercase service label:<service>.00000041.xyz. -
One file, two replicas, deployed together. The canonical ingress is
~/.hermes/cloudflared/ingress.yml(mode 600, not in git). It is copied to thecloudflared-configvolume on joe-host and to/share/cloudflared/config.ymlon the HA box bycf-deploy-ingress.py, which validates the file and verifies both hashes match. Never hand-edit a live config; a mismatch between replicas is how a working route becomes a 404. -
Establish authentication before publishing. Give ordinary sites explicit Access coverage. Record any exception that relies on the application’s own auth. Keep secret paths secret: a hostname adds no authentication of its own.
-
Scope an exception to its path. A hostname that exists only to replace an old apex path should carry a matching
path:rule (^/ringbearer/,^/nextchat-sync, the exact secret prefix), so the rest of that service is not published by accident. Everything unmatched falls to the finalhttp_status:404. -
Stage and validate ingress before changing DNS. Keep
homelab’shttp_status:404catch-all last. Ingress does not rewrite paths — preserve any path the origin needs. Prefer verified loopback origins (127.0.0.1:<port>) for services on joe-host. -
Check both halves of routing. Ingress must select the intended origin; DNS must select the intended tunnel. The wildcard
*.00000041.xyzcovers newhomelablabels unless an explicit record overrides it. Keep the apex andhomeas explicit records. -
One hostname, one owner, one writer. Never mirror the homelab config onto the HA add-on, never restart a legacy connector to “help”, and never point DNS at a target before that target’s config exists.
-
Back up, validate, activate, read back, probe. Verify application fingerprints and real client behaviour. An Access redirect proves only the gate, never the application. Test the rejected path as well as the accepted one. Update the ownership inventory, the probes and any watchdog that hard-codes a URL.
Worked example — adding notes.00000041.xyz on port 8765
- Confirm the origin answers on
127.0.0.1:8765and note a fingerprint from its body. - Create its Access application, reusing an existing policy.
- Stage this rule above the final catch-all in the homelab config:
- hostname: notes.00000041.xyz service: http://127.0.0.1:8765 - Validate the candidate config, install it into the
cloudflared-configvolume, restartcloudflared, and confirm the connector re-registers. - Confirm the wildcard sends
notestohomelab(no conflicting explicit record). - Probe anonymously (expect the Access gate), then authenticate and check the app itself.
- Add
notesto the ownership inventory and tocf-route-probe.py. - Roll back by restoring the previous ingress file and restarting.
Adding a service that must survive joe-host
That is the exception, not the norm: it belongs on the HA box itself and on the homeassistant
tunnel, as an additional_hosts entry in the add-on options. Anything that runs on joe-host
cannot survive joe-host, whatever the tunnel does.