fix agent-logs unit dropdown mismatch, add other hive daemons

Dashboard AGENT log tab sent unit=hive-ag3nt.service (the crate/dir
name) but the actual systemd unit is hive-agent.service, so every
fetch 400'd against the backend allow-list. Fixed the dropdown value
and, per the same issue's request, added the other per-agent daemons
(hive-mcp-http, hive-bash-daemon, hive-matrix-daemon) as selectable
units, plus hive-priv.service on the SYSTEM tab's host-daemon list.
Extended both backend allow-lists (post_journal / post_journal_host)
to match, and fixed a stale systemd.services.hive-ag3nt doc reference
in agent-hierarchy.md that had the same crate/unit-name confusion.
This commit is contained in:
iris 2026-07-15 20:30:23 +02:00 committed by mara
commit a73216e8be
4 changed files with 21 additions and 9 deletions

View file

@ -57,8 +57,14 @@ pub(super) async fn get_journal(
let lines = q.lines.unwrap_or(500).min(5000);
let unit = match q.unit.as_deref().filter(|s| !s.is_empty()) {
Some(u) => {
// accept hive-agent[.service] — anything else refused.
let allowed = ["hive-agent.service"];
// accept any of the per-container hive daemons [.service] —
// anything else refused.
let allowed = [
"hive-agent.service",
"hive-mcp-http.service",
"hive-bash-daemon.service",
"hive-matrix-daemon.service",
];
let unit = if u.ends_with(".service") {
u.to_owned()
} else {
@ -115,7 +121,7 @@ pub(super) async fn get_journal_host(
axum::extract::Query(q): axum::extract::Query<JournalHostQuery>,
) -> Result<Response, ProblemDetails> {
let lines = q.lines.unwrap_or(500).min(5000);
let allowed = ["hive-c0re.service"];
let allowed = ["hive-c0re.service", "hive-priv.service"];
let mut cmd = tokio::process::Command::new("journalctl");
cmd.args(["--no-pager", "--output=short-iso", "--lines"])
.arg(lines.to_string());