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
+5 -1
View File
@@ -341,6 +341,9 @@ func (a *app) routes() http.Handler {
mux.HandleFunc("POST /update/url", a.auth(a.updateSaveURL))
mux.HandleFunc("POST /update/check", a.auth(a.updateCheck))
mux.HandleFunc("POST /update/install", a.auth(a.updateInstall))
mux.HandleFunc("POST /update/repository", a.auth(a.updateSaveRepository))
mux.HandleFunc("POST /update/gitcheck", a.auth(a.updateGitCheck))
mux.HandleFunc("POST /update/gitinstall", a.auth(a.updateGitInstall))
mux.HandleFunc("POST /update/upload", a.updateUpload)
mux.HandleFunc("GET /upgrade", a.auth(upgradeRedirect))
mux.HandleFunc("POST /upgrade/channel", a.auth(a.upgradeChannel))
@@ -491,12 +494,13 @@ type overviewData struct {
Status Status
Dashboard dashboard
NewRelease string // a stable NixOS release newer than the followed channel exists
NewRouter string // a release of nixos-router is out in the repository
}
func (a *app) overview(w http.ResponseWriter, r *http.Request, sess session) {
st := a.sys.Status()
p := page{Title: "Overview", CSRF: sess.csrf, LoggedIn: true, Flash: r.URL.Query().Get("msg"),
Data: overviewData{Status: st, Dashboard: a.dashboardData(r.URL.Query().Get("range")), NewRelease: a.releaseNotice()}}
Data: overviewData{Status: st, Dashboard: a.dashboardData(r.URL.Query().Get("range")), NewRelease: a.releaseNotice(), NewRouter: a.newRouterVersion()}}
switch {
case st.Applying || st.ConfirmRunning:
p.Live = 2