fix(update): probe the dashboard's real address after a self-update

The watchdog polled http://127.0.0.1:8420/healthz. Nothing binds 8420: the
daemon serves /healthz on [web].listen (127.0.0.1:8484 by default), so every
dashboard- or Telegram-initiated update waited out the 60s health timeout and
rolled back a release that had come up fine.

The daemon is the only process that knows which address it binds, so it now
derives the probe URL from its own config and hands it to the installer;
CommandInstaller exports ARCHIE_HEALTH_URL and the install script forwards it
into the watchdog unit, whose remaining default matches the dashboard's.

The suite never dialled the URL: every watchdog test faked curl as an
immediate failure, so only the unhealthy branch existed. One test now runs
the real curl against a real listener, and another pins the script default.
This commit is contained in:
sam committed 2026-09-09 23:29:11 +10:00
1 parent 694aaeb7cd
commit 2fe708aa64
9 files changed
+212 -7

No files matched your search

+1 -1
View File
@@ -166,7 +166,7 @@ fi
echo "==> handing off to the update watchdog for restart and health verification"
systemd-run --user --unit=archied-update-restart --collect --quiet \
--setenv=ARCHIE_BIN_DIR="$BIN_DIR" \
--setenv=ARCHIE_HEALTH_URL="${ARCHIE_HEALTH_URL:-http://127.0.0.1:8420}" \
--setenv=ARCHIE_HEALTH_URL="${ARCHIE_HEALTH_URL:-}" \
--setenv=ARCHIE_UPDATE_REPORT_PATH="${ARCHIE_UPDATE_REPORT_PATH:-}" \
--setenv=ARCHIE_UPDATE_CHANNEL="${ARCHIE_UPDATE_CHANNEL:-}" \
--setenv=ARCHIE_UPDATE_CHAT_ID="${ARCHIE_UPDATE_CHAT_ID:-0}" \
+5 -1
View File
@@ -12,7 +12,11 @@ AGENT_IMAGE="${ARCHIE_AGENT_IMAGE:-ghcr.io/samcharles93/archie-agent:latest}"
AGENT_IMAGE_BACKUP="${ARCHIE_AGENT_IMAGE_BACKUP:-$BIN_DIR/archie-agent-image.prev.tar}"
TASK_DB_PATH="${ARCHIE_TASK_DB_PATH:-}"
TASK_DB_BACKUP="${ARCHIE_TASK_DB_BACKUP:-$BIN_DIR/archie-task-db.prev.sqlite}"
HEALTH_URL="${ARCHIE_HEALTH_URL:-http://127.0.0.1:8420}"
# The daemon exports its own dashboard address (releaseupdate.CommandInstaller);
# this default only covers a hand-driven run, and must stay the address archied
# serves /healthz on -- config.example.toml's [web] listen.
HEALTH_URL="${ARCHIE_HEALTH_URL:-http://127.0.0.1:8484}"
HEALTH_URL="${HEALTH_URL%/}"
REPORT_PATH="${ARCHIE_UPDATE_REPORT_PATH:-}"
HEALTH_TIMEOUT_SECONDS="${ARCHIE_UPDATE_HEALTH_TIMEOUT:-60}"
POLL_INTERVAL_SECONDS=3