From 7a07e24916cd5bc762996d81aa1faf550177cd6f Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 12 Oct 2026 17:15:03 -0300 Subject: 9web: serve prefixed sites through the composed 9P namespace Post only the pure site/control/discovery tree, with a separate host-only adapter and no duplicate supervision. Serve websites, metadata and legacy controls through the ordinary 9P mux; retain whole-root filesystem browsing and compatibility paths. Pin public file descriptors across publication. Add opt-in build-time HTML/CSS prefix packaging with separate atomic preview generations and unchanged JavaScript/default output. Optional compatibility ports use ?u16. Deploy all five workstation sites on [::]:8090, with /mnt/9p/9web controls. Document Plan 9 references, companion build commits, shared-origin trust and live validation. Validated catalogue, host/FUSE, HTTP FS, mux, prefix and Chromium suites; original E2E 32 scenarios; all five live sites, blog navigation, IPv4/IPv6 and real cafe build through 9P. --- test/web/catalog.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test/web/catalog.py') diff --git a/test/web/catalog.py b/test/web/catalog.py index e1b153e..87773d8 100644 --- a/test/web/catalog.py +++ b/test/web/catalog.py @@ -6,6 +6,7 @@ import json import os from pathlib import Path import socket +import shutil import struct import subprocess import sys @@ -145,8 +146,14 @@ def main(): assert http(site_port, '/nested/')[2] == b'nested page' assert http(site_port, '/', 'HEAD')[2] == b'' assert http(site_port, '/style.css', headers={'Range':'bytes=0-3'})[2] == b'body' + assert http(dashboard, '/sites/fixture/')[2] == b'

catalog fixture

' + assert http(dashboard, '/sites/fixture/pretty')[2] == b'pretty page' + assert http(dashboard, '/sites/fixture/nested?x=1')[1]['location'] == '/sites/fixture/nested/?x=1' + assert http(dashboard, '/sites/fixture/style.css', headers={'Range':'bytes=-2'})[0] == 206 + assert http(dashboard, '/sites/fixture/style.css', headers={'Range':'bytes=999999-'})[0] == 416 for path in ['/../secret', '/%2e%2e/secret', '/escape', '/escape-dir/secret', '/.git/config', '/%2fetc/passwd']: assert http(site_port, path)[0] in (400,403,404), path + assert http(dashboard, '/sites/fixture' + path)[0] in (400,403,404), path assert http(dashboard, headers={'Host':'attacker.invalid'})[0] == 403 ctl = '/_cloud9/sites/fixture/ctl' assert http(dashboard, ctl, 'POST', 'build', {'Origin':'https://attacker.invalid'})[0] == 403 @@ -199,6 +206,17 @@ def main(): nine.write('sites/fixture/ctl', 'build') eventually(lambda: json.loads(nine.read('sites/fixture/status'))['phase'] == 'failed') assert http(site_port)[0] == 200 + # A published generation replacement must not splice an open fid. + saved = (public/'style.css').read_bytes() + nine.walk('sites/fixture/public/style.css') + nine.rpc(112, struct.pack('