Skip to content

fix: add ruleSyntax v2 to varnish.base, magento2.base and magento2.gr… - #940

Open
perichus wants to merge 1 commit into
wardenenv:mainfrom
perichus:bugfix/933-cont
Open

fix: add ruleSyntax v2 to varnish.base, magento2.base and magento2.gr…#940
perichus wants to merge 1 commit into
wardenenv:mainfrom
perichus:bugfix/933-cont

Conversation

@perichus

@perichus perichus commented Jul 19, 2026

Copy link
Copy Markdown

Check List

  • Is there an existing issue that covers this? (933)
  • Is there an entry in the CHANGELOG.md file?

Describe the bug
Same as #933 and #934 but completed for varnish and all magento2 files.

To Reproduce

  1. Add a project with subdomain (and varnish enabled)
  2. Run warden env up
  3. The subdomain (ie: app.example.com) will not work

Expected behavior
You will be able to access with subdomain to the service

Additional context
Add any other context about the problem here.

ilnytskyi added a commit to ilnytskyi/warden that referenced this pull request Jul 29, 2026
~/.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. The container is resolved
via the com.docker.compose.project=warden labels rather than by the name
`traefik`, so a Traefik belonging to something else on the same daemon is
never restarted. 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.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ilnytskyi added a commit to ilnytskyi/warden that referenced this pull request Jul 29, 2026
`${WARDEN_HOME_DIR}/etc/traefik/traefik.yml` is generated configuration, not
user state: it was copied over unconditionally on every `svc up` until f449fda
added an existence guard, turning it into a one-time seed.

Nine months later b8ad77d moved Traefik to 3.6 and 6d7bd66 added
`core.defaultRuleSyntax: v2` to the shipped config, but by then nothing
delivered that to existing installs. Traefik 3 parses Warden's v2 style router
rules as v3 syntax and silently stops matching them, which is the subdomain
routing breakage in wardenenv#933.

Declaring `ruleSyntax=v2` per router (wardenenv#934, wardenenv#940) patches 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. Correcting the static
config fixes all of them at once.

Restore the original behaviour, refreshing the file whenever it drifts from the
shipped version and 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. The container is resolved via its com.docker.compose.project=warden
labels rather than by the name `traefik`, so a Traefik belonging to something
else on the same daemon is never touched, and the running-status filter avoids
starting one that was deliberately stopped.

This runs on `svc up` and on `env up|start|restart`, the latter being what
people actually reach for after an upgrade. Anyone needing a hand-written
static config can override the service's volumes via
`${WARDEN_HOME_DIR}/docker-compose.yml`, which `svc up` already supports.

`warden doctor` now reports the running Traefik image and diffs the in-use
config against the shipped one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant