readest/apps/readest-app/src-tauri/appimage
Huang Xin 010adb4879
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (rust) (push) Waiting to run
Publish Docker image / build (linux/amd64, ubuntu-latest) (push) Waiting to run
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm) (push) Waiting to run
Publish Docker image / merge (push) Blocked by required conditions
Build with Nix / tests (push) Waiting to run
PR checks / nix_flake_check (push) Waiting to run
PR checks / rust_lint (push) Waiting to run
PR checks / koplugin_rust_lint (push) Waiting to run
PR checks / build_web_app (push) Waiting to run
PR checks / test_web_app (1) (push) Waiting to run
PR checks / test_web_app (2) (push) Waiting to run
PR checks / test_extensions (push) Waiting to run
PR checks / build_tauri_app (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
fix(ci): bundle the audio libraries the CEF AppImage dlopens (#6108)
* fix(ci): bundle the audio libraries the CEF AppImage dlopens

TTS runs to completion in the AppImage but nothing is audible: Chromium
reaches its audio backend through dlopen, and the bundle carries none of
it. libpulse.so.0 resolves to the host copy and fails against the
bundled glibc 2.35 (host libpulsecommon needs GLIBC_2.38), and the ALSA
fallback dies the same way — its `default` PCM is a config hook that
loads the host's libasound_module_conf_pulse.so, so snd_pcm_open()
returns "Unknown PCM default" and only a raw hw: device opens, which
Chromium will not use. libspeechd.so.2 fails identically, leaving the
Web Speech engine with no system voices.

Stage all three through the same appimage.files channel as the NSS
modules (#6101). quick-sharun then pulls the rest of the closure
(libsndfile, FLAC, vorbis, opus, ogg, asyncns...) from the runner by ldd.
libpulse keeps its private half in <triple>/pulseaudio/ and finds it by
RUNPATH, which points at the host directory: verified that the private
lib is deployed to lib/pulseaudio/ and that lib.path gains `+/pulseaudio`
so sharun's library path wins over the RUNPATH, and the guard now checks
both.

Verified against the shipped 0.12.6-2026090706 bundle on glibc 2.41: in
its runtime environment dlopen of libpulse/libpipewire/libspeechd fails
and ALSA has no usable PCM, while staging these libraries makes dlopen
succeed and a tone play through PipeWire's PulseAudio server.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(linux): stop the AppImage asking for a root password (#6110)

Every new AppImage pops a modal on first launch and asks for the root
password through pkexec. That is the bundler's fix-namespaces.hook: on
distros that restrict unprivileged user namespaces (Ubuntu 24.04+) it
offers to install an AppArmor profile granting `userns`, and since the
profile it writes is keyed to the AppImage's exact path, every nightly
asks again.

Readest never needs that capability. tauri-runtime-cef sets
CefSettings.no_sandbox unless its `sandbox` feature is enabled, and this
build compiles it without: every Chromium child of the shipped AppImage
runs `--type=zygote --no-sandbox`, and the app starts fine on a machine
where `unshare -Urm` is denied and no profile is installed. The hook is
boilerplate for Chromium apps that do sandbox; here it buys a root
prompt and nothing else.

Ship an AppRun hook that sorts ahead of it and stubs the two helpers it
prompts through — both come from AppRun.lib and have no other callers in
the bundle, so the rest of that hook still runs, it just cannot reach
the user. Verified against the shipped 0.12.6-2026090706 bundle: stock
hooks block startup on the dialog (three lines of log, app never comes
up), with this hook the app starts normally and no zenity or pkexec
process appears. Also verified in a jammy container that a file shipped
through appimage.files survives quick-sharun and lands in bin/ ahead of
the bundler's own hooks.

The entry lives in tauri.conf.json rather than the workflows so local
Linux builds get it too; the CI staging step now merges into that map
instead of replacing it.

This leaves the AppImage exactly as sandboxed as it is today, which is
also what the WebKitGTK builds before it were — Tauri never enabled
WebKit's sandbox either. Sandboxing the renderer on Linux is a separate
change: it needs the CEF `sandbox` feature plus /etc/apparmor.d/readest
shipped in deb/rpm, and this hook would then have to go.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>

* ci: pin down the quick-sharun regression behind the AppImage staging

The staging comment blamed drift — a fork "~1100 lines behind upstream"
that "expands its deployment array without eval". The gap is real but
not the cause. The fork's HEAD, FabianLars/Anylinux-AppImages@3e280d1b
"fix handling of spaces in input paths", is a deliberate one-line change:

    eval set -- "$TO_DEPLOY_ARRAY" "$@"   ->   set -- $TO_DEPLOY_ARRAY "$@"

Upstream's line really does split positional paths on spaces, and tauri
names the AppDir after the product, so the change fixed something. But
the array entries come single-quoted from _save_array, so without the
eval each keeps its literal quotes, fails `[ -f ]`, and every DEPLOY_*
extra is silently skipped. Measured in a dash one-liner: upstream splits
"My App/libfoo.so" into two arguments, the fork keeps the array entry as
'/path/libextra.so' quotes and all, and quoting the positional args
through the same helper — eval set -- "$TO_DEPLOY_ARRAY"
"$(_save_array "$@")" — keeps both.

Record that, and the two things upstream review pointed out: pulse is
already implied by DEPLOY_CHROMIUM through DEPLOY_PIPEWIRE, so the
libpulse entry turns redundant the moment the fork's main is fixed (the
CLI re-fetches it on every build), and libpipewire is not needed for
audio at all, only for the screen-share portal, so it stays out.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* ci(linux): build the CEF tauri CLI from readest/tauri with pkgforge pinned

The published @tauri-apps/cli-cef (3.0.0-alpha.26) bundles the AppImage
with a fork of quick-sharun whose deployment array is broken, and it
re-downloads that fork on every build with no way to point it anywhere
else - no env var, no mirror (TAURI_BUNDLER_TOOLS_GITHUB_MIRROR only
rewrites github.com URLs), and no cache seeding, since the guard that
made the pre-#6074 seed work is commented out.

Build the CLI on the Linux legs from readest/tauri@c62e9f90 instead, the
way the workflow did until #6074: there sharun_cef.rs fetches
pkgforge-dev/Anylinux-AppImages at facb95e8 verified by SHA-256 (the
revision tauri-apps/tauri#12491 pins), runs the tooling with bash and
streamed output, passes the deploy list as arguments, keeps whitespace
out of the AppDir name, and adds no fix-namespaces hook. Pinned to a
rev so a release cannot change behaviour under us; rust-cache keeps
~/.cargo/bin and a marker file skips the rebuild while the pin holds.
scripts/tauri.mjs runs `cargo tauri` when TAURI_CEF_CARGO=1, with the
same command line as the npm CLI.

STRACE_MODE stays off in this step; the hang it works around is fixed
by the bash/streamed-output change, but lifting it is its own change.
The hand-staged NSS and audio entries stay too, until a nightly built
this way confirms the tooling deploys them itself.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* ci: trim the AppImage comments to the essentials

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 12:12:02 +02:00
..
00-no-userns-prompt.hook fix(ci): bundle the audio libraries the CEF AppImage dlopens (#6108) 2026-09-07 12:12:02 +02:00