Family onboarding site: invite-gated signup, template config, /get/tv #7
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/onboarding-site"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The distribution site — a family member gets fully set up from a browser: account, addon config, TV login. No PC install, no typing addon URLs.
Pages (pb_public/, served by PocketBase itself at
/— same origin, no new service)/landing — create-account CTA, TV sign-in steps, and login-gated Windows/Linux downloads (existing update manifest + file tokens)./onboarding.htmlwizard — invite code → account → named default profile ("Kdo se bude dívat?" — the app adopts the earliest-created profile) → family template encrypted in the browser under the new user's password and pushed as theiraddon_configciphertext. Crypto is byte-compatible with the app'sAddonConfigCrypto(PBKDF2-HMAC-SHA256 210k → AES-256-GCM,nonce‖ct‖tag): a wizard-produced blob was decrypted with the app's Dart crypto in a probe test, all fields intact. Adult fields are never in the template (adultAddonUrl: null,adultEnabled: false) — mirrors the #14/#20 stripping./get/tv— public direct download of the newest clean Android APK (Content-Disposition: amber-tv.apk), so the TV's Downloader app can sideload from a plain URL. Adult builds stay account-gated, unchanged./deviceapprove flow (#12) — QR or typed code, vault key sealed to the TV.Backend
onboarding_templatecollection: one admin-maintained record (addonUrl,czechAddonUrl,tmdbKey,note), all rules null — the invite-gated hook is the only reader; you edit it in the admin UI.AMBER_INVITE_CODEenv gates both doors, fail-closed when unset:userscreate requires it (X-Amber-Inviteheader or?invite=; superusers bypass). ⚠️ This also closes the previously-open in-app registration — the app's register screen will refuse until it grows an invite field. Family onboarding happens via the site, so acceptable for now.GET /api/amber/onboarding-template?code=…returns the plaintext template (403 bad code, 429 after 10 bad codes / 5 min / IP, 404 no record, 503 env unset).pb_public+--publicDir; compose passes the env var for local runs.Deploy (docs/onboarding-contract.md has the full checklist)
amber.petruzalekr.cz→ server; Domains field →https://pb.petruzalekr.cz,https://amber.petruzalekr.cz(the site is host-agnostic).AMBER_INVITE_CODE=<code>, redeploy.onboarding_template→ fill the record./get/tv+ downloads serve.Verification (local, pocketbase 0.39.6 against the repo dirs)
Signup: refused w/o + w/ wrong code (Czech error), accepted via header and query · template route: 200/403/429/404 all hit · full wizard run in a real browser → user + profile + blob created; blob decrypted with the app's Dart
AddonConfigCrypto·/get/tvstreamed a published dummy APK byte-identical · landing download login handled the no-releases state. Also fixed en route:e.request.url.query()throws on record-request events —requestInfo().queryis the correct accessor.🤖 Generated with Claude Code