updatecheck

package
v0.14.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package updatecheck periodically asks GitHub whether a newer Mooring release exists and — critically — whether the RUNNING version is affected by a published security advisory, so the operator is told to update (and paged, for a security advisory) even when nobody is watching the dashboard. It is OPT-IN: with the check disabled it never contacts the network. When enabled it contacts ONLY the GitHub API and sends no telemetry payload (plain GETs of public release/advisory data).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdvisoryState

type AdvisoryState struct {
	GHSAID   string
	Severity string
	Summary  string
	URL      string
	Patched  string
}

AdvisoryState describes the published security advisory affecting the running version.

type Checker

type Checker struct {
	// contains filtered or unexported fields
}

Checker periodically asks GitHub whether a newer Mooring exists and whether the running version is affected by a published security advisory.

func New

func New(gh ghAPI, owner, repo, version string, interval time.Duration, alerts alertSink, log *slog.Logger) *Checker

New builds a Checker. interval is clamped to a sane floor by Run.

func (*Checker) Run

func (c *Checker) Run(ctx context.Context)

Run does one check shortly after boot, then every interval, until ctx is done. The check runs UNCONDITIONALLY (unlike the git poller) — security state must update even when no operator is watching the dashboard.

func (*Checker) State

func (c *Checker) State() *State

State returns the latest computed posture (nil until the first check completes).

type State

type State struct {
	Checked         bool
	At              time.Time
	RunningVersion  string
	LatestVersion   string
	LatestURL       string
	UpdateAvailable bool
	Advisory        *AdvisoryState // non-nil ⇒ the RUNNING version is vulnerable — update now
	LastError       string
}

State is the current update posture the dashboard banner renders. Held in an atomic pointer and read (cheaply) on every page render.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL