From 80d6cbc07c4e9386925b473712ce76cd4357f9eb Mon Sep 17 00:00:00 2001 From: Chris Marchesi Date: Wed, 8 Sep 2021 13:56:01 -0700 Subject: [PATCH 1/3] desktop: Update README with instructions for using non-release versions This documents the use of BYPASS_CLI_SETUP to allow desktop development to use the version of Boundary manually placed in ui/desktop/electron-app/cli rather than downloading a release version. --- ui/desktop/README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/ui/desktop/README.md b/ui/desktop/README.md index 82ef7d587..c6f7f90bb 100644 --- a/ui/desktop/README.md +++ b/ui/desktop/README.md @@ -66,12 +66,23 @@ To run as a desktop app: The Boundary CLI is downloaded and extracted to `electron-app/cli/` folder as part of build. CLI version is defined in `electron-app/config/cli.js`. -#### Environment Variables +### Developing Using Non-Release Versions of Boundary + +You can also develop using a non-release version of Boundary - bypassing the +above CLI download behavior - by manually placing the version of Boundary that +you want to develop with in the `electron-app/cli/` directly (you may need to +create the directory). + +After doing this, run yarn with `BYPASS_CLI_SETUP=true`; example: +`BYPASS_CLI_SETUP=true yarn start:desktop`. + +### Environment Variables These environment variables may be used to customized the build. | Variable | Description | | -------- | ----------- | +| `BYPASS_CLI_SETUP` | Set to `true` to launch without bootstrapping the CLI (see above). | | `DEBUG_APP_UPDATER` | Enable to debug app updater feature. Must be enabled for all `APP_UPDATER_*` variables to be used. | | `APP_UPDATER_CURRENT_VERSION` | Version of client. | | `APP_UPDATER_LATEST_VERSION_TAG` | Next version for comparison with current version. | @@ -95,6 +106,11 @@ The static production assets are saved into the `dist/` folder. The Boundary CLI is downloaded and extracted to `electron-app/cli/` folder as part of packaging. CLI version is defined in `electron-app/config/cli.js`. +Similar to running in development, you can also use `BYPASS_CLI_SETUP=true` to +bypass the download of the CLI, which can be useful for pre-release testing. See +[Developing Using Non-Release Versions of +Boundary](#developing-using-non-release-versions-of-boundary) for more details. + #### Environment Variables These environment variables may be used to customized the build. @@ -103,6 +119,7 @@ These environment variables may be used to customized the build. | -------- | ------------- | ----------- | | `APP_NAME` | Application Name | The user-facing name of the application, appearing in titles, etc. | | `BOUNDARY_DESKTOP_SIGNING_IDENTITY` | | The name of the certificate to use when signing (e.g. Developer ID Application: * (*)). | +| `BYPASS_CLI_SETUP` | Set to `true` to launch without bootstrapping the CLI (see above). | ### Running Tests From 469c1b7a6e6a5be857c3be719bb65903d88169ba Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Thu, 16 Sep 2021 10:56:51 -0400 Subject: [PATCH 2/3] chore: Add dev flag to disable app updater prompts - desktop --- ui/desktop/README.md | 1 + ui/desktop/electron-app/src/helpers/app-updater.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/ui/desktop/README.md b/ui/desktop/README.md index 8efc3e47f..79562fe2e 100644 --- a/ui/desktop/README.md +++ b/ui/desktop/README.md @@ -78,6 +78,7 @@ These environment variables may be used to customized the build. | `APP_UPDATER_LATEST_VERSION_TAG` | Next version for comparison with current version. | | `APP_UPDATER_LATEST_VERSION_LOCATION` | Location of app release to use for updating client. Can be a filepath or url. | | `BYPASS_CLI_SETUP` | Disable download and extraction of cli. For development use only. | +| `BYPASS_APP_UPDATER` | Disable app updater feature. For development use only. | ### Building for Production diff --git a/ui/desktop/electron-app/src/helpers/app-updater.js b/ui/desktop/electron-app/src/helpers/app-updater.js index 70e4a8426..70dcc7498 100644 --- a/ui/desktop/electron-app/src/helpers/app-updater.js +++ b/ui/desktop/electron-app/src/helpers/app-updater.js @@ -124,6 +124,11 @@ const displayDownloadPrompt = (version, url) => { **/ module.exports = { run: async ({ suppressNoUpdatePrompt } = {}) => { + /** + * Ignore app updater prompts. + */ + if (process.env.BYPASS_APP_UPDATER) return; + /** * Disable app updater check for linux as update is unsupported. * TODO: Enable for windows pending feature dev. Windows is supported. From 4e705931fc9838312cee343b7d9102832792c8a9 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Thu, 16 Sep 2021 11:04:09 -0400 Subject: [PATCH 3/3] refactor: Add forge config checks into electron forge --- .../electron-app/config/forge.config.js | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/ui/desktop/electron-app/config/forge.config.js b/ui/desktop/electron-app/config/forge.config.js index 8b12936fc..d82a4cf2d 100644 --- a/ui/desktop/electron-app/config/forge.config.js +++ b/ui/desktop/electron-app/config/forge.config.js @@ -4,20 +4,6 @@ const { isMac } = require('../src/helpers/platform.js'); const fs = require('fs'); const path = require('path'); -console.log(`\n[forge-config] Release commit: ${config.releaseCommit}`); -console.log(`[forge-config] Release version: ${config.releaseVersion}`); - -// MacOS signing identity. -// Ignore signing identity warning for debian builds run on MacOS -if ( - isMac() && - !process.env.BOUNDARY_DESKTOP_SIGNING_IDENTITY && - !process.env.BUILD_DEBIAN -) - console.warn( - '[forge-config] WARNING: Could not find signing identity. Proceeding without signing.' - ); - module.exports = { packagerConfig: { ignore: ['/ember-test(/|$)', '/tests(/|$)'], @@ -65,6 +51,21 @@ module.exports = { }, ], hooks: { + prePackage: () => { + console.log(`\n[package] Release commit: ${config.releaseCommit}`); + console.log(`[package] Release version: ${config.releaseVersion}`); + + // Check for MacOS signing identity. + // Ignore signing identity warning for debian builds made on MacOS + if ( + isMac() && + !process.env.BOUNDARY_DESKTOP_SIGNING_IDENTITY && + !process.env.BUILD_DEBIAN + ) + console.warn( + '[package] WARNING: Could not find signing identity. Proceeding without signing.' + ); + }, postPackage: async (forgeConfig, options) => { if (options.spinner) { options.spinner.info(