From f059cb118c556d1f0279350507f74b8a47d5a98a Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Fri, 11 Sep 2026 00:19:06 +0200 Subject: docs: remove the documents MESHBAY_DESIGN.md replaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Twenty-four files, about 17 000 lines: the two architecture drafts, the three security reviews, eleven design notes, the roadmap, the decisions file, the v1–v4 archive, the deprecated user guide and the stale quickstart. Their content is in MESHBAY_DESIGN.md, and git history holds the originals. The reason to delete rather than keep bannered: a document that is superseded but present still gets read, and a reader cannot always tell which of two accounts of one mechanism is the live one. That was the argument for retiring the user guide rather than repairing it, and it applies to the whole set. What made this safe is the concordance. Roughly 290 comments and docstrings cite these files by section — `musicbay.md §6`, `mediacenter.md §5.5`, `draft-v6 §2.11` — and section 16 maps every one onto its replacement, so not a single comment needs editing to stay followable. It now says plainly that the files are gone and where to recover them, and it gained rows for the three reviews (their findings are section 13), and for the two guides. Four kept documents pointed into the set and were repointed first: `playlists.md` (nine references — it is a live proposal and must not dangle), `WINDOWS-PORT.md`, and CLAUDE.md's example. No dangling reference remains outside section 16. Two files were dropped from the list after checking what they hold. `HTTPS.md` is an operational runbook — Caddy, certificate renewal, DNS, troubleshooting — and MESHBAY_DESIGN.md deliberately covers no operations, so nothing would replace it; the versioned Caddyfile is the config, not the procedure. `cast-smart-tv.md` is the plan for the unbuilt DLNA phase of a feature whose first two phases ship, and section 11.4 summarises it in four lines rather than carrying the SSDP/UPnP work. There is no user guide now, and section 0.1 says so rather than leaving a reader to discover it. Suites green: 2258 passed, 4 skipped. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01YVoHVCcfBqud6ZjG4db3y7 --- docs/captcha.md | 555 -------------------------------------------------------- 1 file changed, 555 deletions(-) delete mode 100644 docs/captcha.md (limited to 'docs/captcha.md') diff --git a/docs/captcha.md b/docs/captcha.md deleted file mode 100644 index 7013804..0000000 --- a/docs/captcha.md +++ /dev/null @@ -1,555 +0,0 @@ -# reCAPTCHA on Registration and Password Reset - -> **Superseded by `MESHBAY_DESIGN.md`.** This was the registration and reset captcha; its design -> content now lives in §7.7. -> -> It is kept because code comments, tests and other documents cite its -> sections and its labels, and because it records reasoning a synthesis -> compresses. **Where it disagrees with `MESHBAY_DESIGN.md`, the design -> document is right; where either disagrees with the code, the code is.** -> `MESHBAY_DESIGN.md` §16 maps every section reference here onto its -> replacement, and §13 defines every label. - -> Goal: verify the user is not a bot **before** sending any email — registration -> verification code or password reset code. The captcha gate sits between form -> submission and the email-sending call, so a failed check never triggers an email. - ---- - -## 1. reCAPTCHA v2 (checkbox) - -reCAPTCHA v2 with the "I'm not a robot" checkbox. Reasons: - -- Binary pass/fail — no score threshold to tune or monitor. -- The user is already filling a form; one checkbox is negligible friction. -- Works in the web SPA. It works in the Electron client too, but not for the - reason "both run Chromium" — reCAPTCHA validates the *domain*, not the - rendering engine, and the desktop client's is not the hub's. See §6. -- v3 (invisible, score-based) is an option later if the checkbox proves annoying; - the server-side verification call is identical, only the client widget differs. - -**Google Console setup:** create a reCAPTCHA v2 key pair at -`https://www.google.com/recaptcha/admin`. Register the hub's domain(s) — -`meshbay.org` and `localhost` for development. This produces a **site key** -(public, embedded in HTML) and a **secret key** (server-only, in `hub.toml`). -If the desktop client is in use, also turn *off* "Verify the origin of -reCAPTCHA solutions" on that key and set `allowed_hosts` — §6 says why, and -what is given up. - ---- - -## 2. Configuration - -### `hub.toml` - -```toml -[captcha] -site_key = "6Le..." # public — served to the frontend -secret_key = "6Le..." # private — never leaves the server -``` - -When the `[captcha]` section is absent or both keys are empty, the captcha is -**disabled** — the registration endpoint accepts requests without a token. This -keeps development, tests and self-hosted instances that do not need it -frictionless. - -### `config.py` — new dataclass - -```python -@dataclass -class CaptchaConfig: - site_key: str = "" - secret_key: str = "" - - @property - def enabled(self) -> bool: - return bool(self.site_key and self.secret_key) -``` - -Add `captcha: CaptchaConfig` to `HubConfig` (default: disabled). Parse the -`[captcha]` section in `load_config` on the same pattern as `[jwt]`: - -```python -if cap := raw.get("captcha", {}): - cfg.captcha.site_key = cap.get("site_key", cfg.captcha.site_key) - cfg.captcha.secret_key = cap.get("secret_key", cfg.captcha.secret_key) -``` - -Environment variable overrides: `MESHBAY_CAPTCHA_SITE_KEY`, -`MESHBAY_CAPTCHA_SECRET_KEY`. - ---- - -## 3. Serving the site key to the frontend - -The site key is public and the SPA needs it before the user reaches the -registration form. Two options: - -**Option A — extend `/v1/hub/info`** (recommended). Add `captcha_site_key` to -the response (empty string when disabled). The SPA already calls this endpoint -at startup for `allow_public_groups`; no new request. The endpoint is -unauthenticated, which is correct — the site key is public by design. - -```python -# hub.py — hub_info() -return { - ... - "captcha_site_key": _cfg.captcha.site_key if _cfg and _cfg.captcha.enabled else "", -} -``` - -**Option B — inject in the HTML shell.** Add a `