feat!: Urutau 2.0.0, ultralight probes and a single analysis hub
CI / Format and vet (pull_request) Failing after 53s
CI / Dependency audit (pull_request) Successful in 33s
CI / Tests (Linux, race detector) (pull_request) Successful in 2m1s
CI / Docker images (build and smoke test) (pull_request) Failing after 47s

Each server runs an ultralight probe (scratch image, ~7 MiB RSS) that
tails the logs, ships raw lines to the hub over HTTPS with an on-disk
spool, and applies enforce decisions locally. The hub keeps one node per
probe (primary node = the 1.x data dir, unchanged), does all analysis and
serves the UI. Peer federation is removed. 'urutau import' brings 1.x
data dirs in with hash and count verification. UI: probes page, host
qualified incidents, IPs never wrap, egress heatmap labels, live and
replay globes no longer auto-rotate, replay repeat, live traffic metrics.

BREAKING CHANGE: URUTAU_PEERS, URUTAU_PEER_* and /api/v1/peer/* are gone;
log path variables move from the hub to the probe. See docs/migration-2.0.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lucas RayanandClaude Opus 5.5 committed 2026-11-15 22:14:50 -03:00
1 parent 23a7a5963a
commit 8546d14cef
130 files changed
+9396 -3311

No files matched your search

+10 -10
View File
@@ -1,8 +1,9 @@
#!/usr/bin/env bash
# Smoke-tests an Urutau image: the HEALTHCHECK command works, the API is closed
# without a token and open with it, the peer token only opens the export, the
# dashboard is served, urutau doctor reports a version, the daemon is not root
# and SIGTERM stops it cleanly with exit 0.
# Smoke-tests an Urutau hub image: the HEALTHCHECK command works, the API is
# closed without a token and open with it, the removed 1.x federation routes
# answer 404 and the removed variables stop the start, the dashboard is served,
# urutau doctor reports a version, the daemon is not root and SIGTERM stops it
# cleanly with exit 0. (The probe image has its own script: smoke-probe.sh.)
# The image has no curl: HTTP checks use the BusyBox wget that Alpine ships.
# Everything runs through `docker exec`, so no port has to be reachable from the
# CI job container. The container is always removed.
@@ -13,7 +14,6 @@ set -euo pipefail
image=${1:?usage: smoke-image.sh <image-ref>}
name="urutau-smoke-$$-$RANDOM"
token=$(head -c 40 /dev/urandom | base64 | tr -d '=+/\n')
peer=$(head -c 40 /dev/urandom | base64 | tr -d '=+/\n')
trap 'docker rm -f "$name" >/dev/null 2>&1 || true' EXIT
fail() { echo "smoke: $*" >&2; docker logs "$name" >&2 2>&1 || true; exit 1; }
base=http://127.0.0.1:8790
@@ -26,7 +26,7 @@ get() { local url=$1; shift; docker exec "$name" wget -q -O - "$@" "$url"; }
# No log files are mounted: the sources wait for them. docker create + start
# instead of a bind mount, which the daemon may not see from a CI job.
docker create --name "$name" -e URUTAU_TOKEN="$token" -e URUTAU_PEER_TOKEN="$peer" -e URUTAU_GEO_UPDATE=0 "$image" >/dev/null
docker create --name "$name" -e URUTAU_TOKEN="$token" -e URUTAU_GEO_UPDATE=0 "$image" >/dev/null
docker start "$name" >/dev/null
for _ in $(seq 1 30); do
docker exec "$name" urutau healthcheck >/dev/null 2>&1 && break
@@ -37,12 +37,9 @@ out=$(get "$base/api/health") || fail "/api/health did not answer"
grep -q '"status":"ok"' <<<"$out" || fail "/api/health is not ok"
grep -q '"version"' <<<"$out" && fail "/api/health must not expose the version"
[ "$(status "$base/api/v1/summary")" = 401 ] || fail "/api/v1/summary without a token must answer 401"
[ "$(status "$base/api/v1/summary" --header "Authorization: Bearer $peer")" = 403 ] || fail "the peer token on /api/v1/summary must answer 403"
out=$(get "$base/api/v1/summary" --header "Authorization: Bearer $token") || fail "authenticated summary failed"
grep -q '"totals"' <<<"$out" || fail "summary has no totals"
out=$(get "$base/api/v1/peer/export?range=1h" --header "Authorization: Bearer $peer") || fail "peer export failed"
grep -q '"summary"' <<<"$out" || fail "peer export has no summary"
[ "$(status "$base/api/v1/peer/export" --header "Authorization: Bearer $token")" = 401 ] || fail "the user token must not open the peer export"
[ "$(status "$base/api/v1/peer/export" --header "Authorization: Bearer $token")" = 404 ] || fail "the 1.x peer export must be gone (404)"
out=$(get "$base/login") || fail "login page did not answer"
grep -qi '<!doctype html' <<<"$out" || fail "login page is not served"
out=$(get "$base/" --header "Authorization: Bearer $token") || fail "dashboard did not answer"
@@ -52,6 +49,9 @@ grep -q '"version"' <<<"$out" || fail "urutau doctor --json has no version"
[ "$(docker inspect -f '{{if .Config.Healthcheck}}yes{{end}}' "$name")" = yes ] || fail "image has no HEALTHCHECK"
[ "$(docker exec "$name" id -u)" != 0 ] || fail "daemon runs as root"
docker exec "$name" sh -c 'command -v curl' >/dev/null 2>&1 && fail "the image must not ship curl"
# 2.0 removed the federation: its variables stop the hub with a pointer to the guide.
out=$(docker run --rm -e URUTAU_TOKEN="$token" -e URUTAU_PEERS=old=https://example.org "$image" 2>&1) && fail "URUTAU_PEERS must stop the hub"
grep -q 'migration-2.0' <<<"$out" || fail "the URUTAU_PEERS error must point to docs/migration-2.0.md"
docker stop -t 10 "$name" >/dev/null
code=$(docker inspect -f '{{.State.ExitCode}}' "$name")
[ "$code" = 0 ] || fail "exit code $code after SIGTERM (expected 0: SIGTERM must stop serve)"