Documentation
¶
Overview ¶
Package updater self-updates the panel binary from its GitHub Releases: it finds the latest release, downloads the matching asset, verifies its SHA-256 against the release's SHA256SUMS BEFORE the binary is ever executed or swapped in, then atomically replaces the running executable (keeping a .bak for rollback). The caller restarts the service so systemd re-execs the new binary (and respawns the supervised Xray).
Index ¶
Constants ¶
const Repo = "AppsGanin/rospanel"
Repo is the GitHub "owner/repo" this panel self-updates from, baked into the build. Change it here if the project moves.
Variables ¶
AssetName is the release asset this build updates from, e.g. "rospanel-linux-amd64".
Functions ¶
func Apply ¶
Apply downloads the release asset, VERIFIES its SHA-256 against the release's SHA256SUMS before the binary is ever executed, smoke-tests it, runs backupFn as a pre-update snapshot (best-effort), then atomically replaces the running executable — keeping the previous binary as <exe>.bak for rollback. It does NOT restart the service — the caller does that. Refuses to update a release that ships no SHA256SUMS (integrity cannot be proven).
Types ¶
type Release ¶
type Release struct {
Version string `json:"version"` // semver without a leading "v"
Notes string `json:"notes"` // release body (changelog)
AssetURL string `json:"-"` // download URL of AssetName
ChecksumURL string `json:"-"` // download URL of the SHA256SUMS asset
}
Release is the newest published release of the configured repo.