Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: don't offer http launch buttons for a port that serves TLS only

[._.]/ Adam Eivy35ab21222096
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 686121b24d..77e277dafb 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -136,6 +136,7 @@
## Apps
- **[issue-3286] Delete is no longer the loudest button on an app row.** Every app card rendered `Archive`, `Manage` and a red-tinted `Delete` as three equal-weight buttons, so the most destructive and rarest action was the highest-contrast control on the page — sixteen permanently-armed Delete buttons stacked down the list, sitting a thumb's width from `Manage` once the row wrapped on a phone. `Archive` and `Delete` now live behind a per-row "…" menu (arrow keys, Escape, and 40px touch targets included), `Manage` is the row's single filled primary, the app name reads as an actual link, and deleting asks for an inline confirmation naming the app before anything is removed.
+- **An app that terminates TLS on its own port no longer offers launch buttons that cannot connect.** A port serves one scheme, but the launch row derived its `HTTP` and `Dev UI` buttons from `uiPort`/`devUiPort` without checking them against `tlsPort`. A single-listener dev server that reads the shared Tailscale cert reports the same number for all three, so it rendered three buttons for one HTTPS listener — two of which were guaranteed to fail. Those two are now suppressed when the port is the TLS port, leaving the one that works; an app whose dev server genuinely runs on a separate plain-HTTP port still gets its `Dev UI` button. Worth knowing when an app looks unreachable: `.ts.net` is on the browser HSTS preload list, so a plain-HTTP app on a MagicDNS name is force-upgraded to `https://` and never loads, while PortOS still reports it `online` — that status is read from PM2 and does not probe the port.
## Creative Director
- **[issue-3287] The developer smoke test no longer leads the Creative Director action bar.** `Run smoke test` sat in the leading position of a four-button header where the eye lands first, named a mechanism rather than an outcome, and consumed one of the seven interactive elements that fit above the fold on a phone — despite spending real render time on every click. It now lives behind a "…" menu beside `Model defaults`, reads `Render a 6s test clip` so the cost is legible before you commit, and asks for an inline confirmation naming what it will spend. The header bar reads `New directive` · `Model defaults` · `New project`.
diff --git a/client/src/services/appUrls.js b/client/src/services/appUrls.js
index 4609380ee2..f64d0a2a80 100644
--- a/client/src/services/appUrls.js
+++ b/client/src/services/appUrls.js
@@ -16,15 +16,25 @@ export function getLaunchUrls(app) {
// Non-TLS launch URLs always use http:// regardless of how PortOS itself is served —
// inheriting window.location.protocol produced https:// links to plain-HTTP app ports
// (e.g., uiPort, devUiPort) whenever PortOS was served over HTTPS, which doesn't work.
- const dev = app.devUiPort ? `http://${hostname}:${app.devUiPort}` : null;
+ //
+ // A port serves ONE scheme. When an app terminates TLS on the same port it lists as
+ // its uiPort/devUiPort (the common shape for a single-listener dev server that reads
+ // the shared Tailscale cert), the plain-HTTP variant is that same TLS-only listener
+ // and can never answer http://. Suppress those so we don't render a launch button
+ // that is guaranteed to fail — the https one already covers that port.
+ const tlsPort = app.tlsPort || null;
+ const httpPort = (port) => (port && port !== tlsPort ? port : null);
+ const devPort = httpPort(app.devUiPort);
+ const dev = devPort ? `http://${hostname}:${devPort}` : null;
// Self-app: primary URL is the active origin (right scheme + port); dev still
// reflects the Vite dev server on a separate port.
if (app.id === PORTOS_APP_ID) {
return { https: null, http: window.location.origin, dev };
}
+ const uiPort = httpPort(app.uiPort);
return {
- https: app.tlsPort ? `https://${hostname}:${app.tlsPort}` : null,
- http: app.uiPort ? `http://${hostname}:${app.uiPort}` : null,
+ https: tlsPort ? `https://${hostname}:${tlsPort}` : null,
+ http: uiPort ? `http://${hostname}:${uiPort}` : null,
dev
};
}
diff --git a/client/src/services/appUrls.test.js b/client/src/services/appUrls.test.js
index 1d74422d52..8115adcc4c 100644
--- a/client/src/services/appUrls.test.js
+++ b/client/src/services/appUrls.test.js
@@ -26,4 +26,35 @@ describe('getLaunchUrls — portless vs port-bearing (#2991)', () => {
expect(getPrimaryLaunchUrl({ id: 'web-app', type: 'express', uiPort: 3000, tlsPort: 8443 }))
.toBe(`https://${window.location.hostname}:8443`);
});
+
+ it('keeps the http launch URL when uiPort is a distinct plain-HTTP listener', () => {
+ const urls = getLaunchUrls({ id: 'web-app', type: 'express', uiPort: 3000, tlsPort: 8443 });
+ expect(urls.http).toBe(`http://${window.location.hostname}:3000`);
+ });
+});
+
+// A single-listener dev server that terminates TLS itself (a Vite app reading the
+// shared Tailscale cert) reports the SAME port as uiPort/devUiPort and tlsPort.
+// That port speaks TLS only, so emitting an http:// URL for it renders a launch
+// button that can never connect.
+describe('getLaunchUrls — TLS and plain-HTTP on the same port', () => {
+ it('suppresses the http URL when uiPort is the TLS port', () => {
+ const urls = getLaunchUrls({ id: 'vite-app', type: 'vite', uiPort: 3117, tlsPort: 3117 });
+ expect(urls.https).toBe(`https://${window.location.hostname}:3117`);
+ expect(urls.http).toBeNull();
+ });
+
+ it('suppresses the dev URL when devUiPort is the TLS port', () => {
+ const urls = getLaunchUrls({ id: 'vite-app', type: 'vite', uiPort: 3117, devUiPort: 3117, tlsPort: 3117 });
+ expect(urls.dev).toBeNull();
+ // The one surviving URL is the working one, so the single-click launcher still opens it.
+ expect(getPrimaryLaunchUrl({ id: 'vite-app', type: 'vite', uiPort: 3117, devUiPort: 3117, tlsPort: 3117 }))
+ .toBe(`https://${window.location.hostname}:3117`);
+ });
+
+ it('keeps a dev URL that runs on its own plain-HTTP port', () => {
+ const urls = getLaunchUrls({ id: 'vite-app', type: 'vite', uiPort: 5173, devUiPort: 5174, tlsPort: 5173 });
+ expect(urls.dev).toBe(`http://${window.location.hostname}:5174`);
+ expect(urls.http).toBeNull();
+ });
});