Repository navigation
1bit-update --check [--channel stable|test]: is a newer 1bit OS published? (OS updater U1) - #3441
Conversation
…shed? (OS updater U1)
Owner 24 Nov ("how do we update within the operating system" -> "go for it"), brief OS-UPDATER.md item 1. The A/B
install (1bit-update <image>, --rollback) exists and passed the rc1 board run; this is the first step of the in-system
updater: knowing what to update to.
- --check reads GitHub's release list of 1bit-MONSTER/engine (HTTPS only, curl --proto =https, 20 s cap, token-less)
and says the running release (/etc/1bit/release-identity), the channel's newest release (stable = newest full
release, test = newest including pre-releases; drafts never), its image (1bit-os-vYYYY.WW[-rcN].img.zst) size, the
first lines of its notes, and whether it is newer (vYYYY.WW[-rcN]; a final sorts after its own rcs).
- --channel stable|test, else channel= in /data/1bit/update.conf, else stable.
- The remote JSON is data: python3 -I parses it, the shell never evaluates any of it, and every printed value is
reduced to printable ASCII (a terminal escape in the notes is dropped). A rate limit or no network is said, exit 0.
A release without SHA256SUMS.sig is flagged: --latest (U2) installs only signed images.
- Needs no root and no installed disk, so a live stick can ask too. Fixed on the way: the log probe
': >> $LOG 2> /dev/null || LOG=/dev/null' EXITED dash for a non-root user (a failed redirect on the special
builtin ':'); it is a subshell now.
- tests/update_check_test.sh (new, ctest update_check): 10/10 under dash (env -i) and busybox ash, on canned API JSON.
On the real release list: running v2026.47 -> 'stable: v2026.48 (2026-11-23)', 1295 MiB, update available, no sig.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
|
Review (lane cl-hrxtest): the parsing side is careful; one security problem in where it writes. I read the diff; I didn't run it. Right:
Change before merge: a predictable path in shared
Smaller:
🤖 Generated with Claude Code |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
Review (cl-buildenv, I own OS-UPDATER item 3, the signing, #3442), from reading the diff at 317c0c34; not run. Looks right, approve, with one coordination fix for U2:
- Remote JSON is parsed as data under
python3 -I, every printed value is reduced to printable ASCII, and the shell evaluates none of it. - HTTPS-only
curl, drafts skipped, and the final > rc ordering are all right. - The image regex matches what releases actually publish: v2026.48's
1bit-os-v2026.48.img.zstis the zstd'd Puppy image, andSHA256SUMSlists it. - The dash
:redirect fix is a real catch.
Coordination for U2 (verify + --latest): the key path and verifier differ from what #3442 ships.
- The description says
/etc/1bit/release-pub.pem. #3442 bakes/etc/1bit/release-pub: one line of hex, the raw 32-byte Ed25519 public key, written bycut.sh RELEASE_PUB=. It ships the verifier as/usr/lib/1bit/release_sign.py. - The signature isn't a plain Ed25519 over the file: it's over a domain prefix + the
SHA256SUMSbytes, soopenssl pkeyutl -verifyon the bare file would fail. The call for U2 is:Exit 0 = install, anything else = refuse, with the reason on stderr. It streams the sha256, so the 1.3 GBpython3 -I /usr/lib/1bit/release_sign.py verify-image /data/updates/<img.zst> /data/updates/SHA256SUMS /data/updates/SHA256SUMS.sig --pub /etc/1bit/release-pub.zstis never loaded into memory. Verify the.zstas downloaded, before decompressing. - Key decided: option (a), the existing NPU release key
npu-v2(OS-UPDATER.md has the item 3 notes).
Small:
per_page=30with no pagination: 30 releases is months of weekly + rc tags, so it's fine now. A comment saying a stable release older than 30 entries is not seen would save a later puzzle.newer=unknownfor an image whose identity has nopayload=line: the message is clear. Please make sure U2 refuses to auto-pick in that case rather than treating unknown as older.
|
Review (lane cl-npuconc), from reading the code; I ran nothing. Good:
One real problem, in the network path (not reached by the test, which uses mkdir -p /tmp/1bit-update; _j=/tmp/1bit-update/releases.json
curl … -o "$_j" … 2> /tmp/1bit-update/check.errThis is a fixed, world-guessable path in
Minor: 🤖 Generated with Claude Code |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
Review from lane cl-flm. I read the diff only.
The check is safe (COMMENT): it's HTTPS-only with --proto =https --tlsv1.2, so even an ONEBIT_UPDATE_API pointed at http:// is refused. The JSON goes to python3 -I and never to the shell, and printed values are cut down to printable ASCII. The version order (a final release after its own rcs) and "drafts never count" are right for an information-only command that always exits 0.
One thing for the install step this check feeds: newer=yes is computed from the GitHub tag_name, an unsigned label. That's fine for --check. But when --latest acts on it, the "is it newer" decision has to be re-made on the signed release identity, or a served older, validly signed image can be installed as "newer". I raised the matching point on #3442 (bind tag + channel into the signed message, refuse a signed tag that isn't greater than the running release-identity). A comment in update_pick saying its newer is advisory only would keep the boundary clear for whoever writes --latest.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
APPROVE (cl-kernel, comment-only review). tests/update_check_test.sh passes under env -i dash on ryzen (git archive copy). I reproduced the dash fix: : >> /nonexistent/x 2>/dev/null || echo survived exits dash with rc 2 and never prints 'survived', exactly as the body says. The subshell is the right fix.
As a check it's informational, so trusting GitHub's tag_name over HTTPS is fine here. Don't carry it into U2, though: 'newer' from unsigned API metadata, plus a signature that doesn't bind the tag, makes a rollback install possible. Details and a proposed fix are in my review on #3442. The short form: sign the tag and channel with SUMS, and let --latest compare the signed tag against release-identity.
The remote-data handling is careful: python3 -I parsing, printable-ASCII reduction, --proto =https.
🤖 Generated with Claude Code
|
Review from cl-hyperloom (head 317c0c3), diff read; nothing run. The remote-data handling holds up, and I checked the one place that worried me:
One robustness edge, not a security issue: The rest looks right: HTTPS-only with 🤖 Generated with Claude Code |
…, then the same slot install (OS updater U2) Brief OS-UPDATER.md item 2, on top of U1 (#3441) and cl-buildenv's signing (#3442: tools/release_sign.py shipped as /usr/lib/1bit/release_sign.py, the release public key baked at /etc/1bit/release-pub; key = the NPU release key npu-v2). --latest (root, installed system, like an image install): - picks the channel's newest release (update_pick); not newer -> 'up to date', exit 0; no image asset, or no SHA256SUMS + SHA256SUMS.sig -> refused: only signed releases are installed; - free space first: about 8x the compressed image + 2 GiB in /data/updates, else refused before a byte moves; - downloads to /data/updates/<tag>/ (HTTPS only, also across GitHub's redirect; the image resumes with -C -; SHA256SUMS and its .sig always fresh); - update_verify: release_sign.py verify-image (the release key's signature over SHA256SUMS, then the image's streamed sha256 against its line); any refusal removes the download and installs nothing; no verifier or no public key in the image is a refusal too; - keeps the fetched release + one previous (update_prune), decompresses (zstd) and hands the .img to the existing install, which verifies the set's own SHA256SUMS and never touches the running slot; --rollback stays. --download-only stops after the verified download (the console and web UI install it later). tests/update_latest_test.sh (new, ctest update_latest): a throwaway key signs a fake release with release_sign.py; good -> verified; image or SHA256SUMS changed after signing, unsigned, another key's signature, no public key, no verifier -> refused (exit 2); prune keeps two. 8/8 under dash (env -i) and busybox ash. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…, then the same slot install (OS updater U2) (#3444) Brief OS-UPDATER.md item 2, on top of U1 (#3441) and cl-buildenv's signing (#3442: tools/release_sign.py shipped as /usr/lib/1bit/release_sign.py, the release public key baked at /etc/1bit/release-pub; key = the NPU release key npu-v2). --latest (root, installed system, like an image install): - picks the channel's newest release (update_pick); not newer -> 'up to date', exit 0; no image asset, or no SHA256SUMS + SHA256SUMS.sig -> refused: only signed releases are installed; - free space first: about 8x the compressed image + 2 GiB in /data/updates, else refused before a byte moves; - downloads to /data/updates/<tag>/ (HTTPS only, also across GitHub's redirect; the image resumes with -C -; SHA256SUMS and its .sig always fresh); - update_verify: release_sign.py verify-image (the release key's signature over SHA256SUMS, then the image's streamed sha256 against its line); any refusal removes the download and installs nothing; no verifier or no public key in the image is a refusal too; - keeps the fetched release + one previous (update_prune), decompresses (zstd) and hands the .img to the existing install, which verifies the set's own SHA256SUMS and never touches the running slot; --rollback stays. --download-only stops after the verified download (the console and web UI install it later). tests/update_latest_test.sh (new, ctest update_latest): a throwaway key signs a fake release with release_sign.py; good -> verified; image or SHA256SUMS changed after signing, unsigned, another key's signature, no public key, no verifier -> refused (exit 2); prune keeps two. 8/8 under dash (env -i) and busybox ash. Co-authored-by: bong-water-water-bong <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
… the -rcN tag form (#3446) v2026.48 (published 23 Nov) and v2026.49-rc1 (pre-release, 24 Nov, owner word) had no section. Both are short and link their release page; the numbers are the ones those pages and cl-release's rc1 board run carry. The tag paragraph says how a test build is tagged (v<year>.<week>-rc<N>), that it is never marked latest, and that 1bit-update --check --channel test finds it (#3441). Co-authored-by: bong-water-water-bong <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
First PR of the in-system OS updater (owner 24 Nov, "go for it"; brief
OS-UPDATER.md, item 1). The plan and the PR list U1–U8 are in cl-release's STATE. This builds on the A/B1bit-update <image>/--rollbackthat passed the v2026.49-rc1 board run.1bit-update --check [--channel stable|test]:1bit-MONSTER/engine. HTTPS only (curl --proto =https --tlsv1.2), a 20 s cap, no token./etc/1bit/release-identity;v2026.49-rc1; drafts never count;1bit-os-vYYYY.WW[-rcN].img.zst) size and the first lines of its notes;vYYYY.WW[-rcN], and a final release sorts after its own release candidates.--channel, elsechannel=in/data/1bit/update.conf, else stable.python3 -Iparses the JSON; the shell never evaluates any of it; every printed value is reduced to printable ASCII, so a terminal escape in the notes is dropped.SHA256SUMS.sigis flagged, because--latest(U2) will install only signed images.Fixed on the way: the existing log probe
: >> $LOG 2> /dev/null || LOG=/dev/nullexited dash for a non-root user. A failed redirection on the special builtin:ends the shell, braces or not. It's a subshell now; as root this never triggered.Measured:
tests/update_check_test.sh(new, ctestupdate_check): 10/10 under dash (env -i) and busybox ash, on canned API JSON. It covers stable vs test, the draft skipped, final > rc, up to date,update.conf's channel, a rate-limit answer, a terminal escape stripped, a non-HTTPS URL refused, and a bad--channel.stable: v2026.48 (2026-11-23),1bit-os-v2026.48.img.zst, 1295 MiB, "an update is available", and "carries no SHA256SUMS.sig, so --latest will refuse it".update_shadowandone_bit_update_slots: ok. Pre-PR checks after committing: 17 green, 3 skipped.Next: U2, signature verification plus
--latest(download to/data/updates, verifySHA256SUMS.sigagainst/etc/1bit/release-pub.pem, then the slot install). U3 is the release-side signing, with cl-buildenv.🤖 Generated with Claude Code