Skip to content

feat(os): say where the system stands in its security support, read-only - #20

Merged
inkly merged 8 commits into
mainfrom
feat/os-support
Oct 11, 2026
Merged

inkly merged 8 commits into
mainfrom
feat/os-support

Conversation

@inkly

@inkly inkly commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator

First rung of helping ReCasaOS users move off an operating system that has run out of support (Debian 11 has had no free security updates since 2026-08-31). Nothing here upgrades anything: it says, truthfully and read-only, where the system stands.

  • pkg/ossupport (standard library only): a strict identity from /etc/os-release (ID exactly debian or ubuntu; ID_LIKE is never read), a dated end-of-support table with its sources and an AsOf date, and Evaluate: supported, ending_soon (180 days), security_ended, unknown. After 18 months the table stops answering supported or ending_soon (it may be wrong by then) but an ended stays ended; a clock before AsOf answers unknown. Dates carry the precision the vendor gives (Ubuntu's pages give months).
  • Variants that say ID=debian or ID=ubuntu but are not plain Debian or Ubuntu (Raspberry Pi OS, Armbian, DietPi, Proxmox VE, OpenMediaVault) are detected by their marker files and get no claim and no upgrade guidance.
  • GET /v1/sys/os in the JWT group: no apt, no network. Debian 11 answers security_ended, ends 2026-08-31, the vendor's extended programme, and the next release as report (read-only).
  • One alert per (id, version, state) when the state is ending_soon or security_ended, checked 5 minutes after start and every 24 hours. It is recorded as told only after a message went out: with no channel configured, with the Updates category off, or when the send fails, the next look tries again. The text says plainly that ReCasaOS cannot upgrade the operating system for you yet.

Tests: parse and table boundaries (the day before, the day, the day after; 180 days; 18 months; month precision), every variant, the exact JSON of several identities, the alert (told once, again only when the state changes, not told when nothing went out, race of 32 goroutines), mutation checks. WSL test binaries for service, route and route/v1 pass.

Not verified on a real Debian or Ubuntu box yet: the measurement workflow of the installer repo records this route before and after an operating-system hop on four real guests.

inkly added 8 commits October 10, 2026 23:35
…port table

Debian and Ubuntu LTS only, by an ID that is exactly debian or ubuntu (ID_LIKE
is never read). Seven dated entries, each with its sources and the vendor's
extended programme as information. Evaluate says supported, ending_soon (180
days), security_ended or unknown, and answers unknown for a release that is not
in the table, a codename that does not match, a clock before the table was
written and any day 18 months after it.
…upport

Read-only: /etc/os-release and the architecture, no apt, no network, no lock.
Behind the token with the other /v1/sys routes.
One message per release and state (ending_soon, security_ended), looked at five
minutes after the start and every day. The state is written to
os-support.notified, atomically, before the message is raised: a restart can lose
a message and never repeats one.
…went out

The marker was written before the send, so a box with no channel (the
default), with the Updates category off, or whose first send failed spent the
one message of a state that lasts for months. raise now has a waiting form
that says whether a channel took the message, and checkOSSupport writes the
marker only then: otherwise the next daily look tries again. A crash between
the send and the marker may tell a state once more.
…able is old

Eighteen months after AsOf the table made every answer unknown, so a Debian 11
or Ubuntu 20.04 box that is still unpatched lost its badge, and its alert, at
the moment it was oldest. Staleness now turns only supported and ending_soon
into unknown, which a vendor can still move; security_ended stays, with its
end day and source and without the extended programme and the next release,
which are claims about a time the table has not been looked at for. The wrong
clock guard (before AsOf) is unchanged.

Also makes the Run test wait for the marker, which is now the last thing a
look does.
Every Ubuntu date, the standard ones and the ESM ones, now has precision
month, and Extended carries its own precision (day for Debian ELTS). The page
the API cites (ubuntu.com/about/release-cycle) gives only a month for each of
them, and Canonical's other pages disagree on the day and sometimes on the
month; where they differ the earlier month is kept, the safe side for a
warning. Ubuntu 22.04's end is now 2027-05-31 (the day before distro-info's
2027-06-01), so it reads 'around May 2027' as the cited page does, and its
alert comes a day earlier. The other days are distro-info-data's, unchanged.
Raspberry Pi OS (64-bit, and Bookworm and later), Armbian, DietPi, Proxmox VE
and OpenMediaVault say ID=debian and have no ID_LIKE, so the strict ID rule
could not tell them from a plain Debian: they were known, badged, offered
'Debian 12 is the next release' and a Debian guide, and alerted. Describe now
takes a way to look for files (the seam is service's markerExists, os.Stat on
the box) and finds them by /etc/rpi-issue, /etc/armbian-release,
/boot/dietpi.txt or /etc/dietpi, /usr/bin/pveversion or /etc/pve, and
/etc/openmediavault or /usr/sbin/omv-confdbadm; Armbian is also told by its
os-release PRETTY_NAME. A variant is known:false, with a variant field, no
support, no next and no alert. The package comment, which said ID_LIKE made
the identity strict, and the invented DietPi, OpenMediaVault and Proxmox
fixtures are replaced by what the real files say.
…the test's list needs its lock

go test -race found it in CI: two sends appended to the same slice.
@inkly
inkly merged commit df4a1d6 into main Oct 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant