feat(matrix): Synapse + MAS on jupiter, published by neptun

Homeserver for mgaction.town (@user:mgaction.town). Synapse and the
Matrix Authentication Service share jupiter's postgres; logins are
OIDC-only through Authentik via MAS, since Element X can't use
Synapse's own SSO. neptun serves the apex .well-known delegation plus
matrix. and account. vhosts; the admin API stays tailnet-only.

Synapse's signing key is a sops secret so the federation identity
survives losing the RAID0 array. Covered by checks.matrix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-21 13:04:52 +02:00
co-authored by Claude Opus 5.5
parent 2719ed7707
commit 7a68716c1c
10 changed files with 461 additions and 3 deletions
+15 -1
View File
@@ -13,7 +13,7 @@ Pi 3B+ DNS/DHCP, aarch64), **terra** (desktop), **titan** (Zenbook Pro Duo lapto
flake.nix # nixosConfigurations: real hosts + test/util targets
common.nix # shared base: user darman (key-only ssh), nix settings, firewall :22, tz
services/<cat>/*.nix # one reusable NixOS module per service, grouped by category
# (media, network, vpn, identity, dev, desktop); each opens
# (media, network, vpn, identity, dev, desktop, comms); each opens
# ITS OWN firewall ports. services/containers.nix (podman
# backend) stays at the top level, shared across categories.
hosts/<h>/ # configuration.nix + disk-config.nix (disko) + hardware-configuration.nix + secrets.nix
@@ -98,6 +98,9 @@ nix build .#checks.x86_64-linux.pass-broker -L
# two-node VM test of the gateway on mars with a broker using it: labels,
# cancel, expiry, per-host token isolation, gateway down
nix build .#checks.x86_64-linux.pass-broker-gateway -L
# Synapse + MAS on jupiter behind neptun's caddy: C collation, delegation,
# SSO-only login flows, admin API not public, chat + media upload, restart
nix build .#checks.x86_64-linux.matrix -L
```
`checks.kexec-local` is the only way to exercise `kexec-local` at all: it jumps the
@@ -273,3 +276,14 @@ kept its ssh host key. Run it after ANY change to the kexec paths.
`hyprctl dispatch 'hl.dsp.exit()'`. Test the flow without touching the real greetd by
running greetd's `fakegreet "qs -p …/greeter.qml"` inside a nested Hyprland
(user `user`, password `password`, then answer `9`).
- **Matrix logins go through MAS, not Synapse's `oidc_providers`** (`services/comms/matrix.nix`).
Element X only supports SSO via Matrix Authentication Service, and moving an existing
Synapse onto MAS is a one-way `syn2mas` migration — so it was there from day one. With
MAS enabled Synapse refuses to start if password login, registration or any SSO
section is on. Admin rights come from MAS:
`sudo -u matrix-authentication-service mas manage promote-admin <user>`.
- **Synapse's database needs `LC_COLLATE`/`LC_CTYPE` = C**, which `ensureDatabases`
can't give (cluster default locale) and `initialScript` never runs on jupiter's
existing immich cluster — hence the `\gexec` CREATE DATABASE in `postgresql-setup`'s
`ExecStartPost`. Synapse's signing key is a sops secret, not generated on first
start: it IS the server's federation identity, and the array it would live on is RAID0.