Files
pipelines/web/README.md
T
alan 3b1760fe8e Web: WebAssembly build served cross-origin isolated, immutable and precompressed
The web app is built with --wasm (skwasm, JS/CanvasKit fallback beside it).
The proxy serves it with COOP same-origin + COEP credentialless so skwasm
renders on a worker; an installed build loads from /_v/<buildId>/ cached as
immutable, other files revalidate by ETag, and the installer precompresses
.br/.gz variants the proxy sends by Accept-Encoding. The bootstrap no
longer registers Flutter's deprecated service worker (a reload per install).
Read aloud on the web uses the Web Speech API through package:web: the
flutter_tts web plugin's interop casts fail under wasm. Bench kit: isolation
and headed modes, renderer and memory reporting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 21:05:17 +00:00

30 lines
1.4 KiB
Markdown

# Web proxy
`serve.mjs` is the authenticated front door: the sign-in page, the Flutter web
app (built from `app/` by the installer, in Docker), and a same-origin proxy to
the Pipelines server for `/connect`, `/artifacts/` and `/chat-uploads`. It has
no dependencies.
```sh
node serve.mjs --port 8082 --host 0.0.0.0 --pipelines 127.0.0.1:8080 \
--root ~/.local/share/pipelines/lib/app-web \
--updates ~/.local/share/pipelines/lib/app-updates
```
- `--root` is the web app (default: `../app/build/web`). Without a build, the
page explains how to make one (`./install --web`).
- The app is served cross-origin isolated (COOP `same-origin`, COEP
`credentialless`), so its WebAssembly renderer runs multi-threaded. An
installed build (with `release.json`) loads its files from
`/_v/<buildId>/`, cached as immutable; the shell is never cached and the
other files revalidate by ETag. Files precompressed by the installer
(`.br`, `.gz`, `scripts/precompress_web.mjs`) are sent to browsers that
accept them. See `src/appFiles.js`.
- `--updates` serves the Android app's `version.json` and APK at `/updates/`
(`./install --apk`), behind the same sign-in.
- The password lives in `~/.config/pipelines/web-auth.json`
(`PIPELINES_WEB_AUTH_FILE`); the installer asks for it on a new computer.
Tests: `npm test` (proxy routing and origin checks). The server's artifact
isolation test drives `test/artifact-security-probe.mjs` in Chrome.