diff --git a/.github/scripts/test_update_manifest.py b/.github/scripts/test_update_manifest.py index 91b0de4..f6d5a48 100644 --- a/.github/scripts/test_update_manifest.py +++ b/.github/scripts/test_update_manifest.py @@ -6,7 +6,7 @@ class ManifestTest(unittest.TestCase): - def test_signed_assets_become_platforms_and_linux_stays_appimage_only(self): + def test_signed_assets_become_platforms_with_one_key_per_linux_format(self): with tempfile.TemporaryDirectory() as tmp: assets = Path(tmp) for name in [ @@ -15,17 +15,21 @@ def test_signed_assets_become_platforms_and_linux_stays_appimage_only(self): "LowQuery-1.2.3-macos-universal.app.tar.gz", "LowQuery-1.2.3-linux-x64.AppImage", "LowQuery-1.2.3-linux-x64.deb", + "LowQuery-1.2.3-linux-x64.rpm", + "LowQuery-1.2.3-linux-x86_64.pkg.tar.zst", ]: (assets / name).write_bytes(b"x") - if not name.endswith(".deb"): + if not name.endswith(".zst"): (assets / f"{name}.sig").write_text(f"sig-{name}\n") doc = build_manifest("1.2.3", "LowBloat/LowQuery", assets, "notes") self.assertEqual( sorted(doc["platforms"]), - ["darwin-aarch64", "darwin-x86_64", "linux-x86_64-appimage", - "windows-x86_64", "windows-x86_64-msi", "windows-x86_64-nsis"], + ["darwin-aarch64", "darwin-x86_64", "linux-x86_64-appimage", "linux-x86_64-deb", + "linux-x86_64-rpm", "windows-x86_64", "windows-x86_64-msi", "windows-x86_64-nsis"], ) self.assertNotIn("linux-x86_64", doc["platforms"]) + self.assertTrue(doc["platforms"]["linux-x86_64-deb"]["url"].endswith("/LowQuery-1.2.3-linux-x64.deb")) + self.assertTrue(doc["platforms"]["linux-x86_64-rpm"]["url"].endswith("/LowQuery-1.2.3-linux-x64.rpm")) self.assertEqual(doc["platforms"]["windows-x86_64-msi"]["signature"], "sig-LowQuery-1.2.3-windows-x64.msi") self.assertTrue(doc["platforms"]["windows-x86_64"]["url"].endswith("/v1.2.3/LowQuery-1.2.3-windows-x64-setup.exe")) diff --git a/.github/scripts/update_manifest.py b/.github/scripts/update_manifest.py index 3ed0988..f6a7166 100644 --- a/.github/scripts/update_manifest.py +++ b/.github/scripts/update_manifest.py @@ -21,8 +21,11 @@ def signed(keys, asset): signed(["windows-x86_64", "windows-x86_64-nsis"], f"LowQuery-{version}-windows-x64-setup.exe") signed(["windows-x86_64-msi"], f"LowQuery-{version}-windows-x64.msi") signed(["darwin-aarch64", "darwin-x86_64"], f"LowQuery-{version}-macos-universal.app.tar.gz") - # No generic Linux key: .deb and .rpm installs must never receive an AppImage. + # One key per Linux format, never a generic one: a .deb install must get a + # .deb, an .rpm install an .rpm, and the Arch package nothing (pacman owns it). signed(["linux-x86_64-appimage"], f"LowQuery-{version}-linux-x64.AppImage") + signed(["linux-x86_64-deb"], f"LowQuery-{version}-linux-x64.deb") + signed(["linux-x86_64-rpm"], f"LowQuery-{version}-linux-x64.rpm") return { "version": version, @@ -47,7 +50,7 @@ def signed(keys, asset): notes = result.stdout.strip() assets = Path("release-assets") doc = build_manifest(version, repo, assets, notes) - required = {"windows-x86_64", "darwin-aarch64", "linux-x86_64-appimage"} + required = {"windows-x86_64", "darwin-aarch64", "linux-x86_64-appimage", "linux-x86_64-deb", "linux-x86_64-rpm"} missing = required - doc["platforms"].keys() if missing: raise SystemExit(f"Signed updater artifacts missing for: {sorted(missing)}") diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bfdbeb0..d961068 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -121,8 +121,14 @@ jobs: set -euo pipefail mkdir -p out bundle=src-tauri/target/release/bundle - cp "$(find $bundle/deb -name '*.deb' | head -n 1)" "out/LowQuery-${VERSION}-linux-x64.deb" - cp "$(find $bundle/rpm -name '*.rpm' | head -n 1)" "out/LowQuery-${VERSION}-linux-x64.rpm" + # Each package keeps its updater signature: .deb and .rpm installs + # update themselves through dpkg/rpm. + deb="$(find $bundle/deb -name '*.deb' | head -n 1)" + cp "$deb" "out/LowQuery-${VERSION}-linux-x64.deb" + cp "$deb.sig" "out/LowQuery-${VERSION}-linux-x64.deb.sig" + rpm="$(find $bundle/rpm -name '*.rpm' | head -n 1)" + cp "$rpm" "out/LowQuery-${VERSION}-linux-x64.rpm" + cp "$rpm.sig" "out/LowQuery-${VERSION}-linux-x64.rpm.sig" appimage="$(find $bundle/appimage -name '*.AppImage' | head -n 1)" cp "$appimage" "out/LowQuery-${VERSION}-linux-x64.AppImage" cp "$appimage.sig" "out/LowQuery-${VERSION}-linux-x64.AppImage.sig" diff --git a/CHANGELOG.md b/CHANGELOG.md index a76fb39..8f9f8d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to LowQuery are documented here. The format follows [Keep a ## [Unreleased] +## [0.5.5] - 2026-11-11 + +### Fixed +- **Automatic updates on Linux `.deb` and `.rpm` installs.** They were only told a new version existed: the release published no updater signature or manifest entry for them, and the app treated them as owned by the package manager. Now, when dpkg or rpm really owns the binary, the update downloads and installs the new package itself (pkexec asks for the administrator password), like Windows, macOS and the AppImage. The Arch package and portable copies keep the download link. +- **Updates show up much sooner.** The app checked every six hours; it now checks every 10 minutes and when the window regains focus, downloads the update in the background and only then offers **Restart to update**, which installs it right away. + ## [0.5.4] - 2026-10-30 ### Added @@ -173,7 +179,8 @@ First public release, with PostgreSQL and Oracle. - Schema browser for tables, views, sequences, routines, packages and columns. - Drafts restored on restart, light and dark themes, and a layout for narrow windows. -[Unreleased]: https://github.com/LowBloat/LowQuery/compare/v0.5.4...HEAD +[Unreleased]: https://github.com/LowBloat/LowQuery/compare/v0.5.5...HEAD +[0.5.5]: https://github.com/LowBloat/LowQuery/compare/v0.5.4...v0.5.5 [0.5.4]: https://github.com/LowBloat/LowQuery/compare/v0.5.3...v0.5.4 [0.5.3]: https://github.com/LowBloat/LowQuery/compare/v0.5.2...v0.5.3 [0.5.2]: https://github.com/LowBloat/LowQuery/compare/v0.5.1...v0.5.2 diff --git a/README.md b/README.md index 1d6b8c0..c884d40 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ The [latest release](https://github.com/LowBloat/LowQuery/releases/latest) inclu gh attestation verify LowQuery--linux-x64.AppImage --repo LowBloat/LowQuery ``` -**Updates.** Installed copies on Windows, macOS and AppImage update themselves: LowQuery checks for a new release in the background, shows what changed and installs it when you choose **Install and restart**. Updates are signed and verified before installation. `.deb`, `.rpm` and portable copies are told when a new version is out and link to the download. +**Updates.** Installed copies on Windows, macOS, AppImage, `.deb` and `.rpm` update themselves: LowQuery checks for a new release every few minutes and when the window regains focus, downloads it in the background and offers **Restart to update** once it is ready. Updates are signed and verified before installation. `.deb` and `.rpm` installs ask for the administrator password, since dpkg or rpm installs the new package. The Arch package and portable copies are told when a new version is out and link to the download. **First launch on Windows and macOS.** The installers are not code-signed yet, so the system warns on first launch: diff --git a/package.json b/package.json index 24ceb0f..eccf5a2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lowquery", - "version": "0.5.4", + "version": "0.5.5", "description": "LowQuery: a lightweight multi-database SQL client (Oracle and PostgreSQL).", "homepage": "https://github.com/LowBloat/LowQuery", "repository": { diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index a994d90..7036dad 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -88,15 +88,6 @@ version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" -[[package]] -name = "arbitrary" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bc62ac97cc33321f50863d514c3bc38a453947a8f9e781137e47c7401020aed" -dependencies = [ - "derive_arbitrary", -] - [[package]] name = "arc-swap" version = "1.9.3" @@ -620,6 +611,12 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600" +[[package]] +name = "cfg_aliases" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" + [[package]] name = "chacha20" version = "0.10.2" @@ -712,6 +709,15 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c" +[[package]] +name = "constant_time_eq" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9eb6feb175df65d0a3ccd3e73484e940d0ac664e8034f0519fd49a93db3071d9" +dependencies = [ + "rustversion", +] + [[package]] name = "cookie" version = "0.18.2" @@ -1078,17 +1084,6 @@ dependencies = [ "serde_core", ] -[[package]] -name = "derive_arbitrary" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b034bd7d5f032402a2479444dcc6f74e36a03f31854d41680fb240ef682a1ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 3.0.9", -] - [[package]] name = "derive_more" version = "2.1.1" @@ -1159,7 +1154,7 @@ dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -1350,7 +1345,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -1760,9 +1755,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" dependencies = [ "cfg-if", + "js-sys", "libc", "r-efi 6.0.0", "rand_core 0.10.1", + "wasm-bindgen", ] [[package]] @@ -2666,7 +2663,7 @@ checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" [[package]] name = "lowquery" -version = "0.5.4" +version = "0.5.5" dependencies = [ "aes", "cbc", @@ -2846,7 +2843,7 @@ dependencies = [ "png 0.18.1", "serde", "thiserror 2.0.21", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -2967,6 +2964,18 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" +[[package]] +name = "nix" +version = "0.31.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf20d2fde8ff38632c426f1165ed7436270b44f199fc55284c38276f9db47c3d" +dependencies = [ + "bitflags 2.13.2", + "cfg-if", + "cfg_aliases", + "libc", +] + [[package]] name = "num-bigint" version = "0.4.8" @@ -4072,7 +4081,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -4130,7 +4139,7 @@ dependencies = [ "security-framework 3.7.0", "security-framework-sys", "webpki-root-certs", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -4680,7 +4689,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -5194,11 +5203,11 @@ dependencies = [ [[package]] name = "tauri-plugin-updater" -version = "2.14.0" +version = "2.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7259989d4fe11b2bf51f7d671642249b1837c4ae2da1430dc713ae38f98ceeec" +checksum = "d957abbcb3f9f6c76d22a3a0f012f30880640d0bccb5634d2b12a9937e4c872b" dependencies = [ - "base64 0.22.1", + "base64 0.23.1", "dirs", "flate2", "futures-util", @@ -5336,7 +5345,7 @@ dependencies = [ "getrandom 0.4.3", "once_cell", "rustix", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -5794,7 +5803,7 @@ dependencies = [ "png 0.18.1", "serde", "thiserror 2.0.21", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -5809,6 +5818,12 @@ version = "2.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86a801b3cea342a06d468c8710662aa29e5e05e4f5c0d62f00bbb7f2ad7941c2" +[[package]] +name = "typed-path" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce898823d8cd0f028662d2f349694b1af0a5cc9be83f1d213a00d3147445e1e" + [[package]] name = "typeid" version = "1.0.3" @@ -5829,7 +5844,7 @@ checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e" dependencies = [ "memoffset", "tempfile", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -6252,7 +6267,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -6287,7 +6302,7 @@ dependencies = [ "objc2-foundation", "objc2-quartz-core", "raw-window-handle", - "windows-sys 0.61.2", + "windows-sys 0.60.2", "windows-version", ] @@ -6668,7 +6683,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d6f32a0ff4a9f6f01231eb2059cc85479330739333e0e58cadf03b6af2cca10" dependencies = [ "cfg-if", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -6965,14 +6980,20 @@ dependencies = [ [[package]] name = "zip" -version = "4.6.1" +version = "9.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caa8cd6af31c3b31c6631b8f483848b91589021b28fffe50adada48d4f4d2ed1" +checksum = "e3476fd497ac8af5b1ec7b51acab7bef380f7e8dd8e0487595bafd839417a302" dependencies = [ - "arbitrary", + "constant_time_eq", "crc32fast", + "getrandom 0.4.3", "indexmap 2.14.2", + "libc", "memchr", + "nix", + "typed-path", + "windows-sys 0.61.2", + "zeroize", ] [[package]] diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 61b2cd6..6136938 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lowquery" -version = "0.5.4" +version = "0.5.5" description = "Lightweight SQL client for multiple databases" authors = ["LowBloat"] license = "AGPL-3.0-only" diff --git a/src-tauri/src/updates.rs b/src-tauri/src/updates.rs index d8b6c34..35a9829 100644 --- a/src-tauri/src/updates.rs +++ b/src-tauri/src/updates.rs @@ -1,9 +1,11 @@ //! Update policy: which installations can update themselves. //! -//! Windows installers (NSIS/MSI), macOS app bundles and writable AppImages -//! download the signed update, install it and restart. Linux packages -//! (.deb/.rpm) belong to the system package manager and portable copies have -//! no installer, so they are only told a new version exists. +//! Windows installers (NSIS/MSI), macOS app bundles, writable AppImages and +//! .deb/.rpm installs download the signed update, install it and restart. For +//! .deb and .rpm the updater hands the new package to dpkg/rpm through pkexec, +//! which asks for the administrator password. The Arch package (pacman owns +//! it) and portable copies have no installer, so they are only told a new +//! version exists. use serde::Serialize; @@ -33,15 +35,36 @@ impl UpdatePolicy { target: Some(format!("linux-{}-appimage", std::env::consts::ARCH)), }; } - let channel = match bundle { - Some(BundleType::Deb) => "deb", - Some(BundleType::Rpm) => "rpm", - _ if std::env::current_exe() - .is_ok_and(|p| p.starts_with("/usr") || p.starts_with("/opt")) => + let exe = std::env::current_exe().ok(); + // The updater picks dpkg or rpm from the bundle type built into the + // binary; only trust it when that package manager really owns this + // file (a binary copied into the Arch package keeps a marker too). + let package = match bundle { + Some(BundleType::Deb) + if exe + .as_deref() + .is_some_and(|p| owned_by(p, "dpkg-query", "-S")) => { - "package" + Some("deb") } - _ => "portable", + Some(BundleType::Rpm) + if exe.as_deref().is_some_and(|p| owned_by(p, "rpm", "-qf")) => + { + Some("rpm") + } + _ => None, + }; + if let Some(channel) = package { + return Self { + channel, + can_install: true, + target: Some(format!("linux-{}-{channel}", std::env::consts::ARCH)), + }; + } + let channel = if exe.is_some_and(|p| p.starts_with("/usr") || p.starts_with("/opt")) { + "package" + } else { + "portable" }; return Self { channel, @@ -64,6 +87,17 @@ impl UpdatePolicy { } } +/// Whether `program` (dpkg-query -S, rpm -qf) names a package that installed `path`. +fn owned_by(path: &std::path::Path, program: &str, flag: &str) -> bool { + std::process::Command::new(program) + .arg(flag) + .arg(path) + .stdout(std::process::Stdio::null()) + .stderr(std::process::Stdio::null()) + .status() + .is_ok_and(|status| status.success()) +} + fn dir_is_writable(dir: &std::path::Path) -> bool { let probe = dir.join(format!(".lowquery-update-check-{}", std::process::id())); let ok = std::fs::write(&probe, b"").is_ok(); diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 2aec2b6..c6db27e 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "LowQuery", - "version": "0.5.4", + "version": "0.5.5", "identifier": "dev.lowbloat.lowquery", "build": { "beforeDevCommand": "bun run dev", diff --git a/src/lib/components/Sidebar.svelte b/src/lib/components/Sidebar.svelte index a8f7696..dd423ed 100644 --- a/src/lib/components/Sidebar.svelte +++ b/src/lib/components/Sidebar.svelte @@ -331,10 +331,10 @@