hyperhive/hive-c0re/src/workers
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas 79a29873e3 fix(#2164): domain-URL webhooks + HMAC + config-PR polling fallback
Both webhook registrations (knowledge push + config-PR pull_request) now
use the public hive domain instead of loopback:
  https://<HYPERHIVE_HIVE_DOMAIN>/webhook/{knowledge,config-pr}

This routes deliveries through the gateway, bypassing the Forgejo SSRF
guard that blocked loopback delivery and silently broke the config-PR
merge flow since launch.

Changes:
- webhook_secret: new module — auto-generate + persist a 32-byte HMAC
  secret to STATE_ROOT/webhook-secret on first startup; verify
  X-Hub-Signature-256 on every incoming webhook POST (HMAC-SHA256).
- forge/mod.rs: ensure_config_pr_webhook now takes hive_domain +
  webhook_secret; sets secret in Forgejo hook config.
- workers/knowledge.rs: ensure_webhook same update.
- dashboard/webhook.rs: both handlers read raw Bytes first, verify HMAC,
  then parse JSON. Returns 401 on signature mismatch.
- dashboard/mod.rs: AppState carries webhook_secret; serve() takes it.
- main.rs: load/generate secret at startup; pass to registration tasks
  + dashboard; add 5-minute config-PR polling fallback task.
- forge/config_pr_poll.rs: new — scan agent-configs/* for open PRs with
  no pending MergeConfigPr approval; queue them. Idempotent.
- stores/approvals.rs: has_pending_merge_config_pr() for poll dedup.
- nix/modules/hive-gateway.nix: remove dashboardAuth from /webhook/
  location (HMAC replaces basic auth for webhook endpoints; Forgejo
  cannot send HTTP Basic credentials with webhook deliveries).
2026-07-11 23:28:16 +02:00
..
agent_sockets.rs refactor(#2285): repoint all hive-c0re host-path consumers to paths.rs 2026-07-10 20:32:03 +02:00
auto_update.rs refactor(#2285): inline remaining 1:1 path wrappers (meta_dir, marker fns, host_conf_path) 2026-07-10 20:32:03 +02:00
crash_watch.rs refactor(hive-c0re): group src-root files into submodules 2026-07-06 22:38:47 +02:00
knowledge.rs fix(#2164): domain-URL webhooks + HMAC + config-PR polling fallback 2026-07-11 23:28:16 +02:00
mcp_sockets.rs refactor(#2290): replace mcp_sockets poll with event-driven register_agent 2026-07-09 01:08:38 +02:00
mod.rs feat(#2290): split ensure_runtime — dirs to lifecycle, listeners to mcp_sockets supervisor 2026-07-09 00:58:51 +02:00
reminder_scheduler.rs refactor(hive-c0re): group src-root files into submodules 2026-07-06 22:38:47 +02:00
scheduled_prompts_worker.rs refactor(hive-c0re): group src-root files into submodules 2026-07-06 22:38:47 +02:00