feat(#2415): hive-priv RegisterCiRunner primitive + c0re client

Part A of moving hive-ci runner registration off the boot-critical path.
Adds a root-side hive-priv op that writes the runner registration token to
the host env-file /run/hive-ci/runner-token (in-place, preserving the inode
the container bind-mounts) and restarts the in-container gitea-runner-hive
unit. The forge admin token stays in hive-c0re; only the registration token
reaches the host env-file the container mounts read-only. The c0re-side
caller (ensure_ci_runner_registered) + the nix boot-path change land next on
this branch.
This commit is contained in:
atlas 2026-07-16 10:48:41 +02:00 committed by mara
commit 858475549a
3 changed files with 68 additions and 0 deletions

View file

@ -322,6 +322,18 @@ pub async fn restart_matrix_daemon(agent_name: &str) -> Result<()> {
.await?)
}
/// Register the hive-ci Forgejo Actions runner: hand the freshly-minted
/// registration token to hive-priv, which writes it to the host-side
/// `/run/hive-ci/runner-token` env-file and restarts the in-container runner.
/// The forge admin token stays in hive-c0re; only the registration token
/// crosses to the (host-path) env-file the container bind-mounts read-only.
pub async fn register_ci_runner(token: &str) -> Result<()> {
ok(call(&PrivRequest::RegisterCiRunner {
token: token.to_owned(),
})
.await?)
}
/// Restart a hive infrastructure container on the host (thin wrapper over
/// [`control_infra_container`] with `action = Restart`). hive-priv
/// re-validates `container` against its root-side allowlist; callers must