From 9d5d0103b6b523e5cb9970c5f58b53be9d4132dd Mon Sep 17 00:00:00 2001 From: librelad Date: Wed, 27 May 2026 13:23:47 +0100 Subject: [PATCH] fix(routing): _previewUrl uses port.subdomain, not the retired HOST_NAME routing-manager.js read CFG__HOST_NAME for its preview URL, but that key was retired by the per-port subdomain refactor (2e4f420, 2026-05-22) and no .config defines it anymore. The lookup always returned undefined, so even with a configured domain the preview fell through to the `` placeholder instead of showing the real host. Now derives the preview from the port's own subdomain (parts[10] of the 12-col PORT row), matching the canonical host_setup rule in scripts/network/variables/variables_init_app.sh: @ / root -> apex (`https://`) set -> `https://.` empty -> `https://.` Also adds `subdomain` to the port object emitted by _collectPorts so this and any future per-row consumer can read it. Signed-off-by: librelad --- .../frontend/js/components/app/routing-manager.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/containers/libreportal/frontend/js/components/app/routing-manager.js b/containers/libreportal/frontend/js/components/app/routing-manager.js index 7754917..5ffa4ae 100644 --- a/containers/libreportal/frontend/js/components/app/routing-manager.js +++ b/containers/libreportal/frontend/js/components/app/routing-manager.js @@ -59,6 +59,7 @@ class RoutingManager { protocol: parts[4] || 'tcp', traefik: isNine ? parts[6] === 'true' : parts[5] === 'true', webui, + subdomain: isTwelve ? (parts[10] || '') : '', recommended: isTwelve ? parts[11] === 'true' : webui, description: isNine ? (parts[8] || '') : (parts[7] || '') }; @@ -70,11 +71,14 @@ class RoutingManager { } _previewUrl(port, app) { - const hostName = app && app.config && app.config[`CFG_${port.appSlug.toUpperCase()}_HOST_NAME`]; const domainIdx = app && app.config && app.config[`CFG_${port.appSlug.toUpperCase()}_DOMAIN`]; const domain = app && app.config && app.config[`CFG_DOMAIN_${domainIdx || 1}`]; - if (hostName && domain) return `https://${hostName}.${domain}`; - return `https://${port.appSlug}.`; + const sub = (port.subdomain || '').trim(); + const placeholder = ''; + const base = domain || placeholder; + if (sub === '@' || sub === 'root') return `https://${base}`; + if (sub) return `https://${sub}.${base}`; + return `https://${port.appSlug}.${base}`; } _render() {