mirror of
https://github.com/djdevin/recflare.git
synced 2026-10-26 07:28:53 -07:00
26270e9c25
* rrs stuff * studio service yay * rrs whitelist * moree studiooooooo fellowwww * rec room studio room loading yay * fixes yay * fix 2 because idk yayuh * Update cdn.app.ts * ccontent length fix? * Preserve content-length and upgrade metadata Return a real zero-filled byte array for CDN HEAD responses so the runtime preserves Content-Length while still sending no payload. In notify, re-create the Request with its original headers, set OWNER_HEADER from the validated token, and forward that Request to hub.fetch to avoid losing WebSocket upgrade metadata (which could trigger 500s in Durable Objects). These changes ensure the editor's size checks and WebSocket upgrades remain reliable. * fix x524234 * shirt thing? * [auth] remove grant table as we already have audit_log for now * rename table to generic device_grant * cleanup/lint --------- Co-authored-by: Devin Zuczek <devin.zuczek@gmail.com>
api
Game API Worker served on the api subdomain. A Hono app serving the game's
API surface. Database-backed queries and on-disk JSON files are stubbed for now
— no real bindings yet.
Behavior
- Auth-gated routes validate the Bearer JWT issued by the
authworker (same dev secret, seesrc/jwt.ts) and 401 when it's missing/invalid. - API-owned uploads enforce
RECFLARE_MAX_API_UPLOAD_BYTESper file (64 MiB by default) before copying a parsed file into anArrayBufferor writing it to R2. - Static data is served verbatim:
src/default-avatar-items.ts→GET /api/avatar/v4/itemssrc/default-settings.ts→GET /api/settings/v2
- DB-backed reads return empty collections / not-found.
- File-backed reads return empty placeholders, each marked
TODO: hydrateinsrc/api.app.ts(Workers have no filesystem — these will move to a binding or inline JSON later).
TODO before production
- Wire a DB binding (D1/DO) for rooms, avatars, settings, gifts, balances, etc.
- Hydrate the
TODO: hydrateendpoints with real config/JSON. - Move the JWT secret to a shared secret binding (shared with
auth). - Persist uploads from
POST /api/images/v4/uploadsaved(e.g. R2).