Skip to content

feat(node): Phase 7 slice 2b — self-contained update helper + channel-agnostic API - #408

Merged
M0LTE merged 4 commits into
mainfrom
feat/phase7-selfcontained-node
Jun 13, 2026
Merged

feat(node): Phase 7 slice 2b — self-contained update helper + channel-agnostic API#408
M0LTE merged 4 commits into
mainfrom
feat/phase7-selfcontained-node

Conversation

@M0LTE

@M0LTE M0LTE commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

The heart of the self-contained update channel.

packaging/packetnet-selfupdate — the helper

Shipped by the (coming) install.sh as /usr/lib/packetnet/packetnet-update — same packetnet-update.service unit as the apt channel, different body:

fetch latest.json from the configured feed → pick this arch's tarball → download → sha256-verify (checksum-only; cosign verify-blob seam marked for later) → unpack into releases/<new> via a temp dir + atomic rename → flip the current symlink (the unit's ExecStart target) → restart → poll /healthz → on failure flip back to $prev + restart → GC keeping exactly current+$prev.

Parses the manifest without a jq dependency; paths/restart/health are PDN_*-overridable so it's testable without systemd.

scripts/selfupdate-smoke.sh (wired into deb-smoke)

Proves happy-path / checksum-mismatch-refused / rollback against a file:// fixture — no network, no systemd. It caught a real bug mid-build: GC by mtime deleted the rollback target (it's $prev, not necessarily the 2nd-newest by mtime) — fixed to protect current+$prev explicitly.

API generalized

ISystemUpdateLauncher.StartAptUpdateAsyncStartUpdateAsync (channel-agnostic — starts the one oneshot whatever the install's helper does). POST /api/v1/system/update now launches for both apt and self-contained, with a channel-aware via/audit; only unknown → 409 (self-contained stopped returning 501). SystemUpdateApiTests updated.

797 Node tests green; helper smoke green.

Remaining (slice 2c)

installers/install.sh (lay out releases/current + the self-contained unit + the selfcontained marker + the helper + polkit + /etc/packetnet/update.conf + user/dirs + bootstrap), the feed URL in node config, and the available-version check feeding the UI.

M0LTE and others added 2 commits June 13, 2026 04:28
The pdn repos went public; redact internal ops detail that a secret-scanner
won't flag but needn't be broadcast: the lab hostname (packetdotnet -> pdn-lab,
repo-wide incl. deploy-node.sh's env-overridable default + a compose comment)
and the real LAN IPs in the docs narrative (10.45.0.x -> 10.x.x.x). RFC1918 /
internal-only throughout, so no security exposure either way; cosmetic.
deploy-node.sh stays functional (PACKETNET_HOST override unchanged).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…-agnostic API

The heart of the self-contained channel.

packaging/packetnet-selfupdate — shipped by the (coming) install.sh as
/usr/lib/packetnet/packetnet-update (same packetnet-update.service unit as apt,
different body): fetch latest.json from the feed → pick this arch's tarball →
download → sha256-verify (checksum-only; cosign seam marked) → unpack into
releases/<new> via temp dir + atomic rename → flip the `current` symlink → restart
→ /healthz-gate → roll back to $prev on failure → GC keeping current+$prev. Parses
the manifest without jq; paths/restart/health are PDN_*-overridable for testing.

scripts/selfupdate-smoke.sh (wired into deb-smoke) proves happy-path /
checksum-mismatch-refused / rollback against a file:// fixture — and caught a real
bug: GC by mtime deleted the rollback target ($prev isn't necessarily 2nd-newest);
fixed to protect current+$prev explicitly.

API generalized: ISystemUpdateLauncher.StartAptUpdateAsync → StartUpdateAsync
(channel-agnostic), and POST /api/v1/system/update now launches for BOTH apt and
self-contained with a channel-aware `via`/audit; only unknown → 409 (self-contained
stopped returning 501). SystemUpdateApiTests updated; 797 Node tests green.

Remaining (slice 2c): installers/install.sh, the feed URL in node config, the
available-version check feeding the UI.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@M0LTE M0LTE closed this Jun 13, 2026
@M0LTE M0LTE reopened this Jun 13, 2026
@M0LTE
M0LTE merged commit 3e2f99d into main Jun 13, 2026
@M0LTE
M0LTE deleted the feat/phase7-selfcontained-node branch June 13, 2026 05:05
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