summaryrefslogtreecommitdiffstats
path: root/web/README.md
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-08 03:29:35 +0100
committersalmonik <salmonik@tuta.io>2026-11-08 03:29:35 +0100
commit058432130628d00764663ecf819a9adc6793768d (patch)
treed3f49f111fbfaa48647cca2600adcf9017af2d30 /web/README.md
parentweb: serve latest.php through PHP and refuse stray PHP files (diff)
downloadzagan-bet-058432130628d00764663ecf819a9adc6793768d.tar.gz
zagan-bet-058432130628d00764663ecf819a9adc6793768d.zip
v5.0.0: protocol v5 and the browser frontend
Protocol v5 replaces newline lines with bounded [u32 len][text] frames and REQ/RES/EVT envelopes. Requests carry correlation ids and the server replays the last 256 replies per connection, so a gateway retry cannot double-debit and a late reply cannot clobber a newer request. HELLO/PONG carry server time; crash rounds announce started_at and push coalesced 10 Hz ticks. Crash now commits sha256(seed) before a round and reveals the seed when it ends, so clients recompute the crash point. Adds the webd/ gateway: one blocking thread, one ClientCore and one pinned upstream TLS connection per session, an HttpOnly session cookie, takeover, and a 60-second grace window. The browser sends Command JSON and renders View JSON; it never speaks the game protocol or stores credentials. Adds the vanilla TypeScript browser app at /play/ (login, lobby, all four games, history, notices, crash verification), the nginx /play and /ws routes, and the headless DOM smoke test. webd and the app stay out of the TUI/GUI/server build graph. The client/server version moves to 5.0.0 in lockstep; v4 peers are refused at HELLO.
Diffstat (limited to '')
-rw-r--r--web/README.md27
1 files changed, 24 insertions, 3 deletions
diff --git a/web/README.md b/web/README.md
index 81346fd..3e81468 100644
--- a/web/README.md
+++ b/web/README.md
@@ -13,6 +13,7 @@ web/
13 releases.php shared scanner and hash cache 13 releases.php shared scanner and hash cache
14 install.sh stable Linux installer 14 install.sh stable Linux installer
15 install.ps1 stable Windows installer 15 install.ps1 stable Windows installer
16 play/ browser app, served at /play/
16 bin/gui/ apps, served at /bin/gui/... 17 bin/gui/ apps, served at /bin/gui/...
17 bin/client/ terminal clients 18 bin/client/ terminal clients
18 bin/server/ servers 19 bin/server/ servers
@@ -20,6 +21,26 @@ web/
20 21
21Serve `web/` as the document root. Binaries in `bin/` are gitignored. 22Serve `web/` as the document root. Binaries in `bin/` are gitignored.
22 23
24## Browser app
25
26`play/` is a static vanilla TypeScript app. It talks to the WebSocket gateway
27in `webd/`, not to the game server: the browser sends `Command` JSON and renders
28`View` JSON, and the gateway owns the upstream TLS connection and the pinned
29server key. nginx serves `/play/` and proxies `/ws` to `127.0.0.1:8890`.
30
31Build it before publishing:
32
33```sh
34cd web/play
35npm ci
36npm run build # writes app.js
37cd ../..
38```
39
40Commit the generated `app.js`; the site then needs no Node at deploy time.
41`npm run typecheck` checks the sources. The gateway has its own deployment
42notes in `webd/README.md`; it is not part of the player download.
43
23## Naming 44## Naming
24 45
25The page only lists files that match the release pattern; anything else in 46The page only lists files that match the release pattern; anything else in
@@ -132,9 +153,9 @@ Then open <http://127.0.0.1:8899/>.
132`deploy.sh` rsyncs `web/` with `--delay-updates`, so a visitor never sees a 153`deploy.sh` rsyncs `web/` with `--delay-updates`, so a visitor never sees a
133half-written binary, then fetches the live page and every artifact it lists — 154half-written binary, then fetches the live page and every artifact it lists —
134GUI apps, installers, terminal clients and servers — and compares the 155GUI apps, installers, terminal clients and servers — and compares the
135downloaded bytes with the local SHA-256. `--verify-only` skips the 156downloaded bytes with the local SHA-256. It also fetches `/play/`, `app.js` and
136upload and only checks the live site. Old versions are left on the server; 157`style.css`. `--verify-only` skips the upload and only checks the live site.
137prune them by hand. 158Old versions are left on the server; prune them by hand.
138 159
139A local directory works as a target, which is how the verification itself is 160A local directory works as a target, which is how the verification itself is
140tested: 161tested: