Documentation
¶
Overview ¶
Package update checks for and installs new hopsesh releases from GitHub.
Trust, in layers:
- The archive must match checksums.txt from the same release (integrity).
- Release builds embed an ECDSA P-256 public key (PublicKey, set with -ldflags); checksums.txt must then carry a valid signature (checksums.txt.sig, ASN.1 DER, made with `openssl dgst -sha256 -sign`). This holds even if the GitHub account or a CDN were compromised. Builds without a key can check but not install.
- On macOS, when the running binary is code-signed, the new one must be signed by the same team.
Copies installed by Homebrew, Scoop or inside hopsesh.app are left to those.
Index ¶
Constants ¶
const Repo = "roeehrl/hopsesh"
Repo is the GitHub repository releases come from.
Variables ¶
var API = "https://api.github.com"
API is the GitHub API base (tests point it elsewhere).
var ErrNoKey = errors.New("this build has no release signing key, so it cannot verify and install updates; reinstall from a release")
ErrNoKey means this build has no release key, so it will not install updates.
var ErrNoReleases = errors.New("no hopsesh release is published yet")
ErrNoReleases means the repository has no published release (yet).
var PublicKey = ""
PublicKey is the base64 DER (PKIX) ECDSA P-256 key release builds embed:
-X github.com/roeehrl/hopsesh/internal/update.PublicKey=MFkw...
Functions ¶
func ArchiveName ¶
ArchiveName is the release archive for this platform (matches .goreleaser.yaml).
func Install ¶
Install downloads, verifies and installs rel over the running binary. It returns the installed path.
func ManagedBy ¶
ManagedBy names the package manager or app that owns the running binary, with the command to update it, or "" when hopsesh may replace itself.
func Newer ¶
Newer reports whether version a is newer than b (semantic versions, "v" optional; a development build is never newer and is always older than a release).
func VerifySignature ¶
VerifySignature checks an ASN.1 ECDSA signature over data with a base64 PKIX key.