Skip to content

feat: replace the host updater during managed updates - #103

Merged
caigee-cmd merged 4 commits into
mainfrom
feat/self-update-host-updater
Sep 6, 2026
Merged

feat: replace the host updater during managed updates#103
caigee-cmd merged 4 commits into
mainfrom
feat/self-update-host-updater

Conversation

@caigee-cmd

Copy link
Copy Markdown
Owner

Summary

  • Managed console updates now stage the matching host-updater binary, replace it in place after the new container is healthy, and exit so systemd or LaunchAgent starts the new process.
  • A failed host-binary swap rolls back with the container and discards .new. Release updater assets are stamped with Version/Commit. An old updater can complete one jump, and the System page can roll back to one of the three previous stable releases.
  • Changelog is frozen for v0.2.48 in this PR so the release workflow does not need to push the freeze onto protected main.

Test plan

  • go test ./internal/api ./internal/updater ./internal/update
  • Frontend lint + npm run sync
  • After merge, run the Release workflow from main to publish v0.2.48
  • On us1, pull ghcr.io/caigee-cmd/cli2api:v0.2.48, recreate the container, and reinstall the host updater from the new image

Stage the GitHub updater binary next to the running daemon while the target image is prepared, then swap it in after the new container is healthy so the next update uses the matching protocol. Installers now prefer the latest release asset instead of copying an old binary from the current container.
After a managed container recreate succeeds, copy or keep the staged host updater, atomically rename the running binary, and exit 0 so systemd or LaunchAgent starts the new process.
Fail the whole update if the host updater cannot replace itself, discard a staged binary on container rollback, stamp Version/Commit into updater assets, let an old updater complete one jump, and offer the three previous stable releases on the System page.
Keep the host-updater self-update notes ready for the next patch release so GitHub Actions does not have to push the freeze to protected main.
@caigee-cmd
caigee-cmd merged commit a557d89 into main Sep 6, 2026
6 checks 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