evert: remove experimental my.dash.board PWA virtual host
CI / Build & Test (push) Successful in 2m52s
CI / Build & Test (push) Successful in 2m52s
Reverts the experimental feature that attempted to serve the dashboard
via a local HTTP server registered as a hardcoded `my.dash.board` virtual
host, intended to satisfy Chrome's PWA "secure origin" installability
requirement. The approach caused proxy connection errors and file-not-found
issues that were not worth resolving.
Removed: native-host/dashboard-server.js, native-host/test-chain.mjs
Reverted: startup.js, message-router.js, virtual-hosts.js, index.js,
build-distributable.js, extension/pages/virtual-hosts.js,
CI workflows (ci.yml, release.yml)
This commit is contained in:
@@ -30,7 +30,6 @@ function saveState() {
|
||||
id: s.id, port: s.port, host: s.host, secure: s.secure, udp: s.udp || false, label: s.label || ''
|
||||
}));
|
||||
const virtualHostsList = vhostsModule.getVirtualHosts()
|
||||
.filter(v => v.type !== 'local') // never persist built-in local hosts
|
||||
.map(v => ({ hostname: v.hostname, hsUrl: v.hsUrl }));
|
||||
const serviceTunnelsList = svcModule.getServiceTunnels().map(t => ({
|
||||
id: t.id, label: t.label, hsUrl: t.hsUrl, localPort: t.localPort
|
||||
@@ -125,7 +124,6 @@ module.exports = {
|
||||
getServers: serversModule.getServers,
|
||||
// Virtual hosts
|
||||
setVirtualHost: vhostsModule.setVirtualHost,
|
||||
setLocalVirtualHost: vhostsModule.setLocalVirtualHost,
|
||||
removeVirtualHost: vhostsModule.removeVirtualHost,
|
||||
getVirtualHosts: vhostsModule.getVirtualHosts,
|
||||
getLocalPortForHostname: vhostsModule.getLocalPortForHostname,
|
||||
|
||||
@@ -129,29 +129,6 @@ async function setVirtualHost(payload) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a built-in local virtual host that is served by an internal HTTP
|
||||
* server rather than a Holesail P2P tunnel. The entry is marked `type: 'local'`
|
||||
* so it is never persisted to state.json and cannot be removed by the user.
|
||||
* @param {string} hostname - The hostname (e.g. `my.dash.board`).
|
||||
* @param {number} localPort - The local port the internal server is listening on.
|
||||
*/
|
||||
function setLocalVirtualHost(hostname, localPort) {
|
||||
virtualHosts.set(hostname, {
|
||||
hostname,
|
||||
hsUrl: null,
|
||||
holesail: null,
|
||||
localHost: TUNNEL_HOST,
|
||||
localPort,
|
||||
state: 'ready',
|
||||
type: 'local',
|
||||
createdAt: Date.now(),
|
||||
reconnectTimer: null,
|
||||
reconnectDelay: 0
|
||||
});
|
||||
debugLog('setLocalVirtualHost: hostname=', hostname, 'localPort=', localPort);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a virtual host, close its tunnel, and release its local port.
|
||||
* @param {object} payload
|
||||
@@ -163,7 +140,6 @@ async function removeVirtualHost(payload) {
|
||||
debugLog('removeVirtualHost: hostname=', hostname);
|
||||
const entry = virtualHosts.get(hostname);
|
||||
if (!entry) return { ok: false, error: 'Virtual host not found' };
|
||||
if (entry.type === 'local') return { ok: false, error: 'Built-in host cannot be removed' };
|
||||
if (entry.reconnectTimer) { clearTimeout(entry.reconnectTimer); entry.reconnectTimer = null; }
|
||||
if (entry.localPort) releaseTunnelPort(entry.localPort);
|
||||
if (entry.holesail) { try { await entry.holesail.close(); } catch (_) {} }
|
||||
@@ -229,4 +205,4 @@ async function cleanupVirtualHosts() {
|
||||
virtualHosts.clear();
|
||||
}
|
||||
|
||||
module.exports = { init, setVirtualHost, setLocalVirtualHost, removeVirtualHost, getVirtualHosts, getLocalPortForHostname, getLocalBackend, getVirtualHostMap, cleanupVirtualHosts, RECONNECT_BASE_MS, RECONNECT_MAX_MS };
|
||||
module.exports = { init, setVirtualHost, removeVirtualHost, getVirtualHosts, getLocalPortForHostname, getLocalBackend, getVirtualHostMap, cleanupVirtualHosts, RECONNECT_BASE_MS, RECONNECT_MAX_MS };
|
||||
|
||||
Reference in New Issue
Block a user