From 9fdf6aecff4ddd7eb48a1f8956ebe4182e7dc500 Mon Sep 17 00:00:00 2001 From: Robert Gingras Date: Mon, 16 Mar 2026 10:12:46 -0400 Subject: [PATCH] feat: use external hostname with IP address fallback for SSH URI --- create-a-container/routers/containers.js | 6 ++++-- create-a-container/views/containers/index.ejs | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/create-a-container/routers/containers.js b/create-a-container/routers/containers.js index 808b31b5..cc8aa7bb 100644 --- a/create-a-container/routers/containers.js +++ b/create-a-container/routers/containers.js @@ -178,9 +178,10 @@ router.get('/', requireAuth, async (req, res) => { const sshPort = ssh?.transportService?.externalPort || null; const http = services.find(s => s.type === 'http'); const httpPort = http ? http.internalPort : null; - const httpExternalUrl = http?.httpService?.externalHostname && http?.httpService?.externalDomain?.name - ? `https://${http.httpService.externalHostname}.${http.httpService.externalDomain.name}` + const httpExternalHost = http?.httpService?.externalHostname && http?.httpService?.externalDomain?.name + ? `${http.httpService.externalHostname}.${http.httpService.externalDomain.name}` : null; + const httpExternalUrl = httpExternalHost ? `https://${httpExternalHost}` : null; // Common object structure for both API and View return { @@ -194,6 +195,7 @@ router.get('/', requireAuth, async (req, res) => { template: c.template, creationJobId: c.creationJobId, sshPort, + sshHost: httpExternalHost || site.externalIp, httpPort, httpExternalUrl, nodeName: c.node ? c.node.name : '-', diff --git a/create-a-container/views/containers/index.ejs b/create-a-container/views/containers/index.ejs index 1cadb174..2155a7dc 100644 --- a/create-a-container/views/containers/index.ejs +++ b/create-a-container/views/containers/index.ejs @@ -73,10 +73,10 @@ <% } %> - <% if (r.sshPort && site.externalIp) { %> + <% if (r.sshPort && r.sshHost) { %> <%= r.sshPort %> - - + + <% } else { %> <%= r.sshPort || '-' %> <% } %>