From ae2f7c48dcb54954ace975155eb92e3fc97d5d5c Mon Sep 17 00:00:00 2001 From: Davide Cappellini Date: Tue, 10 Nov 2026 18:04:11 +0100 Subject: [PATCH] design: fix first GM login bootstrap (#5) Co-Authored-By: Claude Haiku 5.5 --- GLOSSARY.md | 8 ++++++++ docs/DESIGN.md | 2 ++ 2 files changed, 10 insertions(+) diff --git a/GLOSSARY.md b/GLOSSARY.md index 10e8d31..8697fe8 100644 --- a/GLOSSARY.md +++ b/GLOSSARY.md @@ -17,3 +17,11 @@ A lock condition meaning the token is pressed with no room: walls surround it, o _Avoid_: blocked, crushed Neither term names its cause. Stuck and squeezed both lock a token for its player in the same way; they differ only in why. + +**GM**: +The one person who runs the table and sees everything: all walls, all tokens, all hidden state. A player can never become the GM. +_Avoid_: DM, admin, host + +**Invite link**: +A secret link that admits one person to the table, with no password. +_Avoid_: invite code, join key, password diff --git a/docs/DESIGN.md b/docs/DESIGN.md index 72faa00..ec1cd2d 100644 --- a/docs/DESIGN.md +++ b/docs/DESIGN.md @@ -121,6 +121,8 @@ Notes: - One cookie jar = one identity; same cookie in two tabs = same player, shared vision, both connections synced [MEASURED, prototype README]. - WS upgrade: authenticate by cookie **and** verify the `Origin` header equals the configured public origin [PROPOSED; mitigates cross-site WebSocket hijack, SameSite=Strict is the first line]. - Invite secrets are stored plaintext so the GM can re-copy the link [FIXED, Q11]. +- **First GM login [FIXED, owner decision 2026-11-10, #5].** Only the server CLI creates the GM: `fff-vtt gm-link` creates the single GM player (role `gm`, display name `GM`) and a GM invite if none exists, and prints the full join URL (public origin from the same config the server reads). Re-running prints the same link; existing GM sessions are unaffected. `fff-vtt gm-link --new` rotates: new GM invite secret, old one invalid, all GM sessions revoked. `--new` refuses while the running server holds its lock on the data dir; the read-only print works at any time. Access control is filesystem permissions on the data files; no extra password. A visitor without an invite never becomes GM (no first-visitor claim); they see only a "need an invite" page. Renaming the GM is deferred to #6 (Players and invites). + - Rejected: env/config seed (secret leaks via config, repo, backups); auto-print at startup (secrets in logs); first visitor claims GM (takeover); rotate on every lookup (logs out GM devices); live rotation while the server runs (needs an admin channel to the running server). ### 3.3 Tiles - Browser asks `GET /tiles//_.png` (Nim path). Nim parses strictly (digits only, length-bounded, range-checked against scene size), checks the session's explored grid, and answers `200` with `X-Accel-Redirect: /_tiles/...` or `403`. nginx serves the bytes from an `internal` location; direct hits on `/_tiles/` give 404 [MEASURED: `prototype-server-vision/results/smoke.log`, README "Phase 2a"].