From 149fce835ed56a2c48d105b5d5a2a8d62f0158e4 Mon Sep 17 00:00:00 2001 From: librelad Date: Fri, 22 May 2026 01:10:56 +0100 Subject: [PATCH] fix(routing): per-port subdomain falls back to app-name when unset An empty subdomain previously resolved to the domain apex, which would collide on the root for any unconfigured Traefik port. Treat empty as the app-name default (matching legacy behaviour); apex is reachable only via the explicit @ / root sentinel. Co-Authored-By: Claude Opus 4.7 Signed-off-by: librelad --- scripts/network/traefik/traefik_port_subdomains.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/network/traefik/traefik_port_subdomains.sh b/scripts/network/traefik/traefik_port_subdomains.sh index dd498eb..52fa315 100644 --- a/scripts/network/traefik/traefik_port_subdomains.sh +++ b/scripts/network/traefik/traefik_port_subdomains.sh @@ -38,10 +38,12 @@ tagsProcessorPortSubdomains() if [[ "$p_traefik" == "true" ]]; then local host - if [[ -z "$p_sub" || "$p_sub" == "@" || "$p_sub" == "root" ]]; then - host="${domain_full}" # apex / root of the domain - else + if [[ "$p_sub" == "@" || "$p_sub" == "root" ]]; then + host="${domain_full}" # apex / root of the domain (explicit only) + elif [[ -n "$p_sub" ]]; then host="${p_sub}.${domain_full}" # subdomain (single or multi-level) + else + host="${app_name}.${domain_full}" # no subdomain set -> app-name default fi tagsManagerUpdateUniversalTag "$file" "DOMAINSUBNAME_TAG_${idx}" "$host" fi