Skip to content

Linux appimage installer#701

Merged
charlypa merged 2 commits into
mainfrom
linux-appimage-installer
May 12, 2026
Merged

Linux appimage installer#701
charlypa merged 2 commits into
mainfrom
linux-appimage-installer

Conversation

@charlypa
Copy link
Copy Markdown
Contributor

@charlypa charlypa commented May 12, 2026

No description provided.

charlypa added 2 commits May 12, 2026 15:20
Replace the GLIBC-versioned tar.gz + bundled GTK/WebKit2GTK installer
with a single AppImage flow driven by the Tauri-format update JSON.

Probe-driven dependency install:
- After download, probe the AppImage with --no-sandbox --version. If it
  exits cleanly, system libraries are sufficient and apt/dnf/pacman is
  skipped entirely.
- gnome-keyring daemon presence checked independently (binary check;
  --version doesn't exercise keytar).
- AppArmor profile presence checked independently (Ubuntu 24.04+ /
  Debian 13+ where unprivileged user namespaces are restricted).
- Each probe gates its own install step, so sudo is only requested for
  pieces actually missing.

Cross-distro robustness:
- apt-cache probe picks libfuse2 (Ubuntu 20.04-22.04, Debian 11-12,
  Mint 20-21, Neon 22) vs libfuse2t64 (Noble+, Trixie+, Kali, Mint 22+).
- KDE sessions skip gnome-keyring to avoid the kwallet/Secret Service
  D-Bus race.
- RHEL 10's missing libXScrnSaver is intentionally not requested
  (Wayland-only; Electron no-ops gracefully).
- Arch gets libxss + libnotify explicitly (not pulled by gtk3).

Wrapper script (~/.local/bin/phcode) handles runtime failure modes:
- Falls back to --appimage-extract-and-run on FUSE errors.
- Falls back to --no-sandbox on userns/AppArmor errors.

Other UX improvements:
- SIGINT/SIGTERM trap so Ctrl+C cleans up the tmpdir and exits 130.
- apt-get install uses --force-confdef/--force-confold + DEBIAN_FRONTEND
  so an unrelated pending upgrade can't trigger config-file prompts.
- Replaced the `yes | sudo apt install` pipeline that silently aborted
  the script under set -o pipefail when yes died of SIGPIPE.
- AppArmor profile preserved across reinstall and --upgrade (only
  removed by explicit --uninstall) so routine version bumps don't need
  sudo just to recreate the same profile content.
- Post-install hint when the keyring is locked (autologin sessions)
  explaining the one-time unlock prompt users will see.

Removed dead code: check_os_version, download_and_install_gtk,
create_launch_script_with_gtk, the GLIBC-version search loop in
downloadAndInstall.
Phoenix Code's Electron renderer is already locked down (contextIsolation
+ nodeIntegration:false + local-only phtauri:// protocol). The kernel-side
AppArmor profile only adds defense-in-depth against renderer V8 RCE →
raw-syscall escape, which is a narrow class. The IPC-bridge attack surface
(electronFSAPI, keytar via electronAPI) is not gated by the kernel sandbox
either way. Removing the profile install matches what every other Electron
AppImage in the wild does (Cursor, Obsidian, Discord, VSCode-AppImage),
removes ~70 LOC, and stops requesting sudo to write under /etc/.

Wrapper-script fallbacks stay (verified load-bearing by reading Chromium
and AppImage type-2 runtime source):

- Sandbox: Chromium LOG(FATAL)s when AppArmor blocks the userns clone on
  Ubuntu 24.04+ / Debian 13+; it does NOT auto-fall-back. Our --no-sandbox
  re-exec is the actual recovery and now the only one.
- FUSE: the AppImage runtime self-recovers only when libfuse.so.2 can't
  dlopen; when /dev/fuse is missing or fusermount is denied (Docker/Podman
  containers, older WSL2, SELinux-restricted kernels), it prints
  "Cannot mount AppImage, please check your FUSE setup" and exits. Our
  --appimage-extract-and-run re-exec is the recovery.

Wrapper regex tightened:

- Drop `dlopen` from the FUSE branch (too broad, could match unrelated
  library-load failures and route them into a useless retry).
- Add `Check failed` to the sandbox branch to catch Chromium's actual
  NamespaceSandbox / SUID-helper FATAL phrasing.

uninstall() reverted to a single behavior (the keep_apparmor mode arg
is no longer needed since there's no profile to preserve).
@sonarqubecloud
Copy link
Copy Markdown

@charlypa charlypa merged commit 188d8e4 into main May 12, 2026
3 of 6 checks passed
@charlypa charlypa deleted the linux-appimage-installer branch May 12, 2026 18:51
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