Skip to content

Refresh Traefik static config instead of seeding it once - #2

Open
ilnytskyi wants to merge 1 commit into
fraefik-3-bc-improvefrom
fix/traefik-static-config-refresh
Open

Refresh Traefik static config instead of seeding it once#2
ilnytskyi wants to merge 1 commit into
fraefik-3-bc-improvefrom
fix/traefik-static-config-refresh

Conversation

@ilnytskyi

Copy link
Copy Markdown
Owner

~/.warden/etc/traefik/traefik.yml was copied from config/traefik/traefik.yml only when absent, so installs predating the Traefik 3 upgrade keep a static config without core.defaultRuleSyntax. Traefik 3 then parses Warden's v2 style router rules as v3 syntax and silently stops matching them, which is the subdomain routing breakage reported in wardenenv#933.

The shipped config has carried that setting for a while; it simply never reached existing installs. Declaring ruleSyntax=v2 per router (wardenenv#934, wardenenv#940) works around this from the wrong layer: it has to be repeated for every new router, and it cannot cover routers users define themselves in project .warden/warden-env.yml files or in custom environment types, which Warden has no way to rewrite.

Refresh the file whenever it drifts from the shipped version, keeping the previous copy as traefik.yml.bak. Restart Traefik when it changed, since Traefik never reloads static configuration and Compose will not recreate the container just because a bind mounted file changed. This runs on svc up and on env up|start|restart, the latter being what people actually reach for after an upgrade.

Set WARDEN_TRAEFIK_CONFIG_MANAGED=0 to hand-manage the file. warden doctor now reports the running Traefik image and diffs the in-use config against the shipped one.

Check List

  • Is there an existing issue that covers this? (link it here, if so)
  • Is there an entry in the CHANGELOG.md file?

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Check List

  • Matching PR in the documentation repo (replace text with link when it exists)
  • Entry in CHANGELOG.md

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you've submitted
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@ilnytskyi
ilnytskyi force-pushed the fix/traefik-static-config-refresh branch 2 times, most recently from b0daf0d to bd55424 Compare July 29, 2026 09:02
${WARDEN_HOME_DIR}/etc/traefik/traefik.yml is generated configuration rather
than user state, but it was only copied into place when absent. After a Traefik
major upgrade some settings, such as the router rule syntax, have to be
adjusted globally for backward compatibility, and installs that already had the
file never received them.

Refresh it whenever it drifts from the shipped version, keeping the previous
copy as traefik.yml.bak, and restart Traefik afterwards since static
configuration is never hot reloaded.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ilnytskyi
ilnytskyi force-pushed the fix/traefik-static-config-refresh branch from bd55424 to 2cbfb7f Compare July 29, 2026 09:08
@ilnytskyi
ilnytskyi changed the base branch from main to fraefik-3-bc-improve July 29, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant