Commit graph

15 commits

Author SHA1 Message Date
ed0578cd07 Address security/tech debt: token refresh, JWKS thundering herd, config safety, jq migration
- Add token refresh logic in Auth.js JWT callback with 60s expiry buffer
- Fix JWKS cache thundering herd with Mutex + double-checked locking
- Make trustHost conditional (dev-only) via SvelteKit's $app/environment
- Make devMode conditional on ZITADEL_PRODUCTION env var in setup script
- Replace fragile grep/cut JSON parsing with jq in setup-zitadel.sh
- Add OIDC_GRANT_TYPE_REFRESH_TOKEN to Zitadel OIDC app grant types
- Update TODO_SECURITY.md: mark resolved items, add RefreshAccessTokenError frontend handling

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 13:17:42 +01:00
76489a53a6 Add social login providers (Google, Apple, Facebook) to TODO
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 12:57:19 +01:00
c0cb2d25a0 Fix auth flow: federated logout, login page move, and healthcheck
- Add federated logout endpoint that clears Auth.js session AND ends
  Zitadel SSO session via OIDC end_session endpoint
- Move sign-in page from /auth/signin to /login to avoid Auth.js
  route conflict causing ERR_TOO_MANY_REDIRECTS
- Add callbackUrl to all signIn calls so users land on /dashboard
- Store id_token in session for federated logout id_token_hint
- Fix Zitadel healthcheck using binary ready command (no curl needed)
- Update post_logout_redirect_uri in setup script

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 12:55:35 +01:00
a22ba48709 Add Zitadel OIDC setup, SMTP config, and security fixes
- Add setup-zitadel.sh: idempotent script that creates PVM project
  and OIDC app via Zitadel Management API using machine user PAT
- Add machine user + PAT auto-generation to docker-compose via
  FIRSTINSTANCE env vars with bind-mounted machinekey directory
- Add SMTP configuration for email sending (verification, password reset)
- Fix JWT algorithm confusion attack: restrict to RS256/384/512 only
- Add docs/TODO_SECURITY.md tracking review findings
- Update .env.example files with correct local dev URLs
- Add docker/machinekey/ to .gitignore

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 12:34:44 +01:00
633f2ad684 Fix Zitadel dev setup: use login v1 and add healthcheck
- Switch image to ghcr.io/zitadel/zitadel:latest (v4.x)
- Disable login v2 (LOGINV2_REQUIRED: false) to use built-in login v1
- Add curl-based healthcheck for reliable container readiness

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 06:22:26 +01:00
00c94244cb Fix misaligned right border in ASCII art hero
All lines now verified at exactly 68 characters wide.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 05:52:01 +01:00
c15762f55b NFO-style ASCII art hero section for README
Demoscene vibes with block letters and shade borders.
Because every project deserves a proper .nfo.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 05:46:52 +01:00
93b100539e Fix Zitadel masterkey: must be exactly 32 bytes
The previous placeholder was 33 chars. Use a proper 32-char
placeholder and note the constraint in the example.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 05:39:18 +01:00
7ecdec20a2 Replace broken logo placeholder with ASCII art hero section
Swapped the non-existing logo SVG and badge soup for a light-hearted
ASCII card table with poker suits. Added "No rake required." tagline.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 05:38:39 +01:00
c972926d31 Scaffold base webapp: Rust/Axum API + SvelteKit dashboard + Docker dev env
Backend (Rust/Axum):
- pvm-api: Axum server with health and user profile endpoints,
  OpenAPI/Swagger UI, CORS, tracing, graceful shutdown
- pvm-auth: JWT validation middleware with JWKS cache for
  offline-capable Zitadel token verification
- pvm-core: Shared error types with IntoResponse impl
- pvm-types: Shared domain types (UserProfile)

Frontend (SvelteKit):
- Dashboard app with Svelte 5 + TypeScript + Tailwind CSS v4
- Zitadel OIDC auth via @auth/sveltekit (PKCE flow)
- Pages: landing, sign-in, dashboard, account settings
- Responsive sidebar layout with dark mode support
- Typed API client for backend communication

Infrastructure:
- Docker Compose dev environment with Zitadel v3, PostgreSQL 16,
  and DragonflyDB
- Environment variable examples and setup documentation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 03:37:07 +01:00
e25afdcb3a Add auth framework research document
Comprehensive evaluation of 11 auth frameworks for PVM's
split-brain architecture. Recommends self-hosted Zitadel v3
for its Rust crate, OIDC JWKS for offline JWT validation on
RPi5 nodes, and zero-cost self-hosting on existing Hetzner PVE.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 03:24:51 +01:00
995a8123e6 Update README and VISION with finalized tech stack decisions
Align both documents with resolved tech stack choices:
- Hetzner PVE hosting, Docker-based RPi5 nodes
- Android display client with mDNS (no Chromecast dependency)
- Event-based NATS sync, 72h offline limit
- PVM signup-first accounts, no money handling
- Add tech stack summary table to README

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 03:12:56 +01:00
2bb381a0a3 Update tech stack research with finalized decisions
Resolve all open questions from tech stack review:
- Self-hosted on Hetzner PVE (LXC + Docker)
- Event-based sync via NATS JetStream
- Generic display system with Android client (no Cast SDK dep)
- Docker-based RPi5 provisioning
- No money handling, 72h offline limit, REST + OpenAPI
- PVM signup-first for player accounts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 03:06:53 +01:00
cf03b3592a Add comprehensive tech stack research document
1,190-line research covering all 18 technology areas for PVM:
Rust/Axum backend, SvelteKit frontend, Postgres + libSQL databases,
NATS + JetStream messaging, DragonflyDB caching, and more.
Includes recommended stack summary and open questions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 02:50:33 +01:00
7bd1805b67 Initial commit: project vision and README
Establish PVM (Poker Venue Manager) project with product vision
document covering all feature domains and a clean README with
project overview.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 02:39:17 +01:00