[client] Calls: four MLS kinds (call, callAnswer, callIce, callEnd) with the frame key in the offer; coturn in the NixOS module; Caddy's global logger mkDefault; v0.3.0

This commit is contained in:
2026-12-03 09:20:13 +01:00
parent cb7cbd4941
commit 7c6a1680af
14 changed files with 1107 additions and 23 deletions
+16
View File
@@ -59,6 +59,17 @@ Every MLS application message carries one JSON object. The relay sees none of it
| `file` *(2026-11-22)* | `seq`, `file`, `fetchToken`, `key`, `name`, `mime`, `size`, `thumb`? | a message (it shares `seq` with `text`): a file on the relay (§8, files). `file` its id, `fetchToken` the capability to get its chunks, `key` its 32-byte key; `name` 1–255 characters without control characters, `/` or `\`; `mime` `type/subtype`, 3–127 printable ASCII bytes; `size` 1 byte to 100 MiB; `thumb`, when there, a JPEG of at most 32 KiB (a receiver drops a thumbnail that is not, and keeps the file). The key, the name, the type and the exact size travel **only here** |
| `receipt` | `upto` | the receiver has saved the sender's texts up to `upto`. Sent only by a client with receipts on; a client with them off also ignores them |
| `inbox` | `postToken` | a new post token for the mailbox the receiver already knows (after an unblock). It cannot name another mailbox |
| `call` *(2026-12-03, calls)* | `id`, `video`, `sdp`, `key`, `at` | an offer: `id` 16 random bytes made by the caller; `sdp` the WebRTC offer, 1 byte to 16 KiB; `key` the call's 32-byte frame key, made for one call, travelling **only here**; `at` the caller's clock in Unix seconds (a receiver rings only when it is recent). Dropped if its `id` is already live. No `seq` |
| `callAnswer` *(2026-12-03)* | `id`, `sdp` | the answer to the receiver's own live offer `id`, once; any other is dropped. No `seq` |
| `callIce` *(2026-12-03)* | `id`, `candidates` | 0–32 ICE candidates for the live call `id`, each 1–512 bytes without control characters; `[]` says no more. No `seq` |
| `callEnd` *(2026-12-03)* | `id`, `seq`, `reason`, `seconds` | a message (it shares `seq` with `text`): the call `id` is over, `reason` one of `hangUp`, `declined`, `busy`, `missed`, `failed`, after `seconds` (0–86 400). Shown even for an offer the receiver never saw, so a missed call leaves its line |
**Calls** *(added 2026-12-03, Amicitia F36; `.agents/features/call-kinds.md`)*: the four kinds set up a
WebRTC call between the two members. The SDP carries each side's DTLS fingerprint, so neither the
relay nor a TURN server can stand in the middle of the media's handshake; the app also seals every
media frame under `key`. A client keeps the calls in progress in memory only (at most 8); after a
restart an answer or candidates for a call it no longer knows are dropped. Only `callEnd` has a
`seq`, so a client without these kinds shows it as *update the app* and drops the other three.
**Naming a message** *(added 2026-11-21, Amicitia F27; `.agents/features/reactions-replies.md`)*:
`{"author", "seq"}`, where `author` is the 16 random bytes in the author's MLS credential (unpadded
@@ -138,6 +149,11 @@ The platform facts above are Claude's understanding, to be verified in `.agents/
- *(2026-12-03)* A long-poll is answered as soon as a blob arrives for its mailbox, and only then or after its
wait; a wrong token is never held; TURN credentials are coturn's REST pair, name no mailbox, are limited per
hour, and neither they nor the TURN secret reach the database (`relay/tests/calls.rs`).
- *(2026-12-03)* A call's SDP, candidates, id and key never appear in the relay's database
(`client/tests/real_relay.rs`, `client/tests/calls.rs`); an answer to anything but the receiver's own live
offer, a second offer under a live id, candidates for a call that is not live and a blocked contact's call are
dropped (`client/tests/calls.rs`, the client's unit tests). coturn relays only for the relay's credentials and
writes no client address anywhere on the server (`deploy/nixos/test.nix`).
- Parsers are fuzzed (`cargo fuzz`) for every message type.
- Every check in `VERIFY.md` §1 has a CI job or a documented manual procedure.