Skip to content

Commit

Permalink
ref: Cleanup forge config
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertGemmaJr committed May 17, 2024
1 parent 0ec443c commit 65fba7c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
shell: bash

# Upload installers to GitHub release
# TODO: Use the Publish command: https://www.electronforge.io/cli#publish
# TODO @brown-ccv #247: Use the Publish command: https://www.electronforge.io/cli#publish
- name: ⬆ Upload installer to release - Windows
if: startsWith(matrix.os, 'windows')
uses: svenstaro/upload-release-action@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/workflow-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
shell: bash

# Upload installers to github action
# TODO @RobertGemmaJr: Can we use the publish command here?
# TODO @brown-ccv #247: Can we use the publish command here?
- name: ⬆ Upload installer - Windows
uses: actions/upload-artifact@v3
if: startsWith(matrix.os, 'windows')
Expand Down
27 changes: 14 additions & 13 deletions forge.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { FusesPlugin } from "@electron-forge/plugin-fuses";
import { FuseV1Options, FuseVersion } from "@electron/fuses";

/** Configuration file for Electron Forge */
Expand Down Expand Up @@ -52,17 +51,19 @@ export default {
renderer: [{ name: "main_window", config: "vite.renderer.config.js" }],
},
},
// Fuses are used to enable/disable various Electron functionality at package time, before code signing the application
new FusesPlugin({
version: FuseVersion.V1,
[FuseV1Options.RunAsNode]: false, // Disables ELECTRON_RUN_AS_NODE
[FuseV1Options.GrantFileProtocolExtraPrivileges]: true, // Grants the file protocol extra privileges (for the built application)
[FuseV1Options.EnableCookieEncryption]: false, // Disables cookie encryption
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false, // Disables the NODE_OPTIONS environment variable
[FuseV1Options.EnableNodeCliInspectArguments]: false, // Disables the --inspect and --inspect-brk family of CLI options
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true, // Enforces validation of the app.asar archive on macOS
[FuseV1Options.OnlyLoadAppFromAsar]: true, // Enforces that Electron will only load your app from "app.asar" instead of its normal search paths
[FuseV1Options.LoadBrowserProcessSpecificV8Snapshot]: true, // Loads V8 Snapshot from `browser_v8_context_snapshot.bin` for the browser process
}),
{
name: "@electron-forge/plugin-fuses",
config: {
version: FuseVersion.V1,
[FuseV1Options.RunAsNode]: false, // Disables ELECTRON_RUN_AS_NODE
[FuseV1Options.GrantFileProtocolExtraPrivileges]: true, // Grants the file protocol extra privileges (for the built application)
[FuseV1Options.EnableCookieEncryption]: false, // Disables cookie encryption
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false, // Disables the NODE_OPTIONS environment variable
[FuseV1Options.EnableNodeCliInspectArguments]: false, // Disables the --inspect and --inspect-brk family of CLI options
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true, // Enforces validation of the app.asar archive on macOS
[FuseV1Options.OnlyLoadAppFromAsar]: true, // Enforces that Electron will only load your app from "app.asar" instead of its normal search paths
[FuseV1Options.LoadBrowserProcessSpecificV8Snapshot]: true, // Loads V8 Snapshot from `browser_v8_context_snapshot.bin` for the browser process
},
},
],
};

0 comments on commit 65fba7c

Please sign in to comment.