v0.2.0 Phase 1 — Infrastructure (rate limiting, CI deploy, settings sync)#2
Merged
Merged
Conversation
…1.2) Co-authored-by: Chaitanya Mittal <chtnnh@users.noreply.github.com>
Co-authored-by: Chaitanya Mittal <chtnnh@users.noreply.github.com>
…ync with DO (Phase 1.3) Co-authored-by: Chaitanya Mittal <chtnnh@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements Phase 1 — Infrastructure from
docs/v0.2.0-plan.md, one logical commit per sub-task.1.2 Rate limiting
apps/web/src/lib/rate-limit.ts: in-memory fixed-window limiter keyed per client IP (x-forwarded-for→x-real-ip), returns a429with clear JSON +Retry-After.POST /api/rooms→ 10/hour per IP.POST /api/import/youtube→ 30/min per IP.1.1 CI auto-deploy
.github/workflows/deploy.yml: on successful CI run onmain(workflow_run), deploys the Cloudflare Worker viapnpm --filter @together/realtime deploy.CLOUDFLARE_API_TOKEN+CLOUDFLARE_ACCOUNT_ID(documented in the workflow header).apps/web) continues to deploy via the Vercel Git integration — documented in the workflow comments.1.3 DO ↔ Postgres settings sync
room-client.tsx: host settings changes now PATCH/api/rooms/[slug]/settingswhenever the userisHost(previously gated onhasOwner && isHost). The settings route already authorizes ownership server-side, so this keeps the DB in sync with the Durable Object and closes the gap for rooms claimed later in a session./inithandler does not clobber live settings (only seeds on a genuinely new room), so no change needed there.Testing
pnpm typecheck(6/6)pnpm lint(6/6)429withRetry-After; a different IP is unaffected; YouTube import blocks at the 31st request/min.403) auth path needs a real Postgres + Supabase auth, which aren't configured in this environment.Rate-limit proof log:
phase1_ratelimit_proof.log
To show artifacts inline, enable in settings.