mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 09:20:03 +01:00
v0.4.2 set linux.executableArgs: ["--no-sandbox"] but verification on a fresh AppImage download showed it STILL crashed at FATAL setuid_sandbox_host. Inspected the generated AppRun script and confirmed the flag was missing: electron-builder only injects executableArgs into the .desktop file's Exec= line, not the AppRun. So OS-menu launches via .desktop worked but direct execution of the AppImage (double-click, ./binary from a shell, electron-updater swap) did not. Fix: a custom afterPack hook (desktop/scripts/afterPack.cjs) wraps the real Electron binary in a small shell stub that bakes --no-sandbox into argv before exec'ing the real binary. The AppRun unknowingly invokes the wrapper, which in turn invokes the real binary with the flag. This is the pattern Slack, Discord, VSCode, Cursor, and Obsidian all use. Layout in appOutDir after afterPack: fleet-runner ← bash wrapper (new, 0755) fleet-runner-bin ← real Electron binary (renamed from fleet-runner) Idempotent: skips if -bin already exists, so multi-arch builds don't double-wrap. Scoped to electronPlatformName === 'linux'. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>