Documentation
¶
Overview ¶
Package buildinfo holds values stamped into the binaries at build time.
Index ¶
Constants ¶
This section is empty.
Variables ¶
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.
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.
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.
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 ¶
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 ¶
LoadReleasePublicKey keeps the release trust root stable when a panel binary is replaced by a generic GitHub release build. The first keyed build stores its public key in the data directory; subsequent builds use that installation key even when the downloaded binary was built without a per-installation key.
func ReleasePublicKey ¶
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).
Types ¶
This section is empty.