fix(traefik): use Host() instead of HostRegexp for dashboard router (v3 prep)#112
Closed
ClaydeCode wants to merge 1 commit into
Closed
fix(traefik): use Host() instead of HostRegexp for dashboard router (v3 prep)#112ClaydeCode wants to merge 1 commit into
ClaydeCode wants to merge 1 commit into
Conversation
The dashboard router matched a literal subdomain (traefik.<shard-domain>) via HostRegexp, which is v2-only rule syntax. Under Traefik v3's default (v3) rule syntax HostRegexp is parsed as a Go regexp, so the literal '.' would match any character. Host() with the literal hostname matches identically under both v2 and v3, making the generated dynamic config safe for the planned Traefik v3 upgrade with no behavioural change on the current v2.6. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
aa1ac1c to
74a8035
Compare
Contributor
Author
|
Dropping per decision: we're staying on Traefik 2 (bumping to v2.11, which is Go 1.25 and self-raises nofile — the actual root cause). HostRegexp keeps working under v2 syntax, so this change isn't needed now. Folded into a Traefik v3 migration backlog ticket instead. |
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.
What
The shard's generated Traefik dynamic config routes the dashboard with a literal subdomain rule, but used
HostRegexp(traefik.)— which is v2-only rule syntax. Switch it toHost().Why
This is prep for the planned Traefik v2.6 → v3 upgrade (the fd-exhaustion / EMFILE fix — old traefik builds (Go <1.19) can't self-raise their nofile ceiling; v3 can). Under Traefik v3's default
v3rule syntax,HostRegexpis interpreted as a Go regexp, so the literal.intraefik.<domain>would match any character (over-broad match).Host()with the literal hostname matches identically under both v2 and v3, so this is a no-op on the current v2.6 and correct on v3.It is the only v2-only rule the generator emits — every other rule already uses
Host(),HostSNI(), or literalPathPrefix(), all of which are v2/v3-identical.Risk / testing
tests/test_traefik_dyn_spec.pypasses.Context
Part of the traefik-v3 hardening from the shard-333 EMFILE investigation. Companion changes: controller-ingress hardening (freeshard-controller) and a new shard core-version pinning
traefik:v3(blocked on this + theazure→azurednsACME provider migration + a core image release carrying #108).🤖 Generated with Claude Code