agentupdate

package
v0.14.8 Latest Latest
Warning

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

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

Documentation

Overview

Package agentupdate mirrors the fallbck-agent binary of the server's own release for agents that update themselves. The goreleaser archive and checksum file are fetched from GitHub once per OS/arch, the archive is verified, the binary is extracted into <data dir>/agent-releases/<version>/ and served to agents from there.

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

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
	// 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) 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) 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