clientupdate

package
v1.102.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2026 License: BSD-3-Clause Imports: 34 Imported by: 6

Documentation

Overview

Package clientupdate implements tailscale client update for all supported platforms. This package can be used from both tailscaled and tailscale binaries.

Index

Constants

View Source
const (
	StableTrack           = "stable"
	UnstableTrack         = "unstable"
	ReleaseCandidateTrack = "release-candidate"
)

Variables

View Source
var CurrentTrack = func() string {
	if version.IsUnstableBuild() {
		return UnstableTrack
	} else {
		return StableTrack
	}
}()
View Source
var GokrazyUpdateFromURL feature.Hook[func(context.Context, GokrazyUpdateArgs) error]

GokrazyUpdateFromURL updates a Gokrazy appliance from a GAF fetched from a URL, if Gokrazy update support is linked into the binary.

Functions

func LatestTailscaleVersion

func LatestTailscaleVersion(track string) (string, error)

LatestTailscaleVersion returns the latest released version for the given track from pkgs.tailscale.com.

func Update

func Update(args Arguments) error

Update runs a single update attempt using the platform-specific mechanism.

On Windows, this copies the calling binary and re-executes it to apply the update. The calling binary should handle an "update" subcommand and call this function again for the re-executed binary to proceed.

Types

type Arguments added in v1.50.0

type Arguments struct {
	// Version is the specific version to install.
	// Mutually exclusive with Track.
	Version string
	// Track is the release track to use:
	//
	//   - CurrentTrack will use the latest version from the same track as the
	//     running binary
	//   - StableTrack and UnstableTrack will use the latest versions of the
	//     corresponding tracks
	//   - ReleaseCandidateTrack will use the newest version from StableTrack
	// 	   and ReleaseCandidateTrack.
	//
	// Leaving this empty will use Version or fall back to CurrentTrack if both
	// Track and Version are empty.
	Track string
	// Logf is a logger for update progress messages.
	Logf logger.Logf
	// Stdout and Stderr should be used for output instead of os.Stdout and
	// os.Stderr.
	Stdout io.Writer
	Stderr io.Writer
	// Confirm is called when a new version is available and should return true
	// if this new version should be installed. When Confirm returns false, the
	// update is aborted.
	Confirm func(newVer string) bool
	// PkgsAddr is the address of the pkgs server to fetch updates from.
	// Defaults to "https://pkgs.tailscale.com".
	PkgsAddr string
	// ForAutoUpdate should be true when Updater is created in auto-update
	// context. When true, NewUpdater returns an error if it cannot be used for
	// auto-updates (even if Updater.Update field is non-nil).
	ForAutoUpdate bool
}

Arguments contains arguments needed to run an update.

type GokrazyUpdateArgs added in v1.102.0

type GokrazyUpdateArgs struct {
	// URL is the GAF download URL.
	URL string

	// AllowUnsigned permits installing a GAF without signature verification.
	// It is intended for tests that serve a GAF from a fileserver that does
	// not publish distsign.pub.
	AllowUnsigned bool

	// Logf is optional; nil discards log messages.
	Logf logger.Logf
}

GokrazyUpdateArgs contains arguments for updating a Gokrazy appliance from a GAF fetched from a URL.

type TrackPackages added in v1.102.0

type TrackPackages struct {
	Version         string
	Tarballs        map[string]string
	TarballsVersion string
	Exes            []string
	ExesVersion     string
	MSIs            map[string]string
	MSIsVersion     string
	GAFs            map[string]string
	GAFsVersion     string
	MacZips         map[string]string
	MacZipsVersion  string
	SPKs            map[string]map[string]string
	SPKsVersion     string
}

TrackPackages is the JSON shape served at <pkgs>/<track>/?mode=json.

func LatestPackages added in v1.102.0

func LatestPackages(track string) (*TrackPackages, error)

LatestPackages fetches the package manifest served at <pkgs>/<track>/?mode=json for the current runtime.GOOS.

type Updater added in v1.50.0

type Updater struct {
	Arguments
	// Update is a platform-specific method that updates the installation. May be
	// nil (not all platforms support updates from within Tailscale).
	Update func() error
	// contains filtered or unexported fields
}

func NewUpdater added in v1.50.0

func NewUpdater(args Arguments) (*Updater, error)

Directories

Path Synopsis
Package distsign implements signature and validation of arbitrary distributable files.
Package distsign implements signature and validation of arbitrary distributable files.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL