Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/swarm-matrix-ctl
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-27 17:33:06 +01:00
..
src give each appservice test its own scratch directory 2026-10-27 17:33:06 +01:00
Cargo.toml matrix: swarm-controller is the only minter 2026-09-30 00:46:46 +02:00
README.md keep the matrix appservice registration in bao, with the host file as the last copy 2026-10-27 17:33:06 +01:00

swarm-matrix-ctl

The rust that runs inside containers.hive-matrix, beside the homeserver.

One binary with subcommands rather than one binary per job. Running code in that container is not free: it needs its own store identity, its own cert role and its own bind mounts, and every one of those is per-container, not per-task. A second single-purpose crate would have had to duplicate that plumbing to add one action, so the next thing that has to run in here is a verb, not a new crate.

Verbs

appservice render

Renders the swarm appservice registration tuwunel loads from the tokens in the state dir, minting them only on a host that has none. Runs before the homeserver and needs no network: the tokens on disk are the last copy sync took from the store.

appservice sync

The store holds the registration's tokens. This writes them into the state dir when they differ, restarts the homeserver whenever the registration is newer than its last start, and publishes the as_token for swarm-controller. A store holding none is seeded from the state dir, create-only, so nothing rotates. It runs beside the homeserver, so a store outage leaves the homeserver running on the last copy.

Both are configured entirely by the MATRIX_APPSERVICE_* environment the units set — no flags. A systemd Environment= block is what a nix module can render; a command line full of paths is not.

🩸 A secret is a path, never a value

Nothing here logs, prints or interpolates a token. The one identifier this binary logs is the store path it wrote.