Commit graph

1,251 commits

Author SHA1 Message Date
damocles
68cc433ac9 fix(#977): add MANAGER_CONTAINER=h-root, migrate root container name 2026-06-01 18:32:19 +02:00
atlas
286a7c8fd3 fix(#975): use hyperhive.local email domain to pass Forgejo validation
`@hyperhive` (no dot) is rejected by Forgejo's PATCH /admin/users API
with 422 Unprocessable Entity. Switch to `@hyperhive.local` across all
four files that construct hive-c0re/agent git emails and Forgejo account
emails, so both stay in sync and pass RFC-valid domain validation.
2026-06-01 18:28:22 +02:00
damocles
b83edc40c6 fix(#970,#973): retry gateway reload on failure; always enable HIVE_WEB_SOCKET 2026-06-01 18:18:45 +02:00
atlas
5cf18ad7c7 fix(#971): remove duplicate BindMount re-export in priv_client
BindMount was imported at line 10 via the priv_proto glob-style import,
then re-exported again with `pub use` at line 69. E0252: two definitions
of BindMount in the same type namespace. Remove the redundant pub use —
callers that need BindMount should import from hive_sh4re::priv_proto.
2026-06-01 18:05:43 +02:00
damocles
9a7c917f36 rename(#162): fix MANAGER_AGENT and @manager in docs 2026-06-01 17:58:09 +02:00
atlas
2d754eceea fix: add listenfd to Cargo.lock
listenfd was declared as a direct dep in hive-c0re/Cargo.toml but was
never resolved into Cargo.lock. The nix crane build vendors deps from
the lock, so the missing entry caused a build failure.
2026-06-01 17:55:40 +02:00
iris
f39015e41d fix(961): remove stale manager/hm1nd references from dashboard tabs.js
Three post-rename artifacts:

1. journalUnit: was 'hive-m1nd.service' for the manager branch.
   Both roles use 'hive-ag3nt.service' since the harness unification —
   always use 'hive-ag3nt.service'.

2. buildTargetChips: hardcoded ['operator', 'manager'] candidates +
   filter by n !== 'manager'. After the rename the manager's c.name
   is 'root', so it was excluded from the filter but not from the
   hardcoded initial list — the manager could appear twice or be listed
   as 'manager' when its real broker name is 'root'. Fix: derive
   the manager's name from c.is_manager on containersState; filter
   sub-agents by !c.is_manager rather than by hardcoded string.

3. schedulesTableAgentSet: same hardcoded 'manager' + filter pattern
   as buildTargetChips. Same fix applied.
2026-06-01 17:55:15 +02:00
damocles
68fd7e08a5 fix(#948): pre-enqueue topology-sorted cascades on meta-update approval 2026-06-01 17:55:01 +02:00
damocles
11d74e1e17 fix(#947): include manager in gateway agents.conf routing 2026-06-01 17:46:10 +02:00
damocles
aa96d76e73 build-logs: extract compute_runtime_secs helper; clamp runtime in js 2026-06-01 17:42:35 +02:00
damocles
008609d0e7 rename(162): drop HIVE_PORT fallback; sweep remaining hm1nd in docs 2026-06-01 17:40:47 +02:00
damocles
26c9c13cf5 build-logs: surface runtime_secs in header; show duration in dashboard row 2026-06-01 17:36:29 +02:00
iris
e99330ef0f docs(gateway): document per-agent static frontend split mode 2026-06-01 17:35:28 +02:00
iris
e162c1a1fa feat(#955): split agent page serving — statics from nix store, API proxied
gateway_nginx.rs reads HIVE_AGENT_FRONTEND_DIR (injected by hive-c0re.nix
as ${cfg.frontend}/agent). When set, agents.conf emits per-agent split
blocks instead of the old single proxy_pass:

  # Compiled assets — immutable nix store path, cache 1y
  location ^~ /agent/<name>/static/ {
      alias <frontend>/static/;
      expires 1y; add_header Cache-Control "public, immutable, ...";
  }
  # Static dist + proxy fallback
  location /agent/<name>/ {
      alias <frontend>/;
      try_files $uri $uri.html $uri/index.html @<name>_dynamic;
  }
  location @<name>_dynamic {
      proxy_pass <upstream>;   # api, events, icon, login, …
      …proxy headers unchanged…
  }

try_files path resolution (nginx applies alias mapping first):
  $uri           — exact file (/static/app.js → static/app.js)
  $uri.html      — bare-path fallback (/stats → stats.html)
  $uri/index.html — directory index (/ → index.html)
  @<name>_dynamic — proxy catchall for anything not in the dist

Adding pages to the frontend dist works automatically — no generator
change needed. Per-agent extraFiles (in mergedDist, not in the base
nix-store path) continue to proxy to the agent daemon.

frontend is a nix store path injected at build time — only [a-z0-9/._-],
no shell metacharacters — safe to interpolate without sanitization;
comment added documenting this assumption.

Without HIVE_AGENT_FRONTEND_DIR the existing single-proxy block is
emitted unchanged — backward-compatible for deployments without the env.

render() takes frontend_dir as a parameter so tests exercise both code
paths safely in parallel. 13 tests: 7 legacy, 6 split-mode. No clippy
warnings in changed files.

nix/modules/hive-c0re.nix: inject HIVE_AGENT_FRONTEND_DIR = "${cfg.frontend}/agent".
2026-06-01 17:35:28 +02:00
atlas
84f5c2722e nix(#702): add hive-priv systemd socket + service units
Nix side of the hive-priv phase 1 work. hive-priv is socket-activated
exclusively: systemd holds /run/hive/priv.sock (mode 0660) and starts
the service on first connection. LISTEN_FDS + LISTEN_PID are passed;
hive-priv reads them in socket_listener() to accept the pre-bound fd.

Phase 2 note (comment in file): when hive-c0re drops to a non-root
user, add SocketGroup = hive-core to the socket unit so the
unprivileged caller can still connect. No code change needed in
hive-priv itself.
2026-06-01 17:33:32 +02:00
damocles
e7e0675d22 rename: role badge stays 'manager'; unify harness unit name to hive-ag3nt 2026-06-01 17:33:09 +02:00
damocles
77622c0585 rename(162): update manager recipient to root in system.md 2026-06-01 17:33:09 +02:00
damocles
829cea1a26 rename(162): nixosConfigurations/modules manager -> root, update package name 2026-06-01 17:33:09 +02:00
damocles
1d0d52b85f rename(162): update manager.nix comments for root 2026-06-01 17:33:09 +02:00
damocles
7772e29ec2 rename(162): hive-m1nd -> hive-root, HIVE_LABEL/PORT for root 2026-06-01 17:33:09 +02:00
damocles
1b4e9d0e2b rename(162): nixosConfigurations.manager -> root, hive-m1nd -> hive-root 2026-06-01 17:33:09 +02:00
damocles
9654315a20 rename(162): update manager test to use root 2026-06-01 17:33:09 +02:00
damocles
935f2011a0 rename(162): update hm1nd comment in ensure_manager 2026-06-01 17:33:09 +02:00
damocles
4c2398a38e rename(162): role badge manager -> root, update hm1nd comment 2026-06-01 17:33:09 +02:00
damocles
6ff2103a22 rename(162): MANAGER_AGENT manager -> root 2026-06-01 17:33:09 +02:00
damocles
37b5335c27 rename(162): MANAGER_NAME hm1nd -> root 2026-06-01 17:33:09 +02:00
damocles
0b5376249d priv: reject colons in bind paths to avoid nspawn delimiter confusion 2026-06-01 17:27:14 +02:00
damocles
c9eb520e7c priv: WriteNspawnFlags takes Vec<BindMount> instead of raw flag strings 2026-06-01 17:27:14 +02:00
damocles
a922376778 priv: reject double-quotes in nspawn flag entries 2026-06-01 17:27:14 +02:00
damocles
aa7f8e5553 priv: move shared consts to hive-sh4re; WriteNspawnFlags uses Vec<String> + per-flag validation 2026-06-01 17:27:14 +02:00
damocles
89d0937473 priv: derive flake ref from agent name; WriteNspawnFlags takes flags only 2026-06-01 17:27:14 +02:00
damocles
8d5e97ce9f fix(702): update priv_client to match narrowed PrivRequest variants 2026-06-01 17:27:14 +02:00
damocles
ec12ba4b1a fix(702): narrow all PrivRequest handlers to specific ops 2026-06-01 17:27:14 +02:00
damocles
af23047970 fix(702): replace generic variants with specific ops in PrivRequest 2026-06-01 17:27:14 +02:00
damocles
29926031ae fix(702): replace systemd_run_machine with reload_gateway_nginx in priv_client 2026-06-01 17:27:14 +02:00
damocles
efedfc3ea6 fix(702): narrow SystemdRunMachine to ReloadGatewayNginx in hive-priv 2026-06-01 17:27:14 +02:00
damocles
10871381f3 fix(702): replace SystemdRunMachine with specific ReloadGatewayNginx 2026-06-01 17:27:14 +02:00
damocles
c5cab732a2 feat(#702): priv_client - async client for hive-priv 2026-06-01 17:27:14 +02:00
damocles
c8ea28b218 feat(#702): PrivRequest/PrivResponse wire types 2026-06-01 17:27:14 +02:00
damocles
ab861dd8dc feat(#702): hive-priv privileged helper binary 2026-06-01 17:27:14 +02:00
damocles
b18bdbca1c feat(#702): add hive-priv crate 2026-06-01 17:27:14 +02:00
damocles
138d9fdabe feat(#702): add priv_client module to hive-c0re 2026-06-01 17:27:14 +02:00
damocles
d7fa1c5a6e feat(#702): add priv_proto module to hive-sh4re 2026-06-01 17:27:14 +02:00
damocles
6a371908e4 feat(#702): add hive-priv to workspace members 2026-06-01 17:27:14 +02:00
damocles
e8b24e7021 fix(948): topo-sort cascade agents in meta_update_cascade_agents 2026-06-01 16:50:41 +02:00
damocles
5dc31c1e13 fix(948): make topology_sort pub 2026-06-01 16:50:40 +02:00
damocles
eb108f9dd8 fix(947): trim prose in lifecycle.rs socket-dir block 2026-06-01 16:49:41 +02:00
damocles
2f25131403 fix(947): strip prose/issue-tags from harness-base.nix 2026-06-01 16:49:41 +02:00
damocles
e7a5718e83 fix(947): strip prose/issue-tags from agent_sockets.rs 2026-06-01 16:49:41 +02:00
damocles
7af29b3249 fix(#947): extend socket-dir bind to manager container 2026-06-01 16:49:41 +02:00