r/coolgithubprojects • u/tidbitxx • 14m ago
End-to-end encrypted, invite-only messenger that runs entirely on CF's free plan (Durable Objects + Pages), and you can host your own
gallerycha7 is a small private messenger, 1:1 chats, groups up to 10, photos, voice, short videos, files up to 25 MB, P2P chat and voice calls. Everything is end-to-end encrypted in the browser; it installs as a web app on phones and computers. No phone number, no email: an account is a key on your device (similar to a crypto wallet), and you get in only with an invite link - https://cha7.pages.dev
Try it / read more
- Live demo, no account (the real app on made-up chats, nothing leaves the page): https://cha7.pages.dev/demo
- Website: https://cha7.pages.dev
- White paper (threat model, crypto, limits): https://cha7.pages.dev/whitepaper
- Docs: https://github.com/t0ma5/cha7/blob/main/DOCS.md
- Source (AGPL-3.0): https://github.com/t0ma5/cha7
How it uses Cloudflare
- One Durable Object per member (SQLite-backed) is their inbox: it holds their WebSockets (hibernation API), keeps sealed envelopes until every device has them, then deletes them. A second DO is the registry (invites, members, admin).
- Pages serves the app; Pages Functions only forward
/inbox/*and/api/*to the DOs, and throw away malformed requests before any DO wakes up. - Web Push straight from the Worker (VAPID, RFC 8291 for the one push with a payload: "incoming call").
- Cloudflare Realtime TURN relays P2P chats and calls when there's no direct path.
- Built for the free plan: live chats write nothing to SQLite (held-and-forwarded if every device is online), rows are metered per sender with a daily budget so one member can't burn an inbox's read quota, persisted logs are off.
What the server sees, honestly: who writes to whom and when, sizes, IPs. Never content, names or group membership: a group message is one sealed copy per member, and the server has no group object. Forward secrecy is per day (not per message, to save up in CF free tier), there's no deniability yet, and as with any web app, the code comes from the server. The white paper spells all that out, including a comparison with WhatsApp, Telegram and Signal.
Run your own: about 15 minutes. Clone, npx wrangler login, one script makes the secrets and config, deploy the Worker and the Pages project, open the admin link. Steps: https://github.com/t0ma5/cha7#self-hosting
Feedback welcome, especially from anyone who has pushed Durable Objects hard on the free plan, or wants to poke holes in the crypto.
