Documentation
¶
Overview ¶
Package manifest holds the mage targets that build, sign and verify the signed runner manifest the self-healing runner subsystem consumes (docs/arch/self-healing-runner.md).
mage manifest:build dist/runner-manifest.json from mage/download's pinned table mage manifest:sign dist/runner-manifest.json.minisig with RUNNER_MANIFEST_MINISIGN_KEY mage manifest:verify the pair against the public key compiled into ephemerd mage manifest:keygen a fresh minisign keypair (rotation)
The manifest's version and per-platform SHA-256 values come from ONE place, mage/download/download.go (RunnerVersion, RunnerFloor, pinnedSHA256): the same table `mage download` refuses to embed an archive without. Nothing here re-types a hash.
Index ¶
Constants ¶
const ( // EnvOut is the manifest path. Default dist/runner-manifest.json. EnvOut = "RUNNER_MANIFEST_OUT" // EnvFloor overrides download.RunnerFloor for one build (an emergency // floor bump without a code change). Must be <= RunnerVersion. EnvFloor = "RUNNER_MANIFEST_FLOOR" // EnvChannel is "stable" (default) or "canary". EnvChannel = "RUNNER_MANIFEST_CHANNEL" // EnvRollback = "true" marks a deliberate downgrade. EnvRollback = "RUNNER_MANIFEST_ROLLBACK" // EnvPublishedAt pins published_at (RFC 3339) for a reproducible // build; default now. EnvPublishedAt = "RUNNER_MANIFEST_PUBLISHED_AT" // EnvSecretKey is the minisign secret key: the whole .key file or just // its base64 line. This is the GitHub Actions secret // RUNNER_MANIFEST_MINISIGN_KEY on ephpm/ephemerd. EnvSecretKey = "RUNNER_MANIFEST_MINISIGN_KEY" // EnvSecretKeyFile is a path to the .key file, for local signing. EnvSecretKeyFile = "RUNNER_MANIFEST_MINISIGN_KEY_FILE" // EnvPublicKeyFile makes verify use this .pub instead of the embedded // key (checking a rotated key before it is compiled in). EnvPublicKeyFile = "RUNNER_MANIFEST_PUBLIC_KEY_FILE" // EnvKeygenDir is where keygen writes runner-manifest.pub and // runner-manifest.key. Default: the current directory. The .key file // MUST NOT be committed. EnvKeygenDir = "RUNNER_MANIFEST_KEYGEN_DIR" )
Environment knobs. Every one has a default so `mage manifest:build` with no environment produces the stable manifest for the pinned runner.
Variables ¶
This section is empty.
Functions ¶
func Compose ¶
func Compose(floor, channel string, rollback bool, publishedAt string) (*runnerversion.Manifest, error)
Compose builds the manifest value. floor/channel/publishedAt empty = defaults (download.RunnerFloor, stable, now).
func Keygen ¶
func Keygen() error
Keygen writes a fresh minisign keypair: runner-manifest.pub (commit it to pkg/runnerversion/keys/ to rotate the trust root) and runner-manifest.key (store it ONLY as the RUNNER_MANIFEST_MINISIGN_KEY secret; never commit it). Refuses to overwrite existing files.
Types ¶
This section is empty.