Publish a service
Put a service on the internet behind one of the fleet’s Traefik proxies:
scripts/publish.shIt asks (or take --host --domain --backend --profile --name --tile):
- Proxy host: any host with
util: [traefik](your edge hosts). - Domain: refused if it is already routed anywhere in
config/vars/. - Backend:
http://container:portfor a container on the proxy host’s Docker networks (traefik_server_networks), orhttp://100.x.y.z:portfor a service on another tailnet node. - Security profile:
app(default: headers, HSTS, tight CSP),relaxed(no CSP),strict,framed(may be put in a frame),none. - Console tile (optional): a group name from
muximux_groupsinconfig/vars/group/util_muximux.yml.
It appends one line to the domain’s file, config/routes/<domain>.yml (named after the certificate that covers the name; created if needed; with via: <host> when the host is not
that file’s default), then runs the preflight and shows
the diff. Then you do the two things it cannot:
- DNS:
*.example.compoints at your main proxy host. For another proxy host (for exampleark.example.com) add an A record to that host’s public address. Other zones need their own record. - Certificate: the proxy host must fetch a certificate covering the domain (
cert: [...]in the host table).
Commit and push; the host serves the route after its next reconcile. If a page misbehaves, check the browser console
for “Content Security Policy” and set that route to profile: relaxed.
Routes with options the wizard does not ask (redirects, static sites, extra middlewares, path rules) are edited by hand in the same file; see the traefik_server role README in the framework.
Safety nets against conflicting routes
Section titled “Safety nets against conflicting routes”publish.shrefuses a domain that is already routed anywhere inconfig/vars/.scripts/preflight.sh(the commit hook, and--strictbefore deploying) runsscripts/routes_check.py: per proxy host it resolves everytraefik_server_routes*variable that host would see and fails on a repeated route name or two routes matching the same request (same host or same rule). A domain routed on two different hosts is only a warning (normal while a service moves).- On the host, the
traefik_serverrole asserts the same thing before it writes anything, and the reconciler’s check pass runs before the apply: a conflict stops that host’s run with a message naming the duplicate, and the running Traefik keeps its last good configuration.