fix(dev-sso): route Traefik labels on Compose 2.40 + shared Traefik #47
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/dev-sso-traefik-label-interpolation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
just dev-ssonever routedhttps://${USER}-mokosh-api.a8n.run. Hitting the host returned the Traefik default self-signed cert and a404 page not found. Two independent bugs incompose.dev-sso.yml, each sufficient on its own to break routing.Bug 1: map-syntax label keys are not interpolated
Docker Compose interpolates
${USER}inside mapping VALUES but NOT inside mapping KEYS (verified on Compose v2.40.0;docker compose configrenders the key asmokosh-api-$${USER}while the value renders aslong). The Traefik router name lives in the label key, so map syntax baked a literal${USER}into the router name. Traefik rejects that name and creates no router. Converting the fourtraefik.*labels to list (sequence) syntax puts the wholekey=valueinto a single string value, so${USER}interpolates in the router name too.Bug 2: wrong entrypoint name
The labels pinned the router to
web-secure, which on the shared a8n.run Traefik is:20443(bound to the LAN IP). Public HTTPS for*.a8n.runlands on thenebula-secureentrypoint (:443,asDefault=true) - the same entrypoint every other working app on that Traefik uses (syncthing, cadvisor, netdata). Switched tonebula-secure.Verification
With both fixes, the OIDC IdP serves a valid Let's Encrypt cert and a complete discovery document over the Nebula overlay:
/api/v1/versionreturns the server JSON/.well-known/openid-configurationreturnsissuer: https://long-mokosh-api.a8n.runand all endpoints/.well-known/jwks.jsonreturns the EdDSAdev-keyLet's Encrypt, not the Traefik defaultFollow-up (separate repo)
mokosh-clients/compose.dev-sso.ymlhas the identical pair of bugs (mokosh-${USER}map key +web-secureentrypoint) and needs the same change for the client SSO stack to route.🤖 Generated with Claude Code
Scope expanded beyond the original title. This branch now also:
a8n.runtoa8n.systems(router Host rule,MOKOSH_AUTH_ISSUER,MOKOSH_AUTH_COOKIE_DOMAIN,MOKOSH_ACCEPT_BASE_URL,MOKOSH_AUTH_LOGIN_URL). Routing + OIDC discovery/JWKS verified live ona8n.systemsover the Nebula overlay.dev-docs/sso-dev.md, a runbook forjust dev-sso(Nebula DNS via/etc/hosts, cert prerequisites, client registration, troubleshooting), plus itsdev-docs/README.mdindex row.Infra prerequisite for trusted TLS on the new domain: the shared Traefik's Cloudflare ACME token (
CF_DNS_API_TOKEN/CF_ZONE_API_TOKENin thenetwork-traefikproject) must include thea8n.systemszone. Until then ACME fails withcloudflare: failed to find zone a8n.systemsand Traefik serves its default cert; routing still works. Documented in the runbook troubleshooting table.