fix(routing): honour HOST_NAME for app subdomain; add @ apex hosting

HOST_NAME was read but ignored — the FQDN was built from app_name, so 8
apps (vault, cloud, search, notes, social, meet, board, bookmark) routed at
the wrong host and Traefik disagreed with DNS. Build host_setup from
HOST_NAME (falling back to app_name); treat HOST_NAME="@"/"root" as the
domain apex (root-of-domain hosting, previously impossible). Document @ in
the Hostname field tooltip.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: librelad <librelad@digitalangels.vip>
This commit is contained in:
librelad 2026-05-22 00:45:01 +01:00
parent c1863b3e00
commit 5d47a6bad5
2 changed files with 12 additions and 3 deletions

View File

@ -35,7 +35,16 @@ initializeAppVariables()
app_title="${!app_title_var}"
domain_var_name="CFG_DOMAIN_${domain}"
domain_full="${!domain_var_name}"
host_setup=${app_name}.${domain_full}
# FQDN for this app's Traefik Host() rule (also feeds the app URL and
# trusted-domains):
# HOST_NAME="@" or "root" -> <domain> (apex / root of domain)
# HOST_NAME set -> <HOST_NAME>.<domain> (custom subdomain)
# HOST_NAME empty -> <app_name>.<domain> (fallback default)
if [[ "$host_name" == "@" || "$host_name" == "root" ]]; then
host_setup="${domain_full}"
else
host_setup="${host_name:-$app_name}.${domain_full}"
fi
ssl_key=${domain_full}.key
ssl_crt=${domain_full}.crt

View File

@ -83,8 +83,8 @@ webuiCreateAppFieldMappings() {
"category": "network",
"label": "Hostname",
"type": "text",
"tooltip": "The hostname for this application",
"placeholder": "myapp"
"tooltip": "Subdomain this app is served on — e.g. myapp becomes myapp.yourdomain.com. Use @ to serve it on the root of your domain (yourdomain.com itself).",
"placeholder": "myapp · @ = root domain"
},
"DOMAIN": {
"category": "network",