feat(updater): give CEC Support a self-updater - #49
Open
mrjeeves wants to merge 2 commits into
Open
Conversation
CEC Support had no update mechanism at all. It kept the engine *beneath* it current — on bring-up it asks a reused `allmystuff-serve` to move to the version CEC pins, and AllMyStuff in turn asks `myownmesh` to update to its pin, each layer falling back to its own bundled sidecar — but nothing ever updated CEC Support itself. The version in Settings was a label read from the bundle, not a check: no release feed, no timer, no network call. This adds the missing top of that chain, so the whole stack moves forward instead of only its lower two thirds. `cec-support-updater` is modelled on `allmystuff-updater` but self-contained, in the light root workspace so `cargo test` here still builds with no webview or media stack. Self-contained rather than a git dep on AllMyStuff's updater, because a tag dep can only carry already-released code — the same call `allmystuff-updater` made when it was ported from `myownmesh-updater`. One artifact (the `cec-support` binary), fail-closed verification (a published SHA-256 is mandatory; minisign required once a key is baked in), stage-then-apply on next launch, and the shared apply-policy semantics so a patch bump means the same thing across all three apps. It carries over what was just fixed in AllMyStuff rather than repeating it: Program Files is not treated as a package manager (that is where our own MSI lands), writability is probed at runtime, a package-managed install still checks and reports `ManualUpdateAvailable`, the interval is stamped only after a successful fetch, and every outcome is logged. Wiring: `apply_pending_if_any()` runs first in `main` (after the CEC home is resolved), the ticker is spawned in setup and emits `update://checked` so a found release reaches the customer without them opening Settings, five Tauri commands back a new Updates card, and a staged update offers "Restart and update" inline. release.yml only published installers, which a self-updater cannot apply — it swaps a binary. It now also packages the portable `cec-support-windows-x86_64.zip` plus the mandatory `.sha256` sidecar, named to match `platform_asset()`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FMPNLjvNYQCeR3xGfdDUCg
When a log file is available both sinks correctly get `with_ansi(false)`. The no-log-file path fell through to `builder.init()`, which leaves tracing-subscriber's default of ANSI unconditionally ON — it does not check for a TTY. That path is the one a service takes when the CEC home isn't writable, so its stdout — captured by journald/rsyslog — reached the system log wrapped in escape sequences, bloating every line and breaking grep. Colour is now gated on `std::io::stdout().is_terminal()`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FMPNLjvNYQCeR3xGfdDUCg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
CEC Support had no update mechanism at all — this is a new feature, not a repair.
It already kept the engine beneath it current: on bring-up it asks a reused, separately-installed
allmystuff-serveto update itself toALLMYSTUFF_PIN, and AllMyStuff in turn asksmyownmeshto update to its pin, each layer falling back to its own bundled sidecar when the update can't be had. But nothing ever updated CEC Support itself. A repo-wide grep forupdater|self_update|check_now|tick_forever|releases/latestacross every.rs/.ts/.svelte/.tomlreturned zero hits; the version in Settings wasappVersion()— a label read from the bundle, no network call, no comparison.This adds the missing top of that chain, so the whole stack moves forward instead of only its lower two thirds.
cec-support-updaterModelled on
allmystuff-updater, but self-contained and in the light root workspace, socargo testhere still builds with no webview or media stack. Self-contained rather than a git dep on AllMyStuff's updater because a tag dep can only ever carry already-released code — the same callallmystuff-updatermade when it was ported frommyownmesh-updater. Each app in the ecosystem carries its own.cec-supportbinary).CEC_RELEASE_PUBKEYis baked in.policy.rsported verbatim, so a patch/minor/major bump means the same thing across all three apps.pending.jsonnaming an older version is discarded rather than applied.It carries over the fixes made in AllMyStuff#198 rather than repeating the bugs: Program Files is not treated as a package manager (that's where our own MSI lands), writability is probed at runtime, a package-managed install still checks and reports
ManualUpdateAvailable, the interval is stamped only after a successful fetch, and every outcome is logged.Wiring
apply_pending_if_any()runs first inmain, right after the CEC home is resolved.setupand emitsupdate://checked, so a release found in the background reaches the customer without them opening Settings — a background task holds no handle to the UI, which is precisely how an updater ends up looking like it never runs.update_status,update_check,update_apply,update_relaunch,update_set_prefs).Release artifacts
release.ymlpublished only*-setup.exeand.msi. A self-updater can't apply either; it swaps a binary. Without a plain archive every background check would find a newer release and then fail to stage it. It now also packagescec-support-windows-x86_64.zipplus the mandatory.sha256sidecar, named to matchplatform_asset().Testing
cargo test --workspace— 22 pass (17 new).cargo clippy --workspace --all-targets -- -D warningsandcargo fmt --all --checkclean.pnpm checkclean (106 files, 0 errors) andpnpm buildsucceeds. Release workflow YAML parses with the steps in the intended order.The Tauri GUI crate does not compile in this sandbox — as its own manifest notes, it depends on AllMyStuff's node engine (webview + media stack) via git. The frontend is what this repo validates, and CI covers the rest.
One thing worth a look
CEC pins a specific AllMyStuff version (
.allmystuff-rev) and asks a reused node to match it. Now that CEC can also move itself forward, a CEC update carries a new pin with it — which is the intended behaviour, but it does mean the pin is what keeps the two halves compatible. Worth confirming that matches how you want the ecosystem to move.Generated by Claude Code