buildinfo

package
v0.1.43 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: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package buildinfo holds values stamped into the binaries at build time.

Index

Constants

This section is empty.

Variables

View Source
var Built = ""

Built is the Unix time (decimal seconds) of the source commit, set with -X github.com/mistgate/mistgate/internal/buildinfo.Built=<git log -1 --format=%ct>. It orders releases: the version string ("0.1.0-<hash>") does not. Empty = a build without it (go run, go test): BuiltUnix is 0.

View Source
var ErrReleaseKeyMismatch = errors.New("buildinfo: <data-dir>/release.pub is not the release key compiled into this binary; " +
	"nothing is trusted until you confirm the new key with `mistgate release trust-key`")

ErrReleaseKeyMismatch is LoadReleasePublicKey's answer when <data-dir>/release.pub and the compiled-in key differ.

View Source
var ErrUnsignedBuild = errors.New("unsigned build: update by hand")

ErrUnsignedBuild is what a binary without ReleaseKey answers to anything that needs to verify a release.

View Source
var ReleaseKey = ""

ReleaseKey is the owner's release public key, 32 bytes of ed25519 in standard base64, set with -X github.com/mistgate/mistgate/internal/buildinfo.ReleaseKey=<base64>. Both binaries carry it; the node agent trusts an update only if the owner signed it. Empty = unsigned build: self-update is off.

View Source
var Version = "0.1.0-dev"

Version is set with -ldflags "-X github.com/mistgate/mistgate/internal/buildinfo.Version=1.2.3".

Functions

func BuiltUnix

func BuiltUnix() int64

BuiltUnix is Built as a number; 0 when it is empty or not a positive decimal integer.

func KeyFingerprint

func KeyFingerprint(pub ed25519.PublicKey) string

KeyFingerprint is the first 16 hex characters of SHA-256 of a public key: what `mistgate release keygen` prints next to the key and the Updates page shows, to compare by eye.

func LoadReleasePublicKey

func LoadReleasePublicKey(dataDir string) (ed25519.PublicKey, error)

LoadReleasePublicKey is the installation's release trust root. The first keyed build stores its public key in the data directory. A later build with the same key uses it; one with another compiled-in key gets ErrReleaseKeyMismatch (a key rotation is an explicit step, TrustCompiledReleaseKey, never a side effect of a file in the data directory or of a new binary); a build without a key keeps using the stored one.

func ReleasePublicKey

func ReleasePublicKey() (ed25519.PublicKey, error)

ReleasePublicKey decodes ReleaseKey. It returns ErrUnsignedBuild when there is none, and another error when the stamped value is not a valid key (a broken build must not look like an unsigned one).

func TrustCompiledReleaseKey added in v0.1.15

func TrustCompiledReleaseKey(dataDir string) (previous, current ed25519.PublicKey, err error)

TrustCompiledReleaseKey makes the key compiled into this binary the installation's release key: the explicit step of a key rotation. It returns the key it replaced (nil when there was none).

Types

This section is empty.

Jump to

Keyboard shortcuts

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