Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/scripts/test_update_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@ def test_linux_downloads_stay_in_their_format(self):
}
for filename in filenames.values():
(assets / filename).touch()
(assets / f"{filenames['appimage']}.sig").write_text("signature")
for signed_format in ["appimage", "deb", "rpm"]:
(assets / f"{filenames[signed_format]}.sig").write_text("signature")
doc = build_manifest("0.2.7", "LowBloat/LowNotes", assets, "Notes")
self.assertEqual(list(doc["platforms"]), ["linux-x86_64-appimage"])
self.assertEqual(sorted(doc["platforms"]),
["linux-x86_64-appimage", "linux-x86_64-deb", "linux-x86_64-rpm"])
self.assertNotIn("linux-x86_64", doc["platforms"])
for signed_format in ["appimage", "deb", "rpm"]:
self.assertEqual(doc["platforms"][f"linux-x86_64-{signed_format}"]["url"],
f"https://github.com/LowBloat/LowNotes/releases/download/v0.2.7/{filenames[signed_format]}")
for package_format, filename in filenames.items():
self.assertEqual(doc["downloads"][f"linux-x86_64-{package_format}"],
f"https://github.com/LowBloat/LowNotes/releases/download/v0.2.7/{filename}")
Expand Down
5 changes: 4 additions & 1 deletion .github/scripts/update_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ def signed(key, asset):
signed("windows-x86_64", f"LowNotes-{version}-windows-x64-setup.exe")
signed("darwin-aarch64", f"LowNotes-{version}-macos-universal.app.tar.gz")
signed("darwin-x86_64", f"LowNotes-{version}-macos-universal.app.tar.gz")
# Never publish a generic Linux target: native packages must not receive AppImages.
# 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"LowNotes-{version}-linux-x64.AppImage")
signed("linux-x86_64-deb", f"LowNotes-{version}-linux-x64.deb")
signed("linux-x86_64-rpm", f"LowNotes-{version}-linux-x64.rpm")
for package_format, asset in {
"appimage": f"LowNotes-{version}-linux-x64.AppImage",
"deb": f"LowNotes-{version}-linux-x64.deb",
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ jobs:
dest_deb="LowNotes-${VERSION}-linux-x64.deb"
cp "$deb_file" "dist/$dest_deb"
(cd dist && sha256sum "$dest_deb" > "$dest_deb.sha256")
# Updater signature: .deb installs update themselves through dpkg.
cp "$deb_file.sig" "dist/$dest_deb.sig"
fi

# Coletar .rpm
Expand All @@ -192,6 +194,8 @@ jobs:
dest_rpm="LowNotes-${VERSION}-linux-x64.rpm"
cp "$rpm_file" "dist/$dest_rpm"
(cd dist && sha256sum "$dest_rpm" > "$dest_rpm.sha256")
# Updater signature: .rpm installs update themselves through rpm.
cp "$rpm_file.sig" "dist/$dest_rpm.sig"
fi

# Coletar .AppImage
Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ Releases up to 0.3.5 are described on the [GitHub releases page](https://github.

## [Unreleased]

## [0.5.2] - 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 and it was built as that package, the update installs the new package itself (pkexec asks for the administrator password), like Windows, macOS and the AppImage. The Arch package, Flatpak, Snap 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 shows the dialog, whose **Restart now** installs it right away. Each version is announced once instead of at every check.

## [0.5.1] - 2026-11-10

### Changed
Expand Down Expand Up @@ -97,7 +103,8 @@ Releases up to 0.3.5 are described on the [GitHub releases page](https://github.
- Dependency updates: Tauri plugins, iroh 1.3, rusqlite 0.40, base64 0.23, html-escape 0.3 and GitHub Actions.
- Community, security and design documentation ([#32](https://github.com/LowBloat/LowNotes/issues/32), [#33](https://github.com/LowBloat/LowNotes/issues/33)).

[Unreleased]: https://github.com/LowBloat/LowNotes/compare/v0.5.1...HEAD
[Unreleased]: https://github.com/LowBloat/LowNotes/compare/v0.5.2...HEAD
[0.5.2]: https://github.com/LowBloat/LowNotes/compare/v0.5.1...v0.5.2
[0.5.1]: https://github.com/LowBloat/LowNotes/compare/v0.5.0...v0.5.1
[0.5.0]: https://github.com/LowBloat/LowNotes/compare/v0.4.2...v0.5.0
[0.4.2]: https://github.com/LowBloat/LowNotes/compare/v0.4.1...v0.4.2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ In-app updates are signed separately and verified before installation.

When you close the window, the app stays in the system tray by default. Opening LowNotes again shows and focuses the existing window, restoring it if minimized. Only one instance runs at a time. You can change the close-to-tray behavior in **Settings → General**; the tray menu also lets you quit completely.

On Linux, updates follow the installation format. Arch, DEB and RPM packages show a new-version notice with a download for the matching package; install it through pacman, APT or your RPM package manager. Repository, AUR, Flatpak and Snap installations should be updated through their original source when the new version becomes available there. Portable `.tar.gz` installations require replacing the application files manually. Only unmanaged AppImages in a writable folder update inside LowNotes. Native packages never replace their executable with an AppImage.
LowNotes checks for a new version every few minutes and when its window regains focus, downloads it in the background and then asks to restart. On Linux, updates follow the installation format. DEB and RPM packages installed from the release files update inside LowNotes with a package of the same format (dpkg or rpm installs it after the administrator password prompt), and unmanaged AppImages in a writable folder replace themselves. The Arch package shows a new-version notice with a download for the matching package; install it with pacman. Repository, AUR, Flatpak and Snap installations should be updated through their original source when the new version becomes available there. Portable `.tar.gz` installations require replacing the application files manually. Native packages never replace their executable with an AppImage.

## What the app offers

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lownotes",
"version": "0.5.1",
"version": "0.5.2",
"description": "Local-first Markdown note-taking app with encrypted P2P sync, real-time collaboration and optional AI for Windows, Linux and macOS.",
"homepage": "https://lowbloat.app/en/produtos/lownotes/",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lownotes"
version = "0.5.1"
version = "0.5.2"
description = "Local-first Markdown notes with serverless P2P sync and real-time collaboration"
authors = ["LowBloat"]
license = "AGPL-3.0-only"
Expand Down
105 changes: 90 additions & 15 deletions src-tauri/src/updates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,25 @@ pub struct UpdatePolicy {
}

impl UpdatePolicy {
fn new(channel: UpdateChannel, appimage_writable: bool, arch: &str) -> Self {
let can_install = channel == UpdateChannel::Internal
|| (channel == UpdateChannel::Appimage && appimage_writable);
/// `installable`: a writable AppImage, or a .deb/.rpm that dpkg/rpm really
/// owns and that was built as that package. Those install the signed update
/// themselves (the updater hands .deb/.rpm to dpkg/rpm through pkexec, which
/// asks for the administrator password). Arch, Flatpak, Snap and portable
/// copies are only told a new version exists.
fn new(channel: UpdateChannel, installable: bool, arch: &str) -> Self {
let format = match channel {
UpdateChannel::Appimage => Some("appimage"),
UpdateChannel::Deb => Some("deb"),
UpdateChannel::Rpm => Some("rpm"),
_ => None,
};
let can_install = channel == UpdateChannel::Internal || (format.is_some() && installable);
Self {
channel,
can_install,
updater_target: (channel == UpdateChannel::Appimage && can_install)
.then(|| format!("linux-{arch}-appimage")),
updater_target: format
.filter(|_| can_install)
.map(|format| format!("linux-{arch}-{format}")),
}
}

Expand Down Expand Up @@ -123,31 +134,56 @@ fn detect_linux_policy() -> UpdatePolicy {
}
}
}
let bundle = tauri::utils::platform::bundle_type();
let channel = linux_channel(&LinuxInstallation {
flatpak,
snap,
owner,
bundle: tauri::utils::platform::bundle_type(),
bundle: bundle.clone(),
appimage: appimage.is_some(),
system_path: executable.as_ref().is_some_and(|path| {
["/usr", "/opt", "/nix", "/app", "/snap", "/var/lib/flatpak"]
.iter()
.any(|prefix| path.starts_with(prefix))
}),
});
// Replacing an AppImage requires creating a backup in its parent directory.
// Probe this only for genuine unmanaged AppImages, never for native packages.
let writable = channel == UpdateChannel::Appimage
&& executable
let installable = match channel {
// Replacing an AppImage requires creating a backup in its parent directory.
// Probe this only for genuine unmanaged AppImages, never for native packages.
UpdateChannel::Appimage => executable
.as_ref()
.and_then(|path| path.parent())
.is_some_and(|parent| {
tempfile::Builder::new()
.prefix(".lownotes-update-check-")
.tempfile_in(parent)
.is_ok()
});
UpdatePolicy::new(channel, writable, std::env::consts::ARCH)
}),
// The updater picks dpkg or rpm from the bundle type built into the
// binary, so it must agree with the package manager that owns it.
UpdateChannel::Deb | UpdateChannel::Rpm => {
native_package_updates_itself(channel, owner, bundle)
}
_ => false,
};
UpdatePolicy::new(channel, installable, std::env::consts::ARCH)
}

/// A .deb or .rpm install updates itself only when dpkg/rpm owns the binary and
/// it was built as that same package (a binary copied elsewhere keeps its marker).
#[cfg(any(target_os = "linux", test))]
fn native_package_updates_itself(
channel: UpdateChannel,
owner: Option<UpdateChannel>,
bundle: Option<tauri::utils::config::BundleType>,
) -> bool {
use tauri::utils::config::BundleType;
owner == Some(channel)
&& matches!(
(channel, bundle),
(UpdateChannel::Deb, Some(BundleType::Deb))
| (UpdateChannel::Rpm, Some(BundleType::Rpm))
)
}

#[derive(Debug, Deserialize)]
Expand Down Expand Up @@ -234,11 +270,50 @@ mod tests {
use tauri::utils::config::BundleType;

#[test]
fn native_packages_and_sandboxes_never_install_internally() {
for channel in [
UpdateChannel::Arch,
fn deb_and_rpm_install_their_own_format_when_installable() {
for (channel, format) in [(UpdateChannel::Deb, "deb"), (UpdateChannel::Rpm, "rpm")] {
let policy = UpdatePolicy::new(channel, true, "x86_64");
assert!(policy.can_install);
assert_eq!(
policy.updater_target.as_deref(),
Some(format!("linux-x86_64-{format}").as_str())
);
let unowned = UpdatePolicy::new(channel, false, "x86_64");
assert!(!unowned.can_install);
assert!(unowned.updater_target.is_none());
}
assert!(native_package_updates_itself(
UpdateChannel::Deb,
Some(UpdateChannel::Deb),
Some(BundleType::Deb)
));
assert!(native_package_updates_itself(
UpdateChannel::Rpm,
Some(UpdateChannel::Rpm),
Some(BundleType::Rpm)
));
// Not owned by the package manager, or built as another format.
assert!(!native_package_updates_itself(
UpdateChannel::Deb,
None,
Some(BundleType::Deb)
));
assert!(!native_package_updates_itself(
UpdateChannel::Deb,
Some(UpdateChannel::Deb),
Some(BundleType::Rpm)
));
assert!(!native_package_updates_itself(
UpdateChannel::Rpm,
Some(UpdateChannel::Rpm),
None
));
}

#[test]
fn other_packages_and_sandboxes_never_install_internally() {
for channel in [
UpdateChannel::Arch,
UpdateChannel::Flatpak,
UpdateChannel::Snap,
UpdateChannel::Portable,
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "LowNotes",
"version": "0.5.1",
"version": "0.5.2",
"identifier": "dev.lowbloat.lownotes",
"build": {
"beforeDevCommand": "bun run icons && bun run dev",
Expand Down
13 changes: 12 additions & 1 deletion src/lib/components/UpdateModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@
let received = 0;
const total = installer.contentLength ?? 0;
try {
if (update.downloaded) {
// Already downloaded and verified in the background.
phase = 'installing';
await installer.install();
await relaunch();
return;
}
await installer.downloadAndInstall((event: DownloadEvent) => {
if (event.event === 'Progress') {
received += event.data.chunkLength;
Expand Down Expand Up @@ -149,6 +156,10 @@
<div class="px-6 py-4 border-t border-[var(--border)]">
<p class="text-xs text-[var(--text-main)] leading-relaxed">{$t(updateInstructionKey(policy))}</p>
</div>
{:else if update.downloaded && phase === 'idle'}
<div class="px-6 py-4 border-t border-[var(--border)]">
<p class="text-xs text-[var(--text-main)] leading-relaxed">{$t('update.readyHint')}</p>
</div>
{/if}

{#if phase === 'downloading' || phase === 'installing' || phase === 'error'}
Expand Down Expand Up @@ -212,7 +223,7 @@
disabled={phase === 'downloading' || phase === 'installing'}
class="px-4 py-1.5 bg-[var(--accent)] hover:bg-[var(--accent-hover)] disabled:opacity-50 text-[var(--accent-contrast)] text-xs font-semibold rounded-lg shadow-md transition"
>
{$t('update.installNow')}
{$t(update.downloaded ? 'update.restartNow' : 'update.installNow')}
</button>
{:else if update.download_url}
<button
Expand Down
2 changes: 2 additions & 0 deletions src/lib/i18n/locales/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,8 @@ const enUS = {
later: 'Later',
autoCheck: 'Check for updates automatically',
installNow: 'Update now',
restartNow: 'Restart now',
readyHint: 'The update is downloaded and verified. Restarting installs it.',
downloadMatching: 'Download update',
archHint: 'Installed as an Arch package. Download the new .pkg.tar.zst and install it with pacman -U. If the package comes from a repository or the AUR, update it there.',
debHint: 'Installed as a DEB package. Download the new .deb and install it with apt install ./file.deb. If the package comes from a repository, update it through APT.',
Expand Down
2 changes: 2 additions & 0 deletions src/lib/i18n/locales/es-ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,8 @@ const esES: Dictionary = {
later: 'Más tarde',
autoCheck: 'Buscar actualizaciones automáticamente',
installNow: 'Actualizar ahora',
restartNow: 'Reiniciar ahora',
readyHint: 'La actualización ya se descargó y verificó. Al reiniciar, se instala.',
downloadMatching: 'Descargar actualización',
archHint: 'Instalado como paquete Arch. Descarga el nuevo .pkg.tar.zst e instálalo con pacman -U. Si el paquete proviene de un repositorio o de AUR, actualízalo allí.',
debHint: 'Instalado como paquete DEB. Descarga el nuevo .deb e instálalo con apt install ./archivo.deb. Si proviene de un repositorio, actualízalo mediante APT.',
Expand Down
2 changes: 2 additions & 0 deletions src/lib/i18n/locales/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,8 @@ const ptBR: Dictionary = {
later: 'Mais tarde',
autoCheck: 'Buscar atualizações automaticamente',
installNow: 'Atualizar agora',
restartNow: 'Reiniciar agora',
readyHint: 'A atualização já foi baixada e verificada. Ao reiniciar, ela é instalada.',
downloadMatching: 'Baixar atualização',
archHint: 'Instalado como pacote Arch. Baixe o novo .pkg.tar.zst e instale com pacman -U. Se o pacote vier de um repositório ou do AUR, atualize por ele.',
debHint: 'Instalado como pacote DEB. Baixe o novo .deb e instale com apt install ./arquivo.deb. Se o pacote vier de um repositório, atualize pelo APT.',
Expand Down
Loading
Loading