An updater: what is published on Gitea, and installing it from Settings

A new selfupdate package asks one URL what the newest build is — a Gitea/Forgejo repo
API base, or any directory holding VERSION, SHA256SUMS and hamlab-linux-<arch>, which is
what make release already writes and what install.sh already downloads. The binary is
checked against SHA256SUMS before it goes near the running one, and a token is sent when
the source is behind a login, so a private Gitea serves its own fleet without opening the
instance to everyone. Version ordering is install.sh's vnum rule, so the daemon and the
installer never disagree about which build is newer.

Settings gains an Updates card: installed, published, when it last looked, the source,
release notes, Check for updates, and Install. The rail badges Settings when a newer
build is out. Nothing installs unasked — it restarts the daemon and drops terminals.

scripts/gitea-release.sh (make gitea-release) publishes dist/ as a Gitea release.
Deliberate, and not part of deploy: deploy pushes to the machines this hub owns,
publishing offers the build to every install anywhere.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Mitchell-Johnson
2026-09-23 14:31:32 -07:00
co-authored by Claude Opus 5
parent 98a8de8091
commit 68bf3bb218
10 changed files with 876 additions and 36 deletions
+7 -1
View File
@@ -10,7 +10,7 @@ LDFLAGS = -s -w -X main.version=$(VERSION)
# static, no cgo: the same file runs on glibc, musl (Alpine) and anything else with a Linux kernel
GOBUILD = CGO_ENABLED=0 GOOS=linux GOARM=6 $(GO) build -trimpath -ldflags "$(LDFLAGS)"
.PHONY: all web build go dev cross release publish deploy push-nodes push-nodes-force test clean
.PHONY: all web build go dev cross release publish gitea-release deploy push-nodes push-nodes-force test clean
all: build
@@ -52,6 +52,12 @@ test:
cd web && npm test --silent
# installs here (keeping the config, user and password), then updates every managed machine
# Offer this build to every install, wherever it is: a release on Gitea, which is what
# Settings -> Updates reads. Deliberate, and not part of deploy — deploy pushes to the
# machines this hub owns, publishing offers it to everyone else.
gitea-release: release
./scripts/gitea-release.sh $(RELEASE_ARGS)
deploy: build cross
./bin/hamlab install --prefix $(PREFIX)
@sleep 1; $(PREFIX)/hamlab push-nodes || true