spotube/jam-server/wrangler.jsonc
Kingkor Roy Tirtho 45a7758eb0 feat(jam): harden the room server, add device bans and friendly names
Security:
- Participants connect with a per-room key derived from a random per-install
  secret; others only see an id derived from it, so nobody can reconnect as
  someone else (including the host).
- "create" only works on a fresh code or for the room's own host, so empty
  rooms can't be taken over.
- Per-socket message and queue budgets disconnect clients that flood; the
  host throttles itself well under them.
- Bans also cover the device: a hashed digest of device traits combined with
  the network, stored only as an opaque per-room value. Earlier members are
  never caught by someone else's ban.
- Peer queue items and suggestions are sanitized (streaming tracks only, no
  URLs, https covers); suggestions are credited to the server-attested sender;
  local file paths go out as opaque ids. Names are cleaned server-side.
- Room codes and keys use a secure random source; the deploy workflow is
  read-only.

Names:
- Participants get a stable generated name ("Mellow Otter") per install, and
  can pick their own on the Jam screen or in Jam settings. The participant
  list marks "(you)".

Also translate the Jam strings into all locales and add tests for the above.
2026-10-31 18:14:45 +06:00

18 lines
713 B
Plaintext

{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "spotube-jam",
"main": "src/index.ts",
"compatibility_date": "2026-10-01",
"observability": { "enabled": true },
"durable_objects": {
"bindings": [{ "name": "JAM_ROOM", "class_name": "JamRoom" }]
},
"migrations": [{ "tag": "v1", "new_sqlite_classes": ["JamRoom"] }],
// Room connects per client IP: slows down code guessing and connection floods, which
// wake (and bill) rooms. Generous because carrier-grade NAT puts many phones behind
// one IP. Enforced per Cloudflare location, so approximate.
"ratelimits": [
{ "name": "CONNECT_LIMITER", "namespace_id": "1001", "simple": { "limit": 60, "period": 60 } }
]
}