Documentation
¶
Overview ¶
Package install serves the one-line worker installer (design 2026-11-14-traceability-and-machine-onboarding-design.md §3): the public scripts /install.sh and /install.ps1, and the manifest that names this server's own version for a platform together with its sha256.
The scripts carry NO credential — only the server's address. Joining is the existing anonymous self-enrollment flow (`gofer worker join`): the machine asks to be admitted, prints a pairing code, and a person approves it in the console. The installer's own integrity protection is the checksum from the manifest: a missing checksum is a hard failure, never a silent unverified install.
Index ¶
Constants ¶
const ( ScriptSh = "install.sh" ScriptPS1 = "install.ps1" )
Script names a template ships under. They are also the route suffixes (/install.sh).
Variables ¶
var ( // ErrNoReleaseVersion — the server runs a build that is not a release (a "dev" or // bare-commit build), so no release carries its exact version. ErrNoReleaseVersion = errors.New("this server's build is not a release version") // ErrNoChecksum — the source has no sha256 for that binary: the download could not be // verified, so the installer refuses to run, and the manifest refuses to offer it. ErrNoChecksum = errors.New("the update source published no sha256 for that binary") )
Errors the manifest answers 404 for: nothing is wrong with the request, but this source cannot supply a verifiable binary.
Functions ¶
func ContentType ¶
ContentType is the media type a script is served with.
Types ¶
type Manifest ¶
type Manifest struct {
Version string `json:"version"`
OS string `json:"os"`
Arch string `json:"arch"`
// URL is the binary (or its release archive) on the configured update source.
URL string `json:"url"`
// Name is the file the URL serves; an archive is one of the .tar.gz / .zip layouts
// Download knows, and the scripts unpack those before hashing.
Name string `json:"name"`
// SHA256 is the published checksum of the BINARY inside Name.
SHA256 string `json:"sha256"`
// Server is the address the scripts join (server.web_base_url, else the request's).
Server string `json:"server"`
}
Manifest is the answer of GET /install/manifest: where to download THIS server's version for one platform, its sha256, and the file name the URL serves.
func ManifestFor ¶
ManifestFor resolves the manifest: this server's release version for the platform, from the update source's own metadata (the mirror's latest.yaml, or the GitHub release's). It fails rather than offering a download nothing can verify.