gokrazy, clientupdate: add start of Gokrazy auto-updates, tests

This adds support for Gokrazy GAF (Gokrazy Archive Format) zip
auto-updates, starting to wire up Tailscale's clientupdate mechanism
to Gokrazy's update mechanism.

Currently there's just a CLI command to update from a GAF URL,
with an --unsigned flag for use in a new natlab vmtest.

Next step would be publishing unstable track GAF files on
pkgs.tailscale.com, with detached signatures, and then making the
clientupdate mechanism also download those and check signatures.

Updates #20002

Change-Id: Ib03c56f17a57f8a4638398ef83549dac4813323d
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2026-06-04 11:20:14 -07:00
committed by Brad Fitzpatrick
parent 6ff761c5f8
commit 772be1b0cc
15 changed files with 474 additions and 22 deletions
+18
View File
@@ -213,6 +213,24 @@ func main() {
}
serveCmd(w, "tailscale", args...)
})
ttaMux.HandleFunc("/tailscale", func(w http.ResponseWriter, r *http.Request) {
serveCmd(w, "tailscale", r.URL.Query()["arg"]...)
})
ttaMux.HandleFunc("/gokrazy-root", func(w http.ResponseWriter, r *http.Request) {
cmdLine, err := os.ReadFile("/proc/cmdline")
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
for s := range strings.FieldsSeq(string(cmdLine)) {
if root, ok := strings.CutPrefix(s, "root="); ok {
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
io.WriteString(w, root+"\n")
return
}
}
http.Error(w, "no root= in /proc/cmdline", http.StatusInternalServerError)
})
ttaMux.HandleFunc("/ip", func(w http.ResponseWriter, r *http.Request) {
conn, ok := r.Context().Value(connContextKey).(net.Conn)
if !ok {