Repository navigation
fix(updates): every Linux format and portable copies update themselves - #28
Open
Richards0nd wants to merge 1 commit into
Open
Richards0nd wants to merge 1 commit into
Richards0nd wants to merge 1 commit into
Conversation
…ub Releases
Only the Windows installers, macOS and a writable AppImage could install
an update. .deb, .rpm, the Arch package (and the AUR's lowquery-bin) and
portable copies only got a link to the release page.
- updates.rs now owns the check and the install. It detects how this
copy was installed (bundle type, APPIMAGE, pacman -Qqo, portable
folder) and reads the latest.json entry for that format, so an install
never receives another format.
- .deb/.rpm install through the updater plugin (pkexec dpkg -i / rpm -U).
The Arch package goes through pkexec pacman -U, from a private temp
folder. Portable copies on Linux and Windows replace their own
executable after the download's signature is checked.
- The release signs the .deb, .rpm, .pkg.tar.zst and the portable .tar.gz
and .zip, and latest.json lists linux-x86_64-{deb,rpm,pacman,portable}
and windows-x86_64-portable.
- The interface calls check_update/install_update. The JS updater plugin
and its capability are removed.
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.
Problem
The updater only installed updates on the Windows installers, macOS and a writable AppImage. Users who installed the
.deb,.rpm, the Arch.pkg.tar.zst(or the AUR'slowquery-bin), or a portable copy only saw a Download link to the release page.latest.jsonhad no entry for those formats, and the release did not sign them.Change
App (
src-tauri/src/updates.rs)The check and the install now run in Rust (
check_update,install_update), and the JS@tauri-apps/plugin-updaterandupdater:defaultare removed. The policy is detected on first use, off the main thread:installerappimageAPPIMAGEdeb/rpmpkexec dpkg -i/rpm -Upacman/usror/optpath owned perpacman -Qqopkexec pacman -U --noconfirm, from a0700temp folderportableLowQuery.exe.old, removed on next start)package/usr//optnot owned by pacmanEach channel reads its own
latest.jsonkey, so no install ever receives another format. Every download is verified against the update key before anything is written.The portable executable is read from the signed
.tar.gz/.zipinto memory. Nothing is extracted to disk.deny.tomlnow explains why the existingzipadvisories still don't apply.Debug builds never replace themselves.
Release
.deb,.rpm,.pkg.tar.zstand the portable.tar.gz(tauri signer sign --app-version). The Windows job signs the portable.zip.update_manifest.pyaddslinux-x86_64-{deb,rpm,pacman,portable}andwindows-x86_64-portable, all of them required. There is still no genericlinux-x86_64key.UI: the update dialog says the system will ask for a password on deb/rpm/pacman installs.
Installs from 0.5.3 and earlier still show the download link once. Self-update starts with the release that contains this change.
Verification
End-to-end on real installs. Old build = this branch built as
0.5.2, with a test update key and a locallatest.json. New release = the official v0.5.3 assets, re-signed with the test key. A throwaway hook (not in this PR) rancheck(true)andinstall()at startup under Xvfb. In the containerspkexecwas a pass-through shim, because they already run as root:archlinux:base-devel)pacmanlowquery-bin 0.5.2-1→0.5.3-1;/usr/bin/lowquery= official binary; relauncheddeblow-query 0.5.2→0.5.3via dpkg; relaunchedrpmlow-query-0.5.2-1→0.5.3-1; relaunchedportablelatest.jsonportableChecks:
bun run check,bun test(72 pass),bun run build,cargo fmt --check,cargo clippy --lib --tests -D warnings,cargo test --locked --lib(183 pass, including the new tests for archive reading, executable replacement and the pacman payload guard),python -m unittest discover -s .github/scripts.Not run: the Windows portable path on real Windows. Its code compiles for
x86_64-pc-windows-gnu, but replacing a running.exethere has not been tested. The release workflow itself has not been run, because it needs the signing secrets.