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
+35
View File
@@ -38,6 +38,41 @@
</dl>
</section>
<section>
<h2>Releases from git</h2>
<p>The router looks once a day at the release tags (<code>vX.Y.Z</code>) of a public repository and says here and on the
Overview when a newer one exists. Installing builds it on the router, like a bundle: the settings are kept (and
migrated), and the new version must be confirmed afterwards, or the router goes back. The repository is trusted
as it is: nothing is signed on this path.</p>
<form method="post" action="/update/repository" class="actions">
<input type="hidden" name="csrf" value="{{.CSRF}}">
<label>Repository <input name="repository" value="{{$u.Repository}}" size="44" placeholder="https://git.example.org/me/nixos-router"></label>
<button class="secondary">Save</button>
</form>
{{if $u.Repository}}
<form method="post" action="/update/gitcheck" class="actions">
<input type="hidden" name="csrf" value="{{.CSRF}}">
<button class="secondary"{{if $u.GitRun.Running}} disabled{{end}}>{{if $u.GitRun.Running}}Looking…{{else}}Look for a newer release{{end}}</button>
</form>
{{if and $u.GitRun.Result (ne $u.GitRun.Result "success")}}<p class="error">The last look failed:</p><pre class="log">{{$u.GitRun.Log}}</pre>{{end}}
{{with $u.Git}}
<dl>
<dt>Installed</dt><dd>{{.Installed}}</dd>
<dt>Newest</dt><dd>{{.Newest.Version}} <span class="muted">{{printf "%.7s" .Newest.Rev}}, looked {{.Time}}</span></dd>
</dl>
<form method="post" action="/update/gitinstall">
<input type="hidden" name="csrf" value="{{$.CSRF}}">
<input type="hidden" name="tag" value="{{.Newest.Tag}}">
{{if .Newer}}<p>A newer release is available.</p>
{{else}}<p>Up to date.</p><p><label><input type="checkbox" name="force"> install it anyway</label></p>{{end}}
<button{{if $u.Pending}} disabled{{end}}>{{if .Newer}}Install {{.Newest.Version}}{{else}}Install {{.Newest.Version}} again{{end}}</button>
</form>
{{else}}
<p class="hint">Not looked yet.</p>
{{end}}
{{end}}
</section>
<section>
<h2>Install a bundle</h2>
<p>A <code>.bundle</code> file made with <code>nix run .#release</code>. It is installed only if it is signed with