diff --git a/ui/desktop/electron-app/config/app-icons/icon.icns b/ui/desktop/electron-app/assets/app-icons/icon.icns similarity index 100% rename from ui/desktop/electron-app/config/app-icons/icon.icns rename to ui/desktop/electron-app/assets/app-icons/icon.icns diff --git a/ui/desktop/electron-app/config/macos/background.png b/ui/desktop/electron-app/assets/macos/background.png similarity index 100% rename from ui/desktop/electron-app/config/macos/background.png rename to ui/desktop/electron-app/assets/macos/background.png diff --git a/ui/desktop/electron-app/config/macos/background@2x.png b/ui/desktop/electron-app/assets/macos/background@2x.png similarity index 100% rename from ui/desktop/electron-app/config/macos/background@2x.png rename to ui/desktop/electron-app/assets/macos/background@2x.png diff --git a/ui/desktop/electron-app/config/macos/disk.icns b/ui/desktop/electron-app/assets/macos/disk.icns similarity index 100% rename from ui/desktop/electron-app/config/macos/disk.icns rename to ui/desktop/electron-app/assets/macos/disk.icns diff --git a/ui/desktop/electron-app/config/macos/entitlements.plist b/ui/desktop/electron-app/assets/macos/entitlements.plist similarity index 100% rename from ui/desktop/electron-app/config/macos/entitlements.plist rename to ui/desktop/electron-app/assets/macos/entitlements.plist diff --git a/ui/desktop/electron-app/config/desktop.js b/ui/desktop/electron-app/config/desktop.js index f5671fb1e..95c15ff3b 100644 --- a/ui/desktop/electron-app/config/desktop.js +++ b/ui/desktop/electron-app/config/desktop.js @@ -3,55 +3,24 @@ const path = require('path'); // Create config for use in electron forge const createConfig = () => { - const configPath = path.join(__dirname, '..', 'config'); - const macosConfigPath = path.join(configPath, 'macos'); - const appIconPath = path.join(configPath, 'app-icons', 'icon'); - const config = { name: 'boundary', productName: 'Boundary', - bundleId: 'com.electron.boundary', copyright: `Copyright © ${new Date().getFullYear()} HashiCorp, Inc.`, releaseVersion: process.env.RELEASE_VERSION, releaseCommit: process.env.RELEASE_COMMIT, - icon: appIconPath, - macos: { - hardenedRuntime: true, - entitlements: path.join(macosConfigPath, 'entitlements.plist'), - signatureFlags: 'library', - signingIdentity: process.env.BOUNDARY_DESKTOP_SIGNING_IDENTITY, - dmg: { - diskIcon: path.join(macosConfigPath, 'disk.icns'), - background: path.join(macosConfigPath, 'background.png'), - }, - }, }; - if (!config.releaseVersion) { - config.releaseVersion = '0.0.0'; - console.warn( - `[desktop-config] Release version not specified. Using: ${config.releaseVersion} instead` - ); - } - - console.log(`[desktop-config] Release commit: ${config.releaseCommit}`); - console.log(`[desktop-config] Release version: ${config.releaseVersion}`); - - // MacOS signing identity - if (!config.macos.signingIdentity) - console.warn( - '[desktop-config] WARNING: Could not find signing identity. Proceeding without signing.' - ); - + if (!config.releaseVersion) config.releaseVersion = '0.0.0'; return config; }; // Save config file const saveConfig = (config, destination) => { const configPath = `${destination}/config.js`; - console.log(`[desktop-config] Config: ${configPath}`); const content = `module.exports = ${JSON.stringify(config, null, 2)}`; fs.writeFileSync(configPath, content); + console.log(`Create: ${configPath}`); }; module.exports = { diff --git a/ui/desktop/electron-app/config/forge.config.js b/ui/desktop/electron-app/config/forge.config.js index 28af7b738..2add32d75 100644 --- a/ui/desktop/electron-app/config/forge.config.js +++ b/ui/desktop/electron-app/config/forge.config.js @@ -1,20 +1,29 @@ // Generated during build const config = require('./config.js'); +console.log(`\n[forge-config] Release commit: ${config.releaseCommit}`); +console.log(`[forge-config] Release version: ${config.releaseVersion}`); + +// MacOS signing identity +if (process.env.BOUNDARY_DESKTOP_SIGNING_IDENTITY) + console.warn( + '[forge-config] WARNING: Could not find signing identity. Proceeding without signing.' + ); + module.exports = { packagerConfig: { ignore: ['/ember-test(/|$)', '/tests(/|$)'], - icon: config.icon, + icon: './assets/app-icons/icon', name: config.productName, appVersion: config.version, - appBundleId: config.bundleId, + appBundleId: 'com.electron.boundary', appCopyright: config.copyright, osxSign: { - identity: config.macos.signingIdentity, - 'hardened-runtime': config.macos.hardenedRuntime, - entitlements: config.macos.entitlements, - 'entitlements-inherit': config.macos.entitlements, - 'signature-flags': config.macos.signatureFlags, + identity: process.env.BOUNDARY_DESKTOP_SIGNING_IDENTITY, + 'hardened-runtime': true, + entitlements: './assets/macos/entitlements.plist', + 'entitlements-inherit': './assets/macos/entitlements.plist', + 'signature-flags': 'library', }, }, makers: [ @@ -26,8 +35,8 @@ module.exports = { config: { title: config.productName, name: config.name, - icon: config.macos.dmg.diskIcon, - background: config.macos.dmg.background, + icon: './assets/macos/disk.icns', + background: './assets/macos/background.png', }, }, {