test: TLS + HTTP/2 test vhost with the client dist served at /
The test nginx is now the production shape of DESIGN 11.1 and the browser gate's real path (#66, spec #63 decision 6): TLS-only listener with http2 on, a self-signed certificate generated per run (tools/tlsdev.mjs, added to the process's default CA list so verification stays on), the client dist at / with SPA fallback, index no-cache and a year-immutable /assets/ cache, and the tile gate's internal /_tiles/ still unreachable. Existing tile/doors/oneway/wallbehaviour harnesses point their server's public origin at the https vhost, so they prove the same listener the browser uses. tools/vhost.test.mjs is the independent node:http2 client (cert SANs, ALPN h2, cache headers, SPA fallback, direct /_tiles/ 404); e2e/h2.test.mjs drives devbox chromium via playwright-core and asserts the page reports h2 (`devbox run e2e`, npm deps outside tools/). Root devbox gains chromium + openssl. Harness builds use a worktree-local nimcache so parallel worktrees stop corrupting each other's objects. Refs #66
This commit is contained in:
+20
-2
@@ -555,7 +555,16 @@ from the prototype, what was missing, what the M3 build added, and the tools it
|
||||
already drives devbox chromium, `prototype-pixi-perf/bench.mjs`; SwiftShader is fine for correctness,
|
||||
not for perf). Checks: join -> canvas renders; pixel probe shows unexplored area black, visible area
|
||||
map-coloured, dimmed explored area; GM sees walls, player DOM/network contains none; reconnect
|
||||
restores view; drag moves token and rollback works.
|
||||
restores view; drag moves token and rollback works. The harness is `e2e/` and the gate is
|
||||
`devbox run e2e`, separate from `devbox run test` (§11.1).
|
||||
- **TLS/HTTP2 vhost (#66)**: `tools/vhost.test.mjs` (built-ins, `node:http2`) is the independent
|
||||
client for the vhost itself: the generated certificate is self-signed and names loopback, ALPN
|
||||
selects `h2`, `/` serves the client `dist` with index `no-cache`, `/assets/` with a year-immutable
|
||||
cache and no SPA fallback for a missing hash, a client route falls back to `index.html`, and direct
|
||||
`/_tiles/` is still 404. `e2e/h2.test.mjs` proves the same from real Chromium: it loads the dist and
|
||||
`performance.getEntriesByType('navigation')[0].nextHopProtocol` is `h2` over TLS. Before the client
|
||||
exists the served `dist` is the throwaway fixture of `tools/distfixture.mjs`; T4 replaces it with
|
||||
the real Vite build and extends the same gate.
|
||||
- **Independent traffic audit in e2e**: record all WS frames and HTTP responses seen by a player
|
||||
browser and run the leak checker's (a)(e) assertions over them.
|
||||
|
||||
@@ -573,7 +582,9 @@ from the prototype, what was missing, what the M3 build added, and the tools it
|
||||
`Cookie` and `Origin` on the wire, and without `{headers}` no `Origin` is sent; pinned by
|
||||
`tools/wsheaders.test.mjs` so a Node upgrade that drops the option fails loudly.
|
||||
- Root `devbox.json` pins `nodejs` 26 and the `nginx` used only by the test harness (DESIGN §11.1); no
|
||||
global tooling.
|
||||
global tooling. M4 (#66) adds `chromium` (the browser e2e) and `openssl` (generating the test
|
||||
certificate); the e2e's only npm dependency, `playwright-core`, is pinned by `e2e/package-lock.json`
|
||||
and lives outside `tools/`, so this built-ins-only rule keeps holding.
|
||||
- `devbox run test` = Nim tests first, then Node harnesses.
|
||||
- The nine M3 accept groups and their proving harness tests are mapped in `tools/groups.mjs`;
|
||||
`tools/groups.test.mjs` fails if a group file or its named evidence test disappears, so the
|
||||
@@ -596,6 +607,13 @@ from the prototype, what was missing, what the M3 build added, and the tools it
|
||||
describes: `/join` (`access_log off`), `/tiles/` proxy, `/ws` upgrade, `/healthz` readiness, and
|
||||
`location /_tiles/ { internal; alias <state>/tiles/; }`. Tile bytes are 32 px fixture PNGs from
|
||||
`tools/tilefixture.mjs`, written under `<state>/tiles/`; none is committed.
|
||||
- TLS + HTTP/2 + client dist (#66, spec #63 decision 6): the listener is TLS-only with `http2 on`,
|
||||
because browsers negotiate h2 only over TLS and the session cookie is `Secure`. `tools/tlsdev.mjs`
|
||||
generates the self-signed certificate per run (SAN `localhost`/`127.0.0.1`, never committed) and
|
||||
appends it to the process's default CA list, so fetch/WebSocket/`node:http2` verify it with
|
||||
verification on. `distDir` (default `<state>/dist`) is served at `/` with the production cache
|
||||
split; the tile/doors/oneway harnesses keep their `publicOrigin` at the vhost, so they now run
|
||||
through the same TLS origin the browser uses.
|
||||
|
||||
### 11.2 Backups
|
||||
|
||||
|
||||
Reference in New Issue
Block a user