Traefik: move upstream address into a per-file $ip variable #23

Merged
MHE merged 1 commit from audit-repo-rules-templates into main 2026-11-02 13:15:48 +01:00
Owner

What changed

  • .openso/rules/30-traefik.md: the rule now says an operator-filled upstream is a single {{ $ip := "<NAME_IP>" }} line in the VARIABLES section. Server URLs reference {{ $ip }} and keep their own scheme and port. Several servers in one file share $ip. A file with only a blackhole or environment target does not declare $ip.
  • Traefik/appdata/config/conf.d/*.yaml.template (all app templates, traefik-wildcard-cert.yaml): add the $ip variable line with an Upstream address comment, and replace the hard-coded <NAME_IP> placeholders in url: with {{ $ip }}. Comments on router and service lines are reworded to describe what the line does instead of "Adjust the ...".
  • rustdesk and seafile use one $ip for all their services.
  • mailcow, openccu, and truenas now set an explicit port (:80 / :443) because the old URLs had none, and $ip requires one.
  • Traefik/README.md: the maintenance hint points to the $ip line.
  • Authentik, Traefik, and app_template compose files: the x-required-services comment now says "Template directory names merged once by run.sh" instead of "Templates auto-merged by run.sh (recursive)".

Why

The placeholder was repeated in every server URL, so an operator had to edit several lines per file and could easily miss one. A single $ip variable keeps the address in one place next to $sub, and it follows the same pattern as the subdomain label. The rule file now describes that shape, so the templates and the documented convention match.

Notes for reviewers

  • Existing rendered configs are unaffected as long as the operator fills $ip the same way the old placeholder was filled.
  • Please check that mailcow, openccu, and truenas still reach the intended port. Their previous URLs had no explicit port, so the new :80 and :443 values match the implicit defaults for http and https.
## What changed - `.openso/rules/30-traefik.md`: the rule now says an operator-filled upstream is a single `{{ $ip := "<NAME_IP>" }}` line in the `VARIABLES` section. Server URLs reference `{{ $ip }}` and keep their own scheme and port. Several servers in one file share `$ip`. A file with only a blackhole or environment target does not declare `$ip`. - `Traefik/appdata/config/conf.d/*.yaml.template` (all app templates, `traefik-wildcard-cert.yaml`): add the `$ip` variable line with an `Upstream address` comment, and replace the hard-coded `<NAME_IP>` placeholders in `url:` with `{{ $ip }}`. Comments on router and service lines are reworded to describe what the line does instead of "Adjust the ...". - `rustdesk` and `seafile` use one `$ip` for all their services. - `mailcow`, `openccu`, and `truenas` now set an explicit port (`:80` / `:443`) because the old URLs had none, and `$ip` requires one. - `Traefik/README.md`: the maintenance hint points to the `$ip` line. - `Authentik`, `Traefik`, and `app_template` compose files: the `x-required-services` comment now says "Template directory names merged once by run.sh" instead of "Templates auto-merged by run.sh (recursive)". ## Why The placeholder was repeated in every server URL, so an operator had to edit several lines per file and could easily miss one. A single `$ip` variable keeps the address in one place next to `$sub`, and it follows the same pattern as the subdomain label. The rule file now describes that shape, so the templates and the documented convention match. ## Notes for reviewers - Existing rendered configs are unaffected as long as the operator fills `$ip` the same way the old placeholder was filled. - Please check that `mailcow`, `openccu`, and `truenas` still reach the intended port. Their previous URLs had no explicit port, so the new `:80` and `:443` values match the implicit defaults for `http` and `https`.
Use VARIABLES ip for Traefik upstream addresses
All checks were successful
ci / compose (pull_request) Successful in 13s
ci / shellcheck (pull_request) Successful in 7s
ci / conventions (pull_request) Successful in 2s
ci / image (pull_request) Successful in 2s
e6e6bdb8fd
MHE merged commit 82645d78d0 into main 2026-11-02 13:15:48 +01:00
MHE deleted branch audit-repo-rules-templates 2026-11-02 13:16:14 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
openso/docker-templates!23
No description provided.