1 const { AutoUnpackNativesPlugin } = require('@electron-forge/plugin-auto-unpack-natives');
2 const { FusesPlugin } = require('@electron-forge/plugin-fuses');
3 const { WebpackPlugin } = require('@electron-forge/plugin-webpack');
4 const { MakerSquirrel } = require('@electron-forge/maker-squirrel');
5 const { MakerZIP } = require('@electron-forge/maker-zip');
6 const { MakerDMG } = require('@electron-forge/maker-dmg');
7 const { MakerDeb } = require('@electron-forge/maker-deb');
8 const { MakerRpm } = require('@electron-forge/maker-rpm');
9 const { FuseV1Options, FuseVersion } = require('@electron/fuses');
10 const mainConfig = require('./webpack.main.config');
11 const rendererConfig = require('./webpack.renderer.config');
12 const path = require('path');
13 const pkg = require('./package.json');
14 const getExtraResource = require('./src/utils/extra-resource');
16 /** @type {import('@electron-forge/shared-types').ForgeConfig} */
21 extraResource: ['assets', ...getExtraResource()],
22 appBundleId: 'me.proton.pass.electron',
23 executableName: process.platform === 'win32' ? 'ProtonPass' : 'Proton Pass',
24 // required for debian, else MakerDeb will incorrectly use name from package.json
26 appCategoryType: 'public.app-category.productivity',
29 process.env.CI || process.env.PASS_DESKTOP_NOTARIZE
31 appleId: process.env.PASS_DESKTOP_APPLE_ID,
32 appleIdPassword: process.env.PASS_DESKTOP_APPLE_ID_PASSWORD,
33 teamId: process.env.PASS_DESKTOP_APPLE_TEAM_ID,
41 loadingGif: path.join(__dirname, 'assets', 'installSpinner.gif'),
42 iconUrl: path.join(__dirname, 'assets', 'logo.ico'),
43 setupIcon: path.join(__dirname, 'assets', 'logo.ico'),
44 signWithParams: process.env.SQUIRREL_SIGNTOOL_ARGS,
45 setupExe: `ProtonPass_Setup_${pkg.version}.exe`,
47 vendorDirectory: `${__dirname}/../../packages/shared/lib/squirrel/assets`,
50 new MakerDMG((arch) => ({
51 name: `ProtonPass_${pkg.version}`,
52 background: path.join(__dirname, 'assets', 'dmg-background.png'),
53 icon: path.join(__dirname, 'assets', 'volume-icon.icns'),
59 path: `${process.cwd()}/out/Proton Pass-darwin-${arch}/Proton Pass.app`,
61 { x: 350, y: 180, type: 'link', path: '/Applications' },
63 additionalDMGOptions: {
72 // ZIP for macOS updates
75 macUpdateManifestBaseUrl: 'https://proton.me/download/PassDesktop/darwin/universal',
82 categories: ['Utility'],
83 productName: 'Proton Pass',
85 genericName: 'Password Manager',
86 productDescription: 'Open-source and secure identity manager.',
87 homepage: 'https://proton.me/pass',
88 icon: path.join(__dirname, 'assets', 'logo.svg'),
94 categories: ['Utility'],
95 productName: 'Proton Pass',
97 genericName: 'Password Manager',
98 productDescription: 'Open-source and secure identity manager.',
99 homepage: 'https://proton.me/pass',
100 icon: path.join(__dirname, 'assets', 'logo.svg'),
104 new AutoUnpackNativesPlugin({}),
106 devContentSecurityPolicy: `default-src * self blob: data: gap:; style-src * self 'unsafe-inline' blob: data: gap:; script-src * 'self' 'unsafe-eval' 'unsafe-inline' blob: data: gap:; object-src * 'self' blob: data: gap:; img-src * self 'unsafe-inline' blob: data: gap:; connect-src self * 'unsafe-inline' blob: data: gap:; frame-src * self blob: data: gap:;`,
115 config: rendererConfig,
118 html: './src/app/index.ejs',
119 js: './src/app/renderer.tsx',
122 js: './src/preload.ts',
129 version: FuseVersion.V1,
130 // Disables ELECTRON_RUN_AS_NODE
131 [FuseV1Options.RunAsNode]: false,
132 // Enables cookie encryption
133 [FuseV1Options.EnableCookieEncryption]: true,
134 // Disables the NODE_OPTIONS environment variable
135 [FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
136 // Disables the --inspect and --inspect-brk family of CLI options
137 [FuseV1Options.EnableNodeCliInspectArguments]: false,
138 // Enables validation of the app.asar archive on macOS
139 [FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
140 // Enforces that Electron will only load your app from "app.asar" instead of its normal search paths
141 [FuseV1Options.OnlyLoadAppFromAsar]: true,
142 [FuseV1Options.GrantFileProtocolExtraPrivileges]: true,
147 module.exports = config;