hyperhive/nix/host-modules
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas 3fc1588e83 fix: declare the agent socket dir's owner in tmpfiles, not by chown after
/run/hive-agent/<name> was 0777 root root in steady state, not just during
first spawn. A directory without the sticky bit lets any user unlink files
in it, and the gateway container has all of /run/hive-agent bind-mounted
in, so anything that could reach the path could delete an agent's
agent.sock, bind its own, and receive that agent's todos from hive-c0re.

Two mechanisms were writing the dir and undoing each other: the tmpfiles.d
entry wrote 0777 root root, then hive-c0re round-tripped through hive-priv's
ChownSocketDir to narrow it. `d` re-asserts mode and owner on every apply
and the file is regenerated on any agent's spawn or destroy, so every such
event reset every agent's dir back to world-writable.

SyncAgentTmpfiles now carries each agent's container uid/gid and the entry
declares the answer: 0751 <uid> <gid>. Three principals need the dir and no
two share a group -- the harness binds its sockets (owner rwx), hive-c0re
dials agent.sock and the gateway's nginx dials web.sock (both only need
traverse, and both sockets are already 0666).

Deletes ChownSocketDir and ChmodSocketDir, both priv_client wrappers, the
either/or in host_config with its two swallowed warn!s, and the now-dead
socket_dir_path -- two verbs off the privileged helper's surface and one
round-trip off every agent spawn.

Also makes the two tmpfiles rules for /run/hive-agent itself agree: the
gateway module said hive-core, the generated file said root, and which won
depended on the order systemd read them in.
2026-08-04 01:00:48 +02:00
..
hive-c0re wip(#2860): c0re-facing matrix.apiUrl option + HIVE_MATRIX_API_URL export 2026-08-03 20:34:36 +02:00
hive-forge dashboard: hide forge links instead of guessing <hostname>:3000 2026-08-03 01:21:11 +02:00
hive-gateway fix: declare the agent socket dir's owner in tmpfiles, not by chown after 2026-08-04 01:00:48 +02:00
lib refactor(#2427): extract shared hive-CA trust bind-mount helper 2026-07-15 20:12:52 +02:00
default.nix refactor(#2862): swarm- prefix for the snapshot store 2026-07-31 19:03:24 +02:00
hive-ci.nix fix(#2673): set nix fallback in agent + CI containers 2026-07-25 19:36:31 +02:00
hive-matrix.nix wip(#2860): c0re-facing matrix.apiUrl option + HIVE_MATRIX_API_URL export 2026-08-03 20:34:36 +02:00
hive-network.nix feat: hive DNS always follows the host resolver 2026-07-13 22:09:53 +02:00
hive-priv.nix fix(#2573): also add /etc/tmpfiles.d to hive-priv ReadWritePaths (same EROFS class) 2026-07-18 16:39:20 +02:00
hive-tls.nix docs: sweep archaeology comments to present state 2026-07-13 22:16:02 +02:00
hyperhive.nix refactor(#2464): rename hive-ag3nt crate to hive-agent, collapse lib into main 2026-07-15 16:09:39 +02:00
otel.nix refactor: nix/host-modules + nix/agent-modules layout, update doc paths 2026-07-13 22:05:49 +02:00
swarm-snapshot-store.nix refactor(#2862): keep the option at services.hyperhive.snapshotStore 2026-07-31 19:03:24 +02:00
swarm-wireguard.nix refactor(#2862): split the wireguard mesh out of swarm.nix 2026-07-31 19:03:24 +02:00
swarm.nix refactor(#2862): one snapshot store per swarm, not one per peer 2026-07-31 22:15:37 +02:00