Update from a git repository

router.update.repository names a public repository whose tags vX.Y.Z are
releases. router-update check (daily, and from the Updates page) looks for a
newer one and the Overview says so; router-update --git builds the router
from a tag like a bundle update: the settings are migrated, the new version
must be confirmed, the nixpkgs pin stays. The flake of such a router comes
from the release's config-flake.nix. The global flake registry is off.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 08:57:00 +01:00
co-authored by Claude Sonnet 5.5
parent a2dbeb5dea
commit 3fc54e678e
13 changed files with 589 additions and 26 deletions
+11 -1
View File
@@ -251,6 +251,7 @@ func updateProgress(log string) (int, string) {
pct int
what string
}{
{"router-update: fetching", 10, "Fetching the release from the repository"},
{"router-update: verifying", 10, "Verifying the signature"},
{"router-update: importing", 30, "Importing the release"},
{"router-update: installed", 50, "Checking the version"},
@@ -275,6 +276,10 @@ type updateData struct {
Offer *Available
OfferErr string
Pending bool // an update waits for confirmation
Repository string // router.update.repository
Git *GitCheck // what the last look at it found
GitRun UpdateStatus // the look that is running or ran last
}
func (a *app) updateData() updateData {
@@ -284,6 +289,11 @@ func (a *app) updateData() updateData {
Status: a.sys.UpdateStatus(),
URL: a.sys.updateURL(),
Pending: st.RollbackIn > 0,
GitRun: unitRun(gitCheckUnit),
}
if s, err := loadSettings(a.sys.settingsPath()); err == nil {
d.Repository = s.repository()
d.Git = a.gitCheck(d.Repository)
}
d.Progress, d.Step = updateProgress(d.Status.Log)
return d
@@ -303,7 +313,7 @@ func (a *app) updatesData() updatesData {
func (a *app) updatePage(w http.ResponseWriter, r *http.Request, sess session) {
d := a.updatesData()
p := page{Title: "Updates", CSRF: sess.csrf, LoggedIn: true, Data: d, Flash: r.URL.Query().Get("msg")}
if d.Update.Status.Running || d.Upgrade.Run.Running {
if d.Update.Status.Running || d.Upgrade.Run.Running || d.Update.GitRun.Running {
p.Live = 3
}
a.render(w, "update", p)