Skip to content

In-app updates from GitHub releases - #44

Merged
XyleMora merged 7 commits into
XyleMora:mainfrom
budenga:feat/auto-update
Nov 22, 2026
Merged

XyleMora merged 7 commits into
XyleMora:mainfrom
budenga:feat/auto-update

Conversation

@budenga

@budenga budenga commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

In-app updates

KiVi now looks for a newer GitHub release now and then, tells the user in the account menu, and on request downloads the file for their system, verifies its signature, replaces itself and restarts.

What the user sees

  • A check ~10 s after a page opens, then every 6 h (and on window focus when due). Nothing pops up: a dot on the avatar and an Update to vX… item at the top of the account menu.
  • The item opens a dialog: Update and restart, Skip this version, Later, plus a link to the release notes.
  • Settings has a switch to turn the automatic checks off (and a "Check now").
  • Where KiVi can't replace itself (a debug build, Linux not run from an AppImage, an app in a read-only folder), the dialog offers the release page instead.

How it works

  • Rust (src-tauri/src/update.rs, tauri-plugin-updater 2.x): commands update_info, update_check, update_install. The feed is https://github.com/<repo>/releases/latest/download/latest.json, read from Rust (no REST API, so no 60/h limit; the CSP is untouched). releases/latest skips pre-releases.
    • Linux: replaces the AppImage ($APPIMAGE).
    • macOS: replaces the .app from a signed KiVi_<v>_universal.app.tar.gz (one file for both architectures).
    • Windows: the plugin's install() would run the exe as an installer, so only download() (which verifies) is used, and replace_exe swaps the running exe (.exe.old, rolled back on failure, deleted at the next start).
    • requireSignedVersion is on, so a doctored feed can't pair a new version number with an old file.
  • JS: src/desktop/updates.js (timers, dialog) and update-check.js (pure logic, tested under gjs). The last result is shared by all pages in localStorage kivi.updateCheck. Failures are never cached.
  • CI: when the signing key is set, release builds sign the AppImage, the macOS .app.tar.gz and the Windows .exe, and the release job writes latest.json with tools/update_manifest.py (all four platform entries or none). Tags containing - are published as pre-releases, so the updater skips them.

Setup for this repository (maintainers)

Nothing changes until this is configured: without the key, builds work as before with updates off.

  1. Generate a key pair once (keep the private key and its password safe; losing it means users must download the next version by hand):
    cargo tauri signer generate -w ~/.tauri/kivi.key
  2. Settings → Secrets and variables → Actions:
    • Variable KIVI_UPDATER_PUBKEY = contents of ~/.tauri/kivi.key.pub
    • Secret TAURI_SIGNING_PRIVATE_KEY = contents of ~/.tauri/kivi.key
    • Secret TAURI_SIGNING_PRIVATE_KEY_PASSWORD = its password
  3. KIVI_UPDATE_REPO is not needed here: it defaults to XyleMora/KiVi (a fork sets it to follow its own releases).
  4. Tag a release as usual (v…). Builds made before this change can't update themselves; the first release with this change is the first one that can be updated from.

Full details: README → Updates (developers), docs/README.md → Updates (users), CLAUDE.md → Updates.

Testing

  • cargo test (incl. replace_exe and its rollback), gjs -m tests/updates.js, python3 -m unittest tests/test_update_manifest.py; both new tests are added to the CI unit-test job.
  • On the fork budenga/KiVi, with its own key: CI built and signed Linux, Windows and macOS and published v0.2.90 with a complete latest.json. A local 0.1.0 macOS build (Apple Silicon) showed the notice, updated itself and restarted as 0.2.90.
  • Not tested yet: a real update on Linux (AppImage), Windows and Intel macOS.

Notes for review

  • THIRD-PARTY-NOTICES.md shows a large diff: 16 new crates (the updater and its dependencies), and tools/notices.py renumbers every licence-text reference after them. It's regenerated, and CI checks it with --check.
  • .gitignore now ignores .DS_Store.

🤖 Generated with Claude Code

budenga and others added 7 commits November 16, 2026 00:58
update.rs: update_info / update_check / update_install on tauri-plugin-updater
(AppImage and .app through the plugin; Windows replaces the bare .exe itself).
Updates are off in builds without KIVI_UPDATER_PUBKEY.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Account menu item and dot while an update waits, an update dialog with
progress, Settings → Check for updates. The decisions (throttle, skip,
switched off) are in update-check.js with a gjs test.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Updater files only when the signing key is set; Windows .exe signed with
tauri signer; release job writes latest.json (tools/update_manifest.py) and
marks tags with a suffix as pre-releases.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The headless tests' Tauri mock answers unknown commands with null, which made
initUpdates throw an unhandled rejection and failed tests/smoke.sh on every page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI signed and published v0.2.90 on budenga/KiVi, and a local 0.1.0 macOS
build updated itself to it. Linux, Windows and Intel macOS remain untested.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@XyleMora
XyleMora self-requested a review November 22, 2026 18:45
@XyleMora
XyleMora merged commit aa41baa into XyleMora:main Nov 22, 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.

2 participants