Skip to content

Windows app updates itself from GitHub releases - #7

Open
Page011 wants to merge 1 commit into
delete-foreverfrom
auto-update
Open

Page011 wants to merge 1 commit into
delete-foreverfrom
auto-update

Conversation

@Page011

@Page011 Page011 commented Nov 23, 2026

Copy link
Copy Markdown
Owner

The Windows app checks GitHub once a day and installs a newer version itself. Stacked on #6.

What changes

  • Daily check: about 2 minutes after start, then every 24 hours, the PC app reads latest.json from the latest GitHub release (releases/latest/download/latest.json). The last check time is saved, so restarts do not check more often.
  • Only signed, only newer: a newer version is downloaded in the background and kept only if its signature matches the public key in tauri.conf.json and was made for that exact version. Never a downgrade.
  • Install: banner "UPDATE READY - Tugboat X.Y.Z" with Install, and a tray item. Install runs the installer in passive mode. Windows asks for admin rights (per-machine install); saying no changes nothing and the banner stays. The window shows again after the update, even when Tugboat was started minimised.
  • Setting: "Check for updates", on by default, stored on the PC only. Off stops a check or download in progress at once. Nothing about the user or their files is sent; GitHub sees an ordinary HTTPS request.
  • Too old for the phone: when another device refuses this PC with "Update Tugboat on ...", it checks soon, at most once an hour.
  • Failures: offline, HTTP errors, 404 and a bad signature are logged once and tried again at the next daily check; no banner, no retry loop.
  • TLS: the Windows certificate store, so it also works behind a proxy that re-signs HTTPS.
  • Release workflow: the installer is built without the signing key. A tag-only step signs it with --app-version, and .github/scripts/latest-json.ts writes latest.json only after verifying that signature against the app's public key and the installer bytes, so a key pair that does not match fails the release instead of every installed PC. Tags with a suffix (v1.1.0-rc.1) become pre-releases and are never offered. The run fails while the public key is the placeholder or a secret is missing.

Before the first release

  1. Make the update key: bun run tauri signer generate -w <path outside the repo> (password typed at the prompt). Losing the key or its password means installed PCs can never auto-update again.
  2. Add the secrets TAURI_SIGNING_PRIVATE_KEY and TAURI_SIGNING_PRIVATE_KEY_PASSWORD.
  3. Put the public key in plugins.updater.pubkey in tauri.conf.json (today the placeholder UPDATER_PUBKEY_MISSING, with which the app never checks).

Tested

  • cargo test --workspace: 710 passed, 0 failed (4 ignored; the new one needs the internet) (schedule, persisted times, switch off, QA profile, refusal rate limit, version gate, placeholder key, release builds ignore the test overrides, show-after-update rule). cargo clippy -D warnings: clean.
  • Desktop bun run check: svelte-check 0/0, 239 TS tests, 256 desktop Rust tests. bun test ./.github/scripts: 16 passed (latest.json: wrong key, other bytes, forged signature, altered comment, wrong version, placeholder key; workflow: secrets only in the sign step, tag-only steps, pre-release tags). Checked with real tauri signer sign signatures from two keys: the matching key passes, the other fails.
  • Dry run with a QA profile against a local update server (test key, install never run): a signed newer version shows UPDATE READY; a file changed after signing is refused with no banner; an equal version is not downloaded; with the switch off no request is made for 5.5 minutes after a restart; a real HTTPS request to GitHub from behind a re-signing proxy completes and the current 404 is logged as no update.

Not tested yet (needs a person)

  • Install itself (never run in tests): the Windows prompt, the passive installer and the restart, from a real 1.0.0 to a real 1.0.1.
  • The workflow on GitHub with the real secrets (first tag).

- Once a day (first check about 2 minutes after start) the PC app reads
  latest.json from the latest GitHub release. A newer version is
  downloaded in the background and kept only if its signature checks
  out against the public key in tauri.conf.json and was made for that
  exact version; never a downgrade. Then a banner "UPDATE READY -
  Tugboat X.Y.Z" and a tray item offer Install, which runs the
  installer in passive mode (Windows asks for admin rights; saying no
  changes nothing) and shows the window again afterwards.
- Settings: "Check for updates", on by default, stored on the PC only.
  Switching it off stops a check or download in progress. Nothing about
  the user or their files is sent; a QA profile never checks.
- Also checks soon after another device refuses this PC as too old, at
  most once an hour. Network errors, a 404 and a bad signature are
  logged once and retried at the next daily check.
- TLS through the Windows certificate store, so it works behind a proxy
  that re-signs HTTPS as well as on a plain network.
- Release workflow: the installer is built without the signing key; a
  separate tag-only step signs it (bound to the version), and a script
  writes latest.json only after verifying that signature against the
  app's public key and the installer bytes. Tags with a suffix become
  pre-releases, so they are never offered as an update. The run fails
  while the public key is the placeholder or a secret is missing.
- Until the update key is made, tauri.conf.json holds the placeholder
  UPDATER_PUBKEY_MISSING and the app never checks.
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 8c775fac-0b25-43ad-8b41-96b91301248f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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