Serve installers from the hub; document the private-repo install

The repo is private, so anonymous raw URLs return 404. The hub now serves
/install-probe.sh (and /install.sh) from its own checkout, open even with
UI_PASSWORD, and the Add probe command fetches from there. The installers
still ask for a read-only token to clone. Docs use Gitea's
"Authorization: token" header and give a git-clone fallback for the hub.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
neil 2026-11-04 18:13:19 -08:00
parent 54a765510a
commit efd3836945
10 changed files with 60 additions and 24 deletions

View file

@ -29,3 +29,13 @@ def test_password(hub, monkeypatch):
assert hub.get("/api/info", auth=("admin", "s3cret")).status_code == 200
assert hub.get("/healthz").status_code == 200
assert hub.post("/api/probe/report", json={}).status_code in (401, 422) # token auth, not the password
def test_hub_serves_installers_without_password(hub, monkeypatch):
monkeypatch.setenv("UI_PASSWORD", "s3cret")
r = hub.get("/install-probe.sh")
assert r.status_code == 200 and r.text.startswith("#!/usr/bin/env bash") and "\nNETMON_ROLE=probe\n" in r.text
assert "\nNETMON_ROLE=hub\n" in hub.get("/install.sh").text
assert hub.get("/api/probes").status_code == 401 # the rest stays protected
monkeypatch.delenv("UI_PASSWORD")
assert hub.get("/api/probes").json()["install_url"] == "" # UI builds <hub>/install-probe.sh