Skip to content

Electron Fuses for raxmlGUI #360

Done

Description

@jtklein-agents

Question

Which Electron Fuses can electron-builder 26 set at pack time, and which are safe for this app: it spawns bundled RAxML binaries from static/bin, ships universal macOS builds with mergeASARs: false, reads __static, and auto-updates via electron-updater. Any interaction between ASAR integrity / OnlyLoadAppFromAsar and universal builds or the e2e launch in e2e/?

Activity

  1. added
    wayfinder:research
    on Nov 24, 2026
  2. jtklein-agents commented on Nov 24, 2026

    @jtklein-agents
    OwnerAuthor

    Answer

    electron-builder 26 sets fuses through the electronFuses config key (added in 26.0.0-alpha.2). It flips them after afterPack and right before signing. For arch: universal it flips them once, on the merged app. The repo's electron-builder 24.13.3 has no such key, so this waits for the 24 to 26 upgrade.

    Fuse (electronFuses key) What it does raxmlGUI
    runAsNode Honors ELECTRON_RUN_AS_NODE. Off breaks fork. false: safe. Binaries run through execFile, and nothing uses fork, including electron-updater.
    enableCookieEncryption Encrypts cookies with OS keys. One-way. true: safe, but low value (no cookies). Never flip it back.
    enableNodeOptionsEnvironmentVariable Honors NODE_OPTIONS and NODE_EXTRA_CA_CERTS. false: safe.
    enableNodeCliInspectArguments Honors --inspect* and SIGUSR1. false: safe for shipped builds. Playwright always passes --inspect=0, so a fused build can't be driven by e2e. Current e2e runs the unfused dev binary on out/main/index.js, so it is unaffected.
    enableEmbeddedAsarIntegrityValidation Validates the app.asar header hash. A mismatch kills the app. true: safe on eb 26. eb 26 writes the hash for mac and win. For the universal build, @electron/universal rehashes every asar in Resources into Info.plist. Linux: no effect.
    onlyLoadAppFromAsar Loads only app.asar. true: safe (asar is on). Integrity needs it.
    loadBrowserProcessSpecificV8Snapshot Custom main-process snapshot. Leave unset.
    grantFileProtocolExtraPrivileges Extra privileges for file:// pages. Leave enabled for now. The renderer is Vite ES modules loaded from file://. Whether they load with this fuse off is untested, so it needs a packaged smoke test first.
    wasmTrapHandlers WASM bounds trapping. No eb 26 key. Leave it at the default.

    Universal with mergeASARs: false: if the x64 and arm64 asars are the same, the build keeps one app.asar. If they differ, it writes app-x64.asar and app-arm64.asar plus a shim app.asar. All of them get integrity entries, so integrity and onlyLoadAppFromAsar still hold. static/bin sits outside the asar (extraResources): no fuse affects execFile on it, and integrity does not cover it (the macOS code signature does). electron-updater: Squirrel.Mac checks the signature, and the fuses are inside the signed binary. The RC check should run npx @electron/fuses read --app … after the auto-update.

    Suggested config: runAsNode:false, enableCookieEncryption:true, enableNodeOptionsEnvironmentVariable:false, enableNodeCliInspectArguments:false, enableEmbeddedAsarIntegrityValidation:true, onlyLoadAppFromAsar:true. This matches the Electron Forge template defaults.

    New open question (unrelated to fuses): electron.vite.config.js sets __static to an absolute build-machine path. In a packaged app, binaryDir may then point at the CI checkout instead of Resources/static/bin. This needs checking on a packaged build.

    Sources: electronjs.org fuses and asar-integrity; electron-builder v26.0.20 source (configuration.ts, platformPackager.ts, macPackager.ts, electronMac.ts, electronWin.ts) and its CHANGELOG; @electron/universal v2.0.3 (index.ts, integrity.ts, has-asar.ts); Forge vite template; playwright-core electron.ts.

    Full notes: https://github.com/jtklein-agents/raxmlGUI/blob/research/electron-fuses/docs/research/electron-fuses.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

wayfinder:research

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions