From f9ca3fb5ba767300bec3f1fbb13fc5e6552a90e3 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 12 Oct 2026 16:48:56 -0300 Subject: 9web: restore host namespace and mounted 9P browsing Add explicit filesystem:"/" export with kernel-enforced user access, symlink/mount traversal and normal file operations. Compose the virtual catalogue at /_9web and wrap the workstation user service with 9ns --mntgen so /mnt/9p is live in its own namespace. Fix non-seekable FUSE EOF translation, asynchronous read lifecycle and flush/clunk cancellation, oversized HTTP directory reads and fixed listing buffers, and borrowed WASM reply frames causing InputFull on large browser reads. Remove the sidebar and expose direct follow links without waiting for stream EOF. Document deployed namespace/security implications and the Plan 9 source critique: posted 9P endpoints, manual site configuration and passive HTTP discovery are distinct; pure site/control publication and unified static serving remain future work. Verified ReleaseSafe build, catalogue and host-FS integration, HTTP-FS and 32 existing E2E scenarios, and Chromium fixture/live navigation through /mnt/9p/agents, large history, zmx files and /usr/bin. Installed service enabled and active on [::]:8090, with generated sites still served. --- web/static/catalog.mjs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'web/static/catalog.mjs') diff --git a/web/static/catalog.mjs b/web/static/catalog.mjs index d1d3444..e110dee 100644 --- a/web/static/catalog.mjs +++ b/web/static/catalog.mjs @@ -12,6 +12,7 @@ function url(address, port, protocol = 'http') { export function catalogViews(pathLink) { let active = 'files', timer = null, request = null, revision = 0, pending = new Set(); const rows = new Map(); + let namespace = ''; function status(view, text, error = false) { const p = $(`${view}-status`); p.textContent = text; p.classList.toggle('error', error); } @@ -19,7 +20,7 @@ export function catalogViews(pathLink) { if (pending.has(site.name)) return; pending.add(site.name); updateSite(site); try { - const r = await fetch(`/fs/sites/${encodeURIComponent(site.name)}/ctl`, { method: 'PUT', body: command }); + const r = await fetch(`/fs${namespace}/sites/${encodeURIComponent(site.name)}/ctl`, { method: 'PUT', body: command }); if (!r.ok) throw new Error(await r.text()); status('sites', `${site.title}: ${command} requested.`); } catch (error) { status('sites', error.message, true); } @@ -35,7 +36,7 @@ export function catalogViews(pathLink) { const tools = element('div'); tools.className = 'site-actions'; const build = element('button', 'build'), watch = element('button', 'watch'), cancel = element('button', 'cancel'); for (const b of [build, watch, cancel]) b.type = 'button'; - tools.append(build, watch, cancel, pathLink('files', `/sites/${site.name}/public`), pathLink('log', `/sites/${site.name}/log`)); + tools.append(build, watch, cancel, pathLink('files', `${namespace}/sites/${site.name}/public`), pathLink('log', `${namespace}/sites/${site.name}/log`)); actions.append(tools); tr.append(name, phase, finished, actions); row = { tr, link, root, phase, finished, build, watch, cancel }; rows.set(site.name, row); $('sites-entries').append(tr); @@ -74,6 +75,7 @@ export function catalogViews(pathLink) { if (!r.ok) throw new Error(`Unable to load ${view}: HTTP ${r.status}`); const data = await r.json(); if (ticket !== revision || active !== view) return; + namespace = data.namespace || ''; if (view === 'sites') { const names = new Set(data.sites.map(s => s.name)); for (const [name, row] of rows) if (!names.has(name)) { row.tr.remove(); rows.delete(name); } -- cgit v1.3