Watch
0
0
Fork
You've already forked hyperhive
0

also stop provisioning the hive space and make hivectl matrix invite take a room

This commit is contained in:
damocles 2026-10-28 20:57:41 +01:00
commit fd01848d4d

View file

@ -96,8 +96,7 @@ and federation peers all reach the homeserver at `chat.<swarm-domain>`
through the gateway; from outside the host that takes
`gateway.openFirewall`.
hive-c0re provisions matrix (its own sender login, the hive Space and
invites) through `swarm.matrix.apiUrl`, which defaults to
hive-c0re talks to matrix (its own sender login, invites) through `swarm.matrix.apiUrl`, which defaults to
`https://<swarm.matrix.gatewayHost>` on every hive. That login carries
the hive's matrix access token, and on a hive that doesn't run the
homeserver it crosses the network, so the default is TLS; hive-c0re
@ -258,9 +257,8 @@ token and gets a refusal on any other hive's. The name says what it
authenticates as — an account the swarm's appservice creates — rather
than any privilege level, because it carries none.
It needs no promotion for what the hive does with it. Creating the hive
Space and inviting agents into it are ordinary client calls that ride on
being the Space's own creator at power level 100 — there is no homeserver
It needs no promotion for what the hive does with it. Inviting a user into a
room it has the power in is an ordinary client call — there is no homeserver
admin in any of it, and no Synapse admin API to reach for either, since
tuwunel has none.
@ -346,27 +344,17 @@ Initial rollout settings:
stored yet the account comes up without backup and picks it up on the
next daemon start. A failure is a `WARN` and never stops the daemon.
## Hive Matrix Space
## Hive sender token
On first boot hive-c0re creates a private **Matrix Space** named `"hive"` using its own hive
account (`@hive-<hive>:<server_name>`) and invites every provisioned agent
into it. This gives the operator a single Space in FluffyChat or any
Matrix client that groups all agent-to-agent + operator rooms in one
place.
hive-c0re keeps the hive's `@hive-<hive>:` sender token on disk for
`hivectl matrix invite`, refreshed from the swarm secret store by the
matrix sweep (at boot, then every 30 minutes).
**State**: hive-c0re persists the Space's room ID to
`/var/lib/hyperhive/matrix/space-room-id` (mode `0600`, owned by the
hive-c0re service user). The path is **outside** every agent state dir and
**isn't** deleted by `nixos-container destroy --purge`, so it survives full
agent purges, and hive-c0re reuses it on re-provision.
An earlier version also provisioned a `hive-chat` room and kept its id in
`chat-room-id`. The sweep no longer touches either; an existing room and
file are harmless leftovers, so delete them by hand if you like.
**Idempotent**: if the file exists and is non-empty, hive-c0re considers the
Space already created. Delete the file to force re-creation (for example
after a homeserver wipe).
Earlier versions also created a private "hive" Matrix Space and a
`hive-chat` room, invited every agent to both, and kept their ids in
`/var/lib/hyperhive/matrix/space-room-id` and `chat-room-id`. The sweep no
longer touches any of them. The rooms and files are harmless leftovers, so
delete them by hand if you like.
## Configuration tuning