ossupport

package
v0.4.111 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package ossupport says whether the operating system the core runs on still receives security updates, from a table of dates kept in this file. It only reads and reports: nothing here upgrades anything, and nothing here asks the network, apt or the box's own tables (the answer is the same on a box with a stale distro-info-data).

Four rules keep it from saying something false:

  • the identity is strict: ID must be exactly "debian" or "ubuntu". ID_LIKE is never looked at, so Mint, Pop!_OS, Raspbian (32-bit, ID=raspbian) and the rest are not known, and nothing is claimed;
  • but ID cannot tell a plain Debian or Ubuntu from the systems that keep its own os-release (ID=debian, no ID_LIKE): Raspberry Pi OS (64-bit, and Bookworm and later), Armbian, DietPi, Proxmox VE, Proxmox Backup Server, Proxmox Mail Gateway, TrueNAS SCALE and OpenMediaVault. Those are found by marker files, read through the exists seam of Describe, and are not known either: the answer says which Variant it is, claims nothing, and offers no next release, because each of them upgrades by its own guide, or not in place;
  • a release that is not in the table (Debian 14, Ubuntu 26.10, any non-LTS Ubuntu, 18.04) is "unknown", not guessed;
  • eighteen months after the day the table was last checked (AsOf) what is still to come is "unknown": a table nobody has updated is no longer a source for it. What has ended stays ended, since an end that has passed cannot un-end.

Index

Constants

View Source
const (
	// Supported: the vendor's free security updates go on for more than 180 days.
	Supported = "supported"
	// EndingSoon: they end within 180 days, or today.
	EndingSoon = "ending_soon"
	// SecurityEnded: they ended yesterday or before.
	SecurityEnded = "security_ended"
	// Unknown: no claim is made.
	Unknown = "unknown"
)

The states of Support.State.

View Source
const (
	PrecisionDay   = "day"
	PrecisionMonth = "month"
)

The precisions of Support.Ends: the vendor says the day, or only the month. A date the vendor's page gives as a month ("May 2027") is PrecisionMonth, whatever day another source puts in it, and is shown as the month.

View Source
const (
	VariantRaspberryPi    = "raspberrypi"
	VariantArmbian        = "armbian"
	VariantDietPi         = "dietpi"
	VariantProxmox        = "proxmox"
	VariantOpenMediaVault = "openmediavault"
	// TrueNAS SCALE (before 25.04 its os-release says ID=debian), Proxmox Backup Server and Proxmox
	// Mail Gateway (both keep Debian's own os-release, as Proxmox VE does).
	VariantTrueNAS       = "truenas"
	VariantProxmoxBackup = "proxmox_backup"
	VariantProxmoxMail   = "proxmox_mail"
)

The variants, the values of Identity.Variant.

View Source
const StateReport = "report"

StateReport is the State of a Next: it is a report, read-only. Nothing in this package, and nothing that reads it yet, upgrades the operating system.

Variables

View Source
var AsOf = time.Date(2026, 10, 9, 0, 0, 0, 0, time.UTC)

AsOf is the day the table below was last checked against its sources. A var so that a test can move it; nothing else does.

Functions

func BeforeTable added in v0.4.71

func BeforeTable(now time.Time) bool

BeforeTable says whether now is a day before AsOf: a clock that is wrong, since the table was written on AsOf and no box that runs this code is earlier than that. Evaluate says nothing of such a day, and whoever asks for what the table says should say that the date is wrong, and not that the table has nothing.

func Stale added in v0.4.71

func Stale(now time.Time) bool

Stale says whether the table is too old to be believed on the day of now: more than eighteen months after AsOf. Whoever asks what the table says of a release should say that the table is old, and not that the release has nothing. A day before AsOf is not stale, it is a clock that is wrong (BeforeTable).

Types

type Extended

type Extended struct {
	Name      string `json:"name"`
	Ends      string `json:"ends"`
	Precision string `json:"precision"`
}

Extended is the vendor's later, separate programme of security maintenance. Only its name and its last day are said: what it costs, and for whom, is the vendor's to say. Precision is that of Ends, as for a Support.

type Identity

type Identity struct {
	ID         string `json:"id,omitempty"`
	VersionID  string `json:"version_id,omitempty"`
	Codename   string `json:"codename,omitempty"`
	PrettyName string `json:"pretty_name,omitempty"`
	Arch       string `json:"arch,omitempty"`
	// Known is true for ID "debian" or "ubuntu", exactly, when it is not a Variant, and for nothing
	// else.
	Known bool `json:"known"`
	// Variant is what a box that says ID "debian" or "ubuntu" really is, when it is not the plain
	// distribution: one of the Variant constants. Such a box is not Known.
	Variant string `json:"variant,omitempty"`
}

Identity is the operating system as os-release says it, validated: a field that is not what it should look like is left empty, and absent from the JSON.

func Parse

func Parse(osRelease map[string]string, arch string) Identity

Parse is the identity of the box from its os-release and its architecture. It is strict: only an ID of exactly "debian" or "ubuntu" is Known, and ID_LIKE is never looked at. Every field is checked for length and characters before it goes anywhere (a log, a page, an alert): one that fails is left empty. The only variant Parse can tell is Armbian, whose os-release names it (its PRETTY_NAME is "<vendor> <version> <release>", "Armbian-unofficial" when the vendor is not set); the others are told by their files, in Describe.

type Next

type Next struct {
	ID         string `json:"id"`
	VersionID  string `json:"version_id"`
	Codename   string `json:"codename"`
	PrettyName string `json:"pretty_name"`
	State      string `json:"state"`
}

Next is the release after this one. State is StateReport: it is information only.

type Report

type Report struct {
	Identity
	Support Support `json:"support"`
	Next    *Next   `json:"next,omitempty"`
}

Report is what GET /v1/sys/os answers: who the box is, how long it is supported, and the next release when the table has one.

func Describe

func Describe(osRelease map[string]string, arch string, now time.Time, exists func(path string) bool) Report

Describe is Parse, the look for a variant and Evaluate together, as the API answers them. exists says whether a path exists on the box (nil: none does); it is asked only when the box says "debian" or "ubuntu", and the variant it finds is not Known and has no support to claim.

type Support

type Support struct {
	State string `json:"state"`
	// Ends is the last day of the free security updates, "2006-01-02", with Precision "day"; with
	// "month" the vendor says only the month, and only the month is to be shown.
	Ends      string    `json:"ends,omitempty"`
	Precision string    `json:"precision,omitempty"`
	Extended  *Extended `json:"extended,omitempty"`
	// Source is the page that says it.
	Source string `json:"source,omitempty"`
	// Next is not part of the JSON of a Support: a Report carries it beside it.
	Next *Next `json:"-"`
}

Support is how long the vendor's free security updates last for an Identity.

func Evaluate

func Evaluate(id Identity, now time.Time) Support

Evaluate is how long the free security updates of id last, on the day of now (UTC). The last day is a day of support: SecurityEnded begins the day after it, and EndingSoon the 180th day before it. A box that is not Known, a release the table does not have, a codename that is not the release's (a derivative, a testing system) and any day before AsOf are Unknown. More than 18 months after AsOf the table is stale: Supported and EndingSoon, which a vendor can still move, are Unknown then, and SecurityEnded stays SecurityEnded, with only the day it ended and its source: what the vendor offers after it, and the next release, are claims about a time the table has not been looked at for.

Jump to

Keyboard shortcuts

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