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 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 ¶
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.
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.
const ( VariantRaspberryPi = "raspberrypi" VariantArmbian = "armbian" VariantDietPi = "dietpi" VariantProxmox = "proxmox" VariantOpenMediaVault = "openmediavault" )
The variants, the values of Identity.Variant.
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 ¶
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 ¶
This section is empty.
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 ¶
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 ¶
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 ¶
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.