Fuse electron at build time
This commit is contained in:
parent
770c80b9ee
commit
9e9e5274cf
6 changed files with 74 additions and 33 deletions
|
@ -1,26 +0,0 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
const { flipFuses, FuseVersion, FuseV1Options } = require('@electron/fuses');
|
||||
|
||||
const IS_RELEASE_BUILD = process.argv.some(argv => argv === '--release');
|
||||
|
||||
flipFuses(require('electron'), {
|
||||
version: FuseVersion.V1,
|
||||
// Disables ELECTRON_RUN_AS_NODE
|
||||
[FuseV1Options.RunAsNode]: false,
|
||||
// Enables cookie encryption
|
||||
[FuseV1Options.EnableCookieEncryption]: true,
|
||||
// Disables the NODE_OPTIONS environment variable
|
||||
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: !IS_RELEASE_BUILD,
|
||||
// Disables the --inspect and --inspect-brk family of CLI options
|
||||
[FuseV1Options.EnableNodeCliInspectArguments]: !IS_RELEASE_BUILD,
|
||||
// Enables validation of the app.asar archive on macOS
|
||||
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
|
||||
// Enforces that Electron will only load your app from "app.asar" instead of
|
||||
// it's normall search paths
|
||||
[FuseV1Options.OnlyLoadAppFromAsar]: IS_RELEASE_BUILD,
|
||||
}).catch(error => {
|
||||
console.error(error.stack);
|
||||
process.exit(1);
|
||||
});
|
|
@ -25,5 +25,3 @@ exports.beforeBuild = async () => {
|
|||
// Let electron-builder handle dependencies
|
||||
return true;
|
||||
};
|
||||
|
||||
exports.beforeBuild();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue