| 1 | # XMPP |
| 2 | |
| 3 | Prosody and coturn run as Nomad/Podman tasks. The production account is |
| 4 | `clover@paperclover.net`; previews use their generated hostname as the account |
| 5 | domain. Each fresh preview has separate accounts, archives, uploads, certificates, |
| 6 | and generated secrets. The DNS provider supplies the existing Cloudflare token |
| 7 | through a protected Nomad input to the certificate task. |
| 8 | |
| 9 | The configuration enables MAM history, message carbons, resumable streams, CSI, |
| 10 | PEP for OMEMO keys, modern bookmarks, private persistent groups with history, |
| 11 | 100 MiB uploads, mobile push extensions, SASL2/FAST, BOSH, WebSocket, and external |
| 12 | STUN/TURN discovery. Encryption of message contents is a client feature; enable |
| 13 | OMEMO in the client. Archives and uploads have no automatic expiry, with a 10 GiB |
| 14 | upload quota. Open account registration is disabled; the administrator can issue |
| 15 | invitations through XMPP ad-hoc commands. |
| 16 | |
| 17 | Native listeners and the UDP relay range have one source in |
| 18 | [`network.json`](../service/xmpp/network.json). Only one XMPP instance can reserve |
| 19 | these host ports; stop its Nomad job before launching another on the same host. |
| 20 | `setup.py` installs a transient firewall service tagged with the preview ID. It |
| 21 | removes its rules within ten seconds of preview destruction, and on service stop. |
| 22 | After a host reboot, repeat the staging command to restore these runtime rules. |
| 23 | Production firewall rules are declared in `nixos/snowglobe.nix`. The DNS provider |
| 24 | provisions client, direct-TLS client, and federation SRV records pointing at |
| 25 | `xmpp.paperclover.net`; the website keeps its existing apex address. Router |
| 26 | forwarding must send the TCP listeners, UDP TURN listeners, and UDP relay range |
| 27 | to Snow Globe. `public-ports.service` refreshes UPnP mappings on startup and every five |
| 28 | minutes, discovering the current description URL with a bounded unicast SSDP |
| 29 | request to the configured gateway on port 1900. Replies and HTTP description |
| 30 | hosts must match that gateway; discovery failure fails the refresh. Multicast |
| 31 | SSDP discovery does not work on this host. Production activation uses the normal |
| 32 | described-main deployment: |
| 33 | |
| 34 | ```sh |
| 35 | SNOWGLOBE_DEPLOY_HOST=root@10.0.0.1 SNOWGLOBE_DEPLOY_PORT=22 python3 tools/deploy.py prod |
| 36 | ``` |
| 37 | |
| 38 | ## Client connections and verification |
| 39 | |
| 40 | The owner-readable connection file on Clover's Mac is |
| 41 | `~/.local/share/snowglobe/xmpp.json`. Monal can use the production JID and its |
| 42 | generated password; the explicit server is `xmpp.paperclover.net`, port `5223`, |
| 43 | with direct TLS. Client and federation SRV records resolve to that server. |
| 44 | A preview has its own connection file and account domain; never copy its |
| 45 | account database into production. |
| 46 | |
| 47 | Test client authentication, two-resource carbons, MAM retrieval, resumable |
| 48 | streams, OMEMO/PEP keys, private group history, uploads, and WebSocket after |
| 49 | changing the service. Calling also requires authenticated TURN, the configured |
| 50 | public relay range, and an off-LAN client check. Push discovery alone does not |
| 51 | prove delivery through an iOS client's push provider. Recheck external |
| 52 | connectivity after router or forwarding changes. |