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:
committed by
Brad Fitzpatrick
parent
6ff761c5f8
commit
772be1b0cc
@@ -11,6 +11,7 @@ import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"compress/gzip"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
@@ -37,6 +38,24 @@ import (
|
||||
"tailscale.com/version/distro"
|
||||
)
|
||||
|
||||
// GokrazyUpdateArgs contains arguments for updating a Gokrazy appliance from a
|
||||
// GAF fetched from a URL.
|
||||
type GokrazyUpdateArgs struct {
|
||||
// URL is the GAF download URL.
|
||||
URL string
|
||||
|
||||
// AllowUnsigned permits installing a GAF without signature verification.
|
||||
// This is intended for tests until signed GAF verification is implemented.
|
||||
AllowUnsigned bool
|
||||
|
||||
// Logf is optional; nil discards log messages.
|
||||
Logf logger.Logf
|
||||
}
|
||||
|
||||
// GokrazyUpdateFromURL updates a Gokrazy appliance from a GAF fetched from a
|
||||
// URL, if Gokrazy update support is linked into the binary.
|
||||
var GokrazyUpdateFromURL feature.Hook[func(context.Context, GokrazyUpdateArgs) error]
|
||||
|
||||
const (
|
||||
StableTrack = "stable"
|
||||
UnstableTrack = "unstable"
|
||||
|
||||
Reference in New Issue
Block a user