agentupdate

package
v1.0.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package agentupdate mirrors the fallbck-agent release of the server's own version for agents that update themselves. The goreleaser archive, the checksums file and its Sigstore bundle are fetched from GitHub once per OS/arch, the bundle is verified against the release workflow identity, the archive against the signed checksums, and everything is kept under <data dir>/agent-releases/<version>/. Agents fetch the archive plus the signed checksums and verify again themselves (the extracted binary is still served for agents from before release signing).

Index

Constants

View Source
const ReleaseBase = "https://github.com/osshield/fallbck/releases/download"

ReleaseBase is where goreleaser publishes the archives

Variables

This section is empty.

Functions

func ArchiveName

func ArchiveName(goos, goarch string) string

ArchiveName is the goreleaser archive for the agent on os/arch

func ExtractBinary added in v0.14.12

func ExtractBinary(r io.Reader, dst string) (string, error)

ExtractBinary writes the fallbck-agent entry of the tar.gz to dst (atomically) and returns its sha256

Types

type Cache

type Cache struct {
	Version string
	Dir     string
	// BaseURL is the release download base (ReleaseBase); tests point it elsewhere
	BaseURL string
	Client  *http.Client
	// Verify checks the checksums file against its Sigstore bundle (releasesig.Verify;
	// tests substitute it)
	Verify func(bundle, checksums []byte) error
	// contains filtered or unexported fields
}

Cache is the per-server mirror; Version is the server's release version

func New

func New(version, dataDir string) *Cache

New returns the cache for the server's version under dataDir

func (*Cache) ArchivePath added in v0.14.12

func (c *Cache) ArchivePath(goos, goarch string) string

ArchivePath is where the verified release archive for os/arch lives

func (*Cache) Binary

func (c *Cache) Binary(goos, goarch string) (sha string, ok bool)

Binary returns the sha256 of the cached binary for os/arch when it is ready. When it is not, the fetch starts in the background and ok is false until it completes; the next heartbeat picks it up.

func (*Cache) BundlePath added in v0.14.12

func (c *Cache) BundlePath() string

func (*Cache) ChecksumsPath added in v0.14.12

func (c *Cache) ChecksumsPath() string

ChecksumsPath and BundlePath are the release's signed checksums file and its Sigstore bundle

func (*Cache) Enabled

func (c *Cache) Enabled() bool

Enabled reports whether the server runs a release build (dev builds never update agents)

func (*Cache) Errors

func (c *Cache) Errors() map[string]string

Errors returns the last fetch error per os/arch, for the agents page

func (*Cache) Path

func (c *Cache) Path(goos, goarch string) string

Path is where the extracted binary for os/arch lives

Jump to

Keyboard shortcuts

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