From c10838234a029d0e7e595d7b837f11d21bf412de Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Tue, 17 Aug 2021 17:52:19 -0400 Subject: [PATCH 01/27] feat: Add debian electron package maker --- ui/desktop/electron-app/config/cli.js | 7 +- ui/desktop/electron-app/config/desktop.js | 4 + .../electron-app/config/forge.config.js | 54 ++++- ui/desktop/electron-app/package.json | 3 +- .../electron-app/src/helpers/platform.js | 1 + ui/desktop/electron-app/yarn.lock | 190 +++++++++++++++++- ui/desktop/package.json | 6 +- 7 files changed, 252 insertions(+), 13 deletions(-) diff --git a/ui/desktop/electron-app/config/cli.js b/ui/desktop/electron-app/config/cli.js index c2f06d13d..24f34e169 100644 --- a/ui/desktop/electron-app/config/cli.js +++ b/ui/desktop/electron-app/config/cli.js @@ -3,7 +3,7 @@ const os = require('os'); const path = require('path'); const https = require('https'); const decompress = require('decompress'); -const { isMac, isWindows } = require('../src/helpers/platform.js'); +const { isMac, isWindows, isLinux } = require('../src/helpers/platform.js'); const artifactDestination = path.resolve(__dirname, '..', 'cli'); @@ -20,6 +20,11 @@ const downloadArtifact = (version) => { archivePlatform.arch = 'amd64'; } + if (isLinux() || process.env.CLI_LINUX_DEBIAN_SUPPORT) { + archivePlatform.name = 'linux'; + archivePlatform.arch = 'amd64'; + } + const archiveName = `boundary_${version}_${archivePlatform.name}_${archivePlatform.arch}.zip`; const url = `https://releases.hashicorp.com/boundary/${version}/${archiveName}`; return new Promise((resolve, reject) => { diff --git a/ui/desktop/electron-app/config/desktop.js b/ui/desktop/electron-app/config/desktop.js index af9c8f5de..2f65b5c26 100644 --- a/ui/desktop/electron-app/config/desktop.js +++ b/ui/desktop/electron-app/config/desktop.js @@ -11,6 +11,10 @@ const createConfig = () => { releaseCommit: process.env.RELEASE_COMMIT, }; + if (process.env.CLI_LINUX_DEBIAN_SUPPORT) { + config.name = 'boundary-desktop'; + } + if (!config.releaseVersion) config.releaseVersion = '0.0.0'; return config; }; diff --git a/ui/desktop/electron-app/config/forge.config.js b/ui/desktop/electron-app/config/forge.config.js index 63755fde4..6804ebd59 100644 --- a/ui/desktop/electron-app/config/forge.config.js +++ b/ui/desktop/electron-app/config/forge.config.js @@ -1,12 +1,19 @@ // Generated during build const config = require('./config.js'); 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 -if (isMac() && !process.env.BOUNDARY_DESKTOP_SIGNING_IDENTITY) +// MacOS signing identity. +// Ignore signing identity warning for debian builds run on MacOS +if ( + isMac() && + !process.env.BOUNDARY_DESKTOP_SIGNING_IDENTITY && + !process.env.CLI_LINUX_DEBIAN_SUPPORT +) console.warn( '[forge-config] WARNING: Could not find signing identity. Proceeding without signing.' ); @@ -43,5 +50,48 @@ module.exports = { { name: '@electron-forge/maker-squirrel', }, + { + name: '@electron-forge/maker-deb', + dist: 'out/test', + options: { + name: config.name, + productName: config.productName, + }, + }, ], + hooks: { + postPackage: async (forgeConfig, options) => { + if (options.spinner) { + options.spinner.info( + `Completed packaging for platform: ${options.platform} arch: ${options.arch} at ${options.outputPaths[0]}` + ); + } + }, + postMake: (forgeConfig, options) => { + // Copy post make artifacts into flatter folder structure. + options.forEach(({ artifacts, platform, arch }) => { + // Generate platform arch folder name + const destination = path.join( + 'out', + 'artifacts', + `${platform}-${arch}` + ); + if (!fs.existsSync(destination)) + fs.mkdirSync(destination, { recursive: true }); + // Copy artifacts into platform folder + artifacts.forEach(async (artifact) => { + const artifactDestination = path.join( + destination, + path.basename(artifact) + ); + console.log(`Copy ${artifact} into ${artifactDestination}.`); + try { + await fs.promises.copyFile(artifact, artifactDestination); + } catch (e) { + console.log(`Could not copy ${artifact}`, e); + } + }); + }); + }, + }, }; diff --git a/ui/desktop/electron-app/package.json b/ui/desktop/electron-app/package.json index 2a1d4a2a5..969dd13b9 100644 --- a/ui/desktop/electron-app/package.json +++ b/ui/desktop/electron-app/package.json @@ -1,5 +1,5 @@ { - "name": "desktop", + "name": "boundary-desktop", "productName": "Boundary", "version": "0.0.0", "private": true, @@ -33,6 +33,7 @@ }, "devDependencies": { "@electron-forge/cli": "6.0.0-beta.54", + "@electron-forge/maker-deb": "^6.0.0-beta.54", "@electron-forge/maker-dmg": "^6.0.0-beta.54", "@electron-forge/maker-squirrel": "^6.0.0-beta.55", "@electron-forge/maker-zip": "^6.0.0-beta.54", diff --git a/ui/desktop/electron-app/src/helpers/platform.js b/ui/desktop/electron-app/src/helpers/platform.js index 5e508ef6c..1fd98fcc4 100644 --- a/ui/desktop/electron-app/src/helpers/platform.js +++ b/ui/desktop/electron-app/src/helpers/platform.js @@ -3,4 +3,5 @@ const os = require('os'); module.exports = { isMac: () => Boolean(os.platform().match(/(darwin)/i)), isWindows: () => Boolean(os.platform().match(/(win32)/i)), + isLinux: () => Boolean(os.platform().match(/(linux)/i)), }; diff --git a/ui/desktop/electron-app/yarn.lock b/ui/desktop/electron-app/yarn.lock index ed7fb79aa..51a814e6f 100644 --- a/ui/desktop/electron-app/yarn.lock +++ b/ui/desktop/electron-app/yarn.lock @@ -24,6 +24,17 @@ ora "^5.0.0" pretty-ms "^7.0.0" +"@electron-forge/async-ora@6.0.0-beta.59": + version "6.0.0-beta.59" + resolved "https://registry.yarnpkg.com/@electron-forge/async-ora/-/async-ora-6.0.0-beta.59.tgz#66fa8eef7f80bd662abe4657ac1fef69fdd8a98f" + integrity sha512-vF60XyjHCyoyXHgkDi/tZy+OB9K6oSBio2at7B4pwZLO6nqstofkeAB+Gz/XUsVj9Nim+vHKtyXPzE0BTXQkZQ== + dependencies: + colors "^1.4.0" + debug "^4.3.1" + log-symbols "^4.0.0" + ora "^5.0.0" + pretty-ms "^7.0.0" + "@electron-forge/cli@6.0.0-beta.54": version "6.0.0-beta.54" resolved "https://registry.yarnpkg.com/@electron-forge/cli/-/cli-6.0.0-beta.54.tgz#5105b1eab38f8f66d39903174f49428c155dbb0e" @@ -164,6 +175,25 @@ fs-extra "^9.0.1" which "^2.0.2" +"@electron-forge/maker-base@6.0.0-beta.59": + version "6.0.0-beta.59" + resolved "https://registry.yarnpkg.com/@electron-forge/maker-base/-/maker-base-6.0.0-beta.59.tgz#5a26e40edb0d619254c61fd504eb055cf86c5c87" + integrity sha512-S/Qdu2kwio5PdZgoDDxZPo6JSf2YwcuXi3sy9Tw2Qj58+ZT9nOHn0C+JBHI8sREv3IRK52Axu1/RYkwtX9+V8w== + dependencies: + "@electron-forge/shared-types" "6.0.0-beta.59" + fs-extra "^10.0.0" + which "^2.0.2" + +"@electron-forge/maker-deb@^6.0.0-beta.54": + version "6.0.0-beta.59" + resolved "https://registry.yarnpkg.com/@electron-forge/maker-deb/-/maker-deb-6.0.0-beta.59.tgz#13a20011062a49c2d99f1adf23ce043202ef988c" + integrity sha512-HrdUWajIA5Vis7WFSjAjzxX3M+fhHU2Di22xEHZEi9Ya+qpJf9U/MQjzf5Etc5tVgAtfcIL5+lFj0/KEdNYu0g== + dependencies: + "@electron-forge/maker-base" "6.0.0-beta.59" + "@electron-forge/shared-types" "6.0.0-beta.59" + optionalDependencies: + electron-installer-debian "^3.0.0" + "@electron-forge/maker-dmg@^6.0.0-beta.54": version "6.0.0-beta.54" resolved "https://registry.yarnpkg.com/@electron-forge/maker-dmg/-/maker-dmg-6.0.0-beta.54.tgz#c3777b28c30c03b3dc18d1ca332d27f8c78c65b1" @@ -230,6 +260,16 @@ electron-rebuild "^2.3.2" ora "^5.0.0" +"@electron-forge/shared-types@6.0.0-beta.59": + version "6.0.0-beta.59" + resolved "https://registry.yarnpkg.com/@electron-forge/shared-types/-/shared-types-6.0.0-beta.59.tgz#5be38b2f9c0cd236d7864cedffc9b6ee341d86cb" + integrity sha512-3tRCgfHqn5/8LijlVZsLb2xHm9W3qgzQ+KZNWXdYhb0Wj1+h6/sXn8rlxw10Mmb2mlYJEBW/NvIhpUDHgrGPXA== + dependencies: + "@electron-forge/async-ora" "6.0.0-beta.59" + electron-packager "^15.0.0" + electron-rebuild "^2.3.2" + ora "^5.0.0" + "@electron-forge/template-base@6.0.0-beta.54": version "6.0.0-beta.54" resolved "https://registry.yarnpkg.com/@electron-forge/template-base/-/template-base-6.0.0-beta.54.tgz#a7f875ac3e70398d0310ee27f38057a566c6176a" @@ -287,7 +327,7 @@ global-agent "^2.0.2" global-tunnel-ng "^2.7.1" -"@malept/cross-spawn-promise@^1.1.0", "@malept/cross-spawn-promise@^1.1.1": +"@malept/cross-spawn-promise@^1.0.0", "@malept/cross-spawn-promise@^1.1.0", "@malept/cross-spawn-promise@^1.1.1": version "1.1.1" resolved "https://registry.yarnpkg.com/@malept/cross-spawn-promise/-/cross-spawn-promise-1.1.1.tgz#504af200af6b98e198bce768bc1730c6936ae01d" integrity sha512-RTBGWL5FWQcg9orDOCcp4LvItNzUPcyEU9bwaeJX0rJ1IQxzucC48Y0/sQLp/g6t99IQgAlGIaesJS+gTn7tVQ== @@ -328,6 +368,13 @@ "@types/node" "*" "@types/responselike" "*" +"@types/fs-extra@^9.0.1": + version "9.0.12" + resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-9.0.12.tgz#9b8f27973df8a7a3920e8461517ebf8a7d4fdfaf" + integrity sha512-I+bsBr67CurCGnSenZZ7v94gd3tc3+Aj2taxMT4yu4ABLuOgOjeFxX3dokG24ztSRg5tnT00sL8BszO7gSMoIw== + dependencies: + "@types/node" "*" + "@types/glob@^7.1.1": version "7.1.3" resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.3.tgz#e6ba80f36b7daad2c685acd9266382e68985c183" @@ -726,6 +773,15 @@ cli-width@^3.0.0: resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6" integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== +cliui@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" + integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^6.2.0" + cliui@^7.0.2: version "7.0.4" resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" @@ -922,7 +978,7 @@ debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: dependencies: ms "2.1.2" -decamelize@^1.1.2: +decamelize@^1.1.2, decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= @@ -1120,6 +1176,37 @@ electron-devtools-installer@^3.1.1: semver "^7.2.1" unzip-crx-3 "^0.2.0" +electron-installer-common@^0.10.2: + version "0.10.3" + resolved "https://registry.yarnpkg.com/electron-installer-common/-/electron-installer-common-0.10.3.tgz#40f9db644ca60eb28673d545b67ee0113aef4444" + integrity sha512-mYbP+6i+nHMIm0WZHXgGdmmXMe+KXncl6jZYQNcCF9C1WsNA9C5SZ2VP4TLQMSIoFO+X4ugkMEA5uld1bmyEvA== + dependencies: + "@malept/cross-spawn-promise" "^1.0.0" + asar "^3.0.0" + debug "^4.1.1" + fs-extra "^9.0.0" + glob "^7.1.4" + lodash "^4.17.15" + parse-author "^2.0.0" + semver "^7.1.1" + tmp-promise "^3.0.2" + optionalDependencies: + "@types/fs-extra" "^9.0.1" + +electron-installer-debian@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/electron-installer-debian/-/electron-installer-debian-3.1.0.tgz#2f6107f559f6564c44e3832fb2942dd8de4d40cc" + integrity sha512-k6KChvx0Fw8XTlCqwwbBfh19yGQaKjGdbugokmr1IpzINOm4QFyACKMTHAYFHW5LCBUZQShZD96hwxUZ+8Kx+w== + dependencies: + "@malept/cross-spawn-promise" "^1.0.0" + debug "^4.1.1" + electron-installer-common "^0.10.2" + fs-extra "^9.0.0" + get-folder-size "^2.0.1" + lodash "^4.17.4" + word-wrap "^1.2.3" + yargs "^15.0.1" + electron-installer-dmg@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/electron-installer-dmg/-/electron-installer-dmg-3.0.0.tgz#08935b602f3120981c8d5fd24d3f6525f8b0198a" @@ -1416,7 +1503,7 @@ find-up@^2.0.0: dependencies: locate-path "^2.0.0" -find-up@^4.0.0: +find-up@^4.0.0, find-up@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== @@ -1466,6 +1553,15 @@ fs-constants@^1.0.0: resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== +fs-extra@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.0.0.tgz#9ff61b655dde53fb34a82df84bb214ce802e17c1" + integrity sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + fs-extra@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" @@ -1548,6 +1644,11 @@ galactus@^0.2.1: flora-colossus "^1.0.0" fs-extra "^4.0.0" +gar@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/gar/-/gar-1.0.4.tgz#f777bc7db425c0572fdeb52676172ca1ae9888b8" + integrity sha512-w4n9cPWyP7aHxKxYHFQMegj7WIAsL/YX/C4Bs5Rr8s1H9M1rNtRWRsw+ovYMkXDQ5S4ZbYHsHAPmevPjPgw44w== + gauge@~2.7.3: version "2.7.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" @@ -1576,11 +1677,19 @@ generate-object-property@^1.1.0: dependencies: is-property "^1.0.0" -get-caller-file@^2.0.5: +get-caller-file@^2.0.1, get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== +get-folder-size@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/get-folder-size/-/get-folder-size-2.0.1.tgz#3fe0524dd3bad05257ef1311331417bcd020a497" + integrity sha512-+CEb+GDCM7tkOS2wdMKTn9vU7DgnKUTuDlehkNJKNSovdCOVxs14OfKCk4cvSaR3za4gj+OBdl9opPN9xrJ0zA== + dependencies: + gar "^1.0.4" + tiny-each-async "2.0.3" + get-installed-path@^2.0.3: version "2.1.1" resolved "https://registry.yarnpkg.com/get-installed-path/-/get-installed-path-2.1.1.tgz#a1f33dc6b8af542c9331084e8edbe37fe2634152" @@ -2184,7 +2293,7 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "^3.0.0" -lodash@^4.17.10, lodash@^4.17.19, lodash@^4.17.20: +lodash@^4.17.10, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.4: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -3082,6 +3191,11 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= +require-main-filename@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" + integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== + resolve-alpn@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.1.1.tgz#4a006a7d533c81a5dd04681612090fde227cd6e1" @@ -3219,7 +3333,7 @@ semver@^6.2.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.1.3, semver@^7.2.1, semver@^7.3.2, semver@^7.3.5: +semver@^7.1.1, semver@^7.1.3, semver@^7.2.1, semver@^7.3.2, semver@^7.3.5: version "7.3.5" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== @@ -3233,7 +3347,7 @@ serialize-error@^7.0.1: dependencies: type-fest "^0.13.1" -set-blocking@~2.0.0: +set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= @@ -3545,6 +3659,11 @@ through@^2.3.6, through@^2.3.8: resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= +tiny-each-async@2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/tiny-each-async/-/tiny-each-async-2.0.3.tgz#8ebbbfd6d6295f1370003fbb37162afe5a0a51d1" + integrity sha1-jru/1tYpXxNwAD+7NxYq/loKUdE= + tmp-promise@^1.0.5: version "1.1.0" resolved "https://registry.yarnpkg.com/tmp-promise/-/tmp-promise-1.1.0.tgz#bb924d239029157b9bc1d506a6aa341f8b13e64c" @@ -3553,6 +3672,13 @@ tmp-promise@^1.0.5: bluebird "^3.5.0" tmp "0.1.0" +tmp-promise@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/tmp-promise/-/tmp-promise-3.0.2.tgz#6e933782abff8b00c3119d63589ca1fb9caaa62a" + integrity sha512-OyCLAKU1HzBjL6Ev3gxUeraJNlbNingmi8IrHHEsYH8LTmEuhvYfqvhn2F/je+mjf4N58UmZ96OMEy1JanSCpA== + dependencies: + tmp "^0.2.0" + tmp@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.1.0.tgz#ee434a4e22543082e294ba6201dcc6eafefa2877" @@ -3567,6 +3693,13 @@ tmp@^0.0.33: dependencies: os-tmpdir "~1.0.2" +tmp@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.1.tgz#8457fc3037dcf4719c251367a1af6500ee1ccf14" + integrity sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ== + dependencies: + rimraf "^3.0.0" + tn1150@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/tn1150/-/tn1150-0.1.0.tgz#673503d24d56b87de8b8c77fee3fc0853d59a18d" @@ -3739,6 +3872,11 @@ wcwidth@^1.0.1: dependencies: defaults "^1.0.3" +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= + which@^1.2.14, which@^1.2.9: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" @@ -3760,6 +3898,20 @@ wide-align@^1.1.0: dependencies: string-width "^1.0.2 || 2" +word-wrap@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== + +wrap-ansi@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" + integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" @@ -3796,6 +3948,11 @@ xtend@~2.1.1: dependencies: object-keys "~0.4.0" +y18n@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" + integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== + y18n@^5.0.5: version "5.0.8" resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" @@ -3816,11 +3973,28 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yargs-parser@^20.0.0, yargs-parser@^20.2.2, yargs-parser@~20.2.7: +yargs-parser@^18.1.2, yargs-parser@^20.0.0, yargs-parser@^20.2.2, yargs-parser@~20.2.7: version "20.2.7" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.7.tgz#61df85c113edfb5a7a4e36eb8aa60ef423cbc90a" integrity sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw== +yargs@^15.0.1: + version "15.4.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" + integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== + dependencies: + cliui "^6.0.0" + decamelize "^1.2.0" + find-up "^4.1.0" + get-caller-file "^2.0.1" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^4.2.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^18.1.2" + yargs@^16.0.0: version "16.2.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" diff --git a/ui/desktop/package.json b/ui/desktop/package.json index 920d03e56..6c84b805d 100755 --- a/ui/desktop/package.json +++ b/ui/desktop/package.json @@ -15,7 +15,11 @@ "build:production": "cross-env EMBER_CLI_ELECTRON=true ember build --environment=production", "build:development": "ember build", "prebuild:desktop": "cross-os prebuild:desktop", - "build:desktop": "cd electron-app && yarn install && yarn make", + "build:desktop": "yarm build:desktop:mac", + "build:desktop:install": "yarn install --cwd electron-app", + "build:desktop:mac": "yarn build:desktop:install && yarn --cwd electron-app make", + "build:desktop:windows": "yarn build:desktop:install && yarn --cwd electron-app make", + "build:desktop:linux": "yarn build:desktop:install; CLI_LINUX_DEBIAN_SUPPORT=true yarn --cwd electron-app make --platform linux --arch x64", "lint": "npm-run-all --aggregate-output --continue-on-error --parallel 'lint:!(fix)'", "lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix", "lint:hbs": "ember-template-lint .", From 2da521d64358d67e7d2713e1275ef9345c7ca335 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Wed, 25 Aug 2021 10:05:11 -0400 Subject: [PATCH 02/27] fix: Update debian package name to boundary-desktop --- package.json | 1 + ui/desktop/README.md | 1 + ui/desktop/electron-app/config/desktop.js | 1 + ui/desktop/package.json | 6 ++---- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index a96317204..8f31d5302 100755 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "build:ui:desktop:win": "docker-compose -f docker-compose-embedding.yml run build-desktop-production && yarn build:ui:desktop:app", "build:ui:desktop:production": "cd ui/desktop && yarn build:production", "build:ui:desktop:app": "cd ui/desktop && yarn build:desktop", + "build:ui:desktop:app:linux": "cd ui/desktop && yarn build:desktop:linux", "lint": "npm-run-all lint:*", "lint:addons-api": "cd addons/api && yarn lint", "lint:addons-auth": "cd addons/auth && yarn lint", diff --git a/ui/desktop/README.md b/ui/desktop/README.md index 82ef7d587..ef99c9b0d 100644 --- a/ui/desktop/README.md +++ b/ui/desktop/README.md @@ -76,6 +76,7 @@ These environment variables may be used to customized the build. | `APP_UPDATER_CURRENT_VERSION` | Version of client. | | `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. | ### Building for Production diff --git a/ui/desktop/electron-app/config/desktop.js b/ui/desktop/electron-app/config/desktop.js index 2f65b5c26..0e9748503 100644 --- a/ui/desktop/electron-app/config/desktop.js +++ b/ui/desktop/electron-app/config/desktop.js @@ -13,6 +13,7 @@ const createConfig = () => { if (process.env.CLI_LINUX_DEBIAN_SUPPORT) { config.name = 'boundary-desktop'; + config.productName = 'boundary-desktop'; } if (!config.releaseVersion) config.releaseVersion = '0.0.0'; diff --git a/ui/desktop/package.json b/ui/desktop/package.json index 6c84b805d..d6eca93da 100755 --- a/ui/desktop/package.json +++ b/ui/desktop/package.json @@ -15,11 +15,9 @@ "build:production": "cross-env EMBER_CLI_ELECTRON=true ember build --environment=production", "build:development": "ember build", "prebuild:desktop": "cross-os prebuild:desktop", - "build:desktop": "yarm build:desktop:mac", + "build:desktop": "yarn build:desktop:install && yarn --cwd electron-app make", + "build:desktop:linux": "yarn build:desktop:install && CLI_LINUX_DEBIAN_SUPPORT=true yarn --cwd electron-app make --platform linux --arch x64", "build:desktop:install": "yarn install --cwd electron-app", - "build:desktop:mac": "yarn build:desktop:install && yarn --cwd electron-app make", - "build:desktop:windows": "yarn build:desktop:install && yarn --cwd electron-app make", - "build:desktop:linux": "yarn build:desktop:install; CLI_LINUX_DEBIAN_SUPPORT=true yarn --cwd electron-app make --platform linux --arch x64", "lint": "npm-run-all --aggregate-output --continue-on-error --parallel 'lint:!(fix)'", "lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix", "lint:hbs": "ember-template-lint .", From 2fff4ab587881a5ea728622e329bbd313d4a18ce Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Wed, 25 Aug 2021 10:31:18 -0400 Subject: [PATCH 03/27] chore: Add vagrantfile for desktop ubuntu tests --- ui/desktop/electron-app/.gitignore | 3 ++ .../environments/ubuntu-focal64/Vagrantfile | 42 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 ui/desktop/electron-app/tests/environments/ubuntu-focal64/Vagrantfile diff --git a/ui/desktop/electron-app/.gitignore b/ui/desktop/electron-app/.gitignore index 3aca4c453..3236c0e01 100644 --- a/ui/desktop/electron-app/.gitignore +++ b/ui/desktop/electron-app/.gitignore @@ -100,3 +100,6 @@ ember-test/ # Autoupdate nextVersion/ + +# Vagrant +.vagrant/ diff --git a/ui/desktop/electron-app/tests/environments/ubuntu-focal64/Vagrantfile b/ui/desktop/electron-app/tests/environments/ubuntu-focal64/Vagrantfile new file mode 100644 index 000000000..31225577d --- /dev/null +++ b/ui/desktop/electron-app/tests/environments/ubuntu-focal64/Vagrantfile @@ -0,0 +1,42 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure("2") do |config| + config.vm.box = "ubuntu/focal64" + + config.vm.synced_folder "../../../out/artifacts", "/vagrant-desktop-app", create: true, owner: "vagrant", group: "vagrant", automount: true + + config.vm.provider "virtualbox" do |vb| + # Display the VirtualBox GUI when booting the machine + vb.gui = true + # Customize the amount of memory on the VM: + vb.memory = "4096" + end + + config.vm.provision "shell", inline: <<-SHELL + sudo apt update -y + sudo apt upgrade -y + # Install desktop + sudo apt install -y --no-install-recommends lubuntu-desktop + sudo apt install -y --no-install-recommends virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11 + # Setup localhost ssh + yes | ssh-keygen -b 2048 -t rsa -f /home/vagrant/.ssh/id_rsa -q -N "" + cat /home/vagrant/.ssh/id_rsa.pub >> /home/vagrant/.ssh/authorized_keys + # Add vagrant to administrator group + sudo usermod -aG sudo vagrant + # Add vagrant to shared folder + sudo usermod -aG vboxsf vagrant + # Setup boundary cli + sudo apt install docker.io -y + sudo groupadd docker + sudo usermod -aG docker vagrant + sudo apt install curl unzip + cd /home/vagrant/Desktop + curl https://releases.hashicorp.com/boundary/0.5.0/boundary_0.5.0_linux_amd64.zip -o boundary-cli.zip + unzip boundary-cli.zip + # Restart + sudo shutdown -r now + SHELL + + config.vm.post_up_message = "Login using username/password: vagrant/vagrant. Boundary Desktop artifacts: /media/sf_vagrant-boundary-desktop-app. Boundary CLI: /home/vagrant/Desktop." +end From 7d96d9125f2385253f3edba2be9806445cb8f5b6 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Wed, 25 Aug 2021 14:17:29 -0400 Subject: [PATCH 04/27] fix: Update electron artifacts folder name --- ui/desktop/electron-app/config/forge.config.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/ui/desktop/electron-app/config/forge.config.js b/ui/desktop/electron-app/config/forge.config.js index 6804ebd59..a1acbbe82 100644 --- a/ui/desktop/electron-app/config/forge.config.js +++ b/ui/desktop/electron-app/config/forge.config.js @@ -23,7 +23,7 @@ module.exports = { ignore: ['/ember-test(/|$)', '/tests(/|$)'], icon: './assets/app-icons/icon', name: config.productName, - appVersion: config.version, + appVersion: config.releaseVersion, appBundleId: 'com.electron.boundary', appCopyright: config.copyright, osxSign: { @@ -68,17 +68,14 @@ module.exports = { } }, postMake: (forgeConfig, options) => { - // Copy post make artifacts into flatter folder structure. + // Copy artifacts into release folder options.forEach(({ artifacts, platform, arch }) => { // Generate platform arch folder name - const destination = path.join( - 'out', - 'artifacts', - `${platform}-${arch}` - ); + const folder = `boundary-desktop_${forgeConfig.packagerConfig.appVersion}_${platform}_${arch}`; + const destination = path.join('out', 'artifacts', folder); if (!fs.existsSync(destination)) fs.mkdirSync(destination, { recursive: true }); - // Copy artifacts into platform folder + // Copy artifacts artifacts.forEach(async (artifact) => { const artifactDestination = path.join( destination, From a1cfa84919de01fadbee74d0c7f1cbc9fb7730cf Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Fri, 27 Aug 2021 11:28:00 -0400 Subject: [PATCH 05/27] chore: Create release folder for desktop builds --- package.json | 1 - ui/desktop/README.md | 1 + ui/desktop/electron-app/config/cli.js | 16 ++++++++++++-- ui/desktop/electron-app/config/desktop.js | 3 ++- .../electron-app/config/forge.config.js | 21 +++++++++--------- .../environments/ubuntu-focal64/Vagrantfile | 22 +++++++++++++++++-- ui/desktop/package.json | 2 +- 7 files changed, 48 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 8f31d5302..a96317204 100755 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "build:ui:desktop:win": "docker-compose -f docker-compose-embedding.yml run build-desktop-production && yarn build:ui:desktop:app", "build:ui:desktop:production": "cd ui/desktop && yarn build:production", "build:ui:desktop:app": "cd ui/desktop && yarn build:desktop", - "build:ui:desktop:app:linux": "cd ui/desktop && yarn build:desktop:linux", "lint": "npm-run-all lint:*", "lint:addons-api": "cd addons/api && yarn lint", "lint:addons-auth": "cd addons/auth && yarn lint", diff --git a/ui/desktop/README.md b/ui/desktop/README.md index ef99c9b0d..860405c7f 100644 --- a/ui/desktop/README.md +++ b/ui/desktop/README.md @@ -76,6 +76,7 @@ These environment variables may be used to customized the build. | `APP_UPDATER_CURRENT_VERSION` | Version of client. | | `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. | +| `BUILD_DEBIAN` | Enable to build debian artifacts on MacOS. | | `BYPASS_CLI_SETUP` | Disable download and extraction of cli. For development use only. | ### Building for Production diff --git a/ui/desktop/electron-app/config/cli.js b/ui/desktop/electron-app/config/cli.js index 24f34e169..2cb9a4174 100644 --- a/ui/desktop/electron-app/config/cli.js +++ b/ui/desktop/electron-app/config/cli.js @@ -9,7 +9,6 @@ const artifactDestination = path.resolve(__dirname, '..', 'cli'); const downloadArtifact = (version) => { const archivePlatform = {}; - // TODO: Support all available build machines if (isMac()) { archivePlatform.name = 'darwin'; archivePlatform.arch = 'amd64'; @@ -20,11 +19,24 @@ const downloadArtifact = (version) => { archivePlatform.arch = 'amd64'; } - if (isLinux() || process.env.CLI_LINUX_DEBIAN_SUPPORT) { + if (isLinux()) { + let arch = os.arch(); + // Map x64 to amd64 cli artifact + if (arch.match(/(x64)/i)) arch = 'amd64'; + archivePlatform.name = os.platform(); + archivePlatform.arch = arch; + } + + // Set cli artifact to linux-amd64 when building debian artifacts on macOS + if (process.env.BUILD_DEBIAN) { archivePlatform.name = 'linux'; archivePlatform.arch = 'amd64'; } + console.log( + `Download cli for platform: ${archivePlatform.name} arch: ${archivePlatform.arch}` + ); + const archiveName = `boundary_${version}_${archivePlatform.name}_${archivePlatform.arch}.zip`; const url = `https://releases.hashicorp.com/boundary/${version}/${archiveName}`; return new Promise((resolve, reject) => { diff --git a/ui/desktop/electron-app/config/desktop.js b/ui/desktop/electron-app/config/desktop.js index 0e9748503..fe3651478 100644 --- a/ui/desktop/electron-app/config/desktop.js +++ b/ui/desktop/electron-app/config/desktop.js @@ -1,5 +1,6 @@ const fs = require('fs'); const path = require('path'); +const { isLinux } = require('../src/helpers/platform.js'); // Create config const createConfig = () => { @@ -11,7 +12,7 @@ const createConfig = () => { releaseCommit: process.env.RELEASE_COMMIT, }; - if (process.env.CLI_LINUX_DEBIAN_SUPPORT) { + if (isLinux() || process.env.BUILD_DEBIAN) { config.name = 'boundary-desktop'; config.productName = 'boundary-desktop'; } diff --git a/ui/desktop/electron-app/config/forge.config.js b/ui/desktop/electron-app/config/forge.config.js index a1acbbe82..478c7e0e9 100644 --- a/ui/desktop/electron-app/config/forge.config.js +++ b/ui/desktop/electron-app/config/forge.config.js @@ -12,7 +12,7 @@ console.log(`[forge-config] Release version: ${config.releaseVersion}`); if ( isMac() && !process.env.BOUNDARY_DESKTOP_SIGNING_IDENTITY && - !process.env.CLI_LINUX_DEBIAN_SUPPORT + !process.env.BUILD_DEBIAN ) console.warn( '[forge-config] WARNING: Could not find signing identity. Proceeding without signing.' @@ -63,29 +63,28 @@ module.exports = { postPackage: async (forgeConfig, options) => { if (options.spinner) { options.spinner.info( - `Completed packaging for platform: ${options.platform} arch: ${options.arch} at ${options.outputPaths[0]}` + `Packaged for ${options.platform}-${options.arch} at ${options.outputPaths[0]}` ); } }, postMake: (forgeConfig, options) => { // Copy artifacts into release folder options.forEach(({ artifacts, platform, arch }) => { - // Generate platform arch folder name - const folder = `boundary-desktop_${forgeConfig.packagerConfig.appVersion}_${platform}_${arch}`; - const destination = path.join('out', 'artifacts', folder); + // Generate release name + const version = forgeConfig.packagerConfig.appVersion; + const destination = path.join('out', 'release', version); if (!fs.existsSync(destination)) fs.mkdirSync(destination, { recursive: true }); // Copy artifacts artifacts.forEach(async (artifact) => { - const artifactDestination = path.join( - destination, - path.basename(artifact) - ); - console.log(`Copy ${artifact} into ${artifactDestination}.`); + const name = `boundary-desktop_${version}_${platform}_${arch}${path.extname(artifact)}`; + const artifactDestination = path.join(destination, name); + console.log(`[release] Found artifact: ${artifact}`); try { await fs.promises.copyFile(artifact, artifactDestination); + console.log(`[release] Copied artifact: ${path.resolve(artifactDestination)}`); } catch (e) { - console.log(`Could not copy ${artifact}`, e); + console.warn(`[release] Could not copy ${artifact}`, e); } }); }); diff --git a/ui/desktop/electron-app/tests/environments/ubuntu-focal64/Vagrantfile b/ui/desktop/electron-app/tests/environments/ubuntu-focal64/Vagrantfile index 31225577d..7abe99c79 100644 --- a/ui/desktop/electron-app/tests/environments/ubuntu-focal64/Vagrantfile +++ b/ui/desktop/electron-app/tests/environments/ubuntu-focal64/Vagrantfile @@ -4,7 +4,8 @@ Vagrant.configure("2") do |config| config.vm.box = "ubuntu/focal64" - config.vm.synced_folder "../../../out/artifacts", "/vagrant-desktop-app", create: true, owner: "vagrant", group: "vagrant", automount: true + # Share desktop artifacts folder + config.vm.synced_folder "../../../out/release", "/vagrant-desktop-app", create: true, owner: "vagrant", group: "vagrant", automount: true config.vm.provider "virtualbox" do |vb| # Display the VirtualBox GUI when booting the machine @@ -13,6 +14,7 @@ Vagrant.configure("2") do |config| vb.memory = "4096" end + # Setup for testing desktop config.vm.provision "shell", inline: <<-SHELL sudo apt update -y sudo apt upgrade -y @@ -38,5 +40,21 @@ Vagrant.configure("2") do |config| sudo shutdown -r now SHELL - config.vm.post_up_message = "Login using username/password: vagrant/vagrant. Boundary Desktop artifacts: /media/sf_vagrant-boundary-desktop-app. Boundary CLI: /home/vagrant/Desktop." + # Setup for developing desktop + config.vm.provision "shell", inline: <<-SHELL + sudo apt remove cmdtest + sudo apt install -y npm curl git + + git clone https://github.com/hashicorp/boundary-ui.git /home/vagrant/Desktop/boundary-ui + sudo npm install yarn + # Setup node 12 source + curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - + sudo apt install -y nodejs + + # Install boundary-ui dependencies + cd /home/vagrant/Desktop/boundary-ui + yarn install + SHELL + + config.vm.post_up_message = "Login using username/password: vagrant/vagrant.\nBoundary Desktop: /media/sf_vagrant-boundary-desktop-app.\nBoundary CLI: /home/vagrant/Desktop." end diff --git a/ui/desktop/package.json b/ui/desktop/package.json index d6eca93da..13e2ed6db 100755 --- a/ui/desktop/package.json +++ b/ui/desktop/package.json @@ -16,7 +16,7 @@ "build:development": "ember build", "prebuild:desktop": "cross-os prebuild:desktop", "build:desktop": "yarn build:desktop:install && yarn --cwd electron-app make", - "build:desktop:linux": "yarn build:desktop:install && CLI_LINUX_DEBIAN_SUPPORT=true yarn --cwd electron-app make --platform linux --arch x64", + "build:desktop:debian": "yarn build:desktop:install && BUILD_DEBIAN=true yarn --cwd electron-app make --platform linux --arch x64", "build:desktop:install": "yarn install --cwd electron-app", "lint": "npm-run-all --aggregate-output --continue-on-error --parallel 'lint:!(fix)'", "lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix", From 4eaceabb00ddbffce4d65a8fa6c6dd674073f74a Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Fri, 27 Aug 2021 11:35:44 -0400 Subject: [PATCH 06/27] chore: Enable electron frame only in macos --- ui/desktop/electron-app/src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/desktop/electron-app/src/index.js b/ui/desktop/electron-app/src/index.js index c0c437698..3f113cca2 100644 --- a/ui/desktop/electron-app/src/index.js +++ b/ui/desktop/electron-app/src/index.js @@ -22,7 +22,7 @@ const sessionManager = require('./services/session-manager.js'); const menu = require('./config/menu.js'); const appUpdater = require('./helpers/app-updater.js'); -const { isWindows } = require('./helpers/platform.js'); +const { isMac } = require('./helpers/platform.js'); const isDev = require('electron-is-dev'); // Register the custom file protocol @@ -117,7 +117,7 @@ app.on('ready', async () => { width: 1280, height: 760, titleBarStyle: 'hiddenInset', - frame: !isWindows(), + frame: isMac(), webPreferences: { partition, sandbox: true, From 2d1475d211ffc8e06eab7fe8eed3e964b6e4c28f Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Mon, 30 Aug 2021 10:44:51 -0400 Subject: [PATCH 07/27] chore: Update debian maker version to allow nodev12 support --- ui/desktop/electron-app/package.json | 2 +- .../environments/ubuntu-focal64/Vagrantfile | 31 ++++++----- ui/desktop/electron-app/yarn.lock | 51 +++---------------- 3 files changed, 24 insertions(+), 60 deletions(-) diff --git a/ui/desktop/electron-app/package.json b/ui/desktop/electron-app/package.json index 969dd13b9..d8fd9aa79 100644 --- a/ui/desktop/electron-app/package.json +++ b/ui/desktop/electron-app/package.json @@ -33,7 +33,7 @@ }, "devDependencies": { "@electron-forge/cli": "6.0.0-beta.54", - "@electron-forge/maker-deb": "^6.0.0-beta.54", + "@electron-forge/maker-deb": "6.0.0-beta.54", "@electron-forge/maker-dmg": "^6.0.0-beta.54", "@electron-forge/maker-squirrel": "^6.0.0-beta.55", "@electron-forge/maker-zip": "^6.0.0-beta.54", diff --git a/ui/desktop/electron-app/tests/environments/ubuntu-focal64/Vagrantfile b/ui/desktop/electron-app/tests/environments/ubuntu-focal64/Vagrantfile index 7abe99c79..47c527982 100644 --- a/ui/desktop/electron-app/tests/environments/ubuntu-focal64/Vagrantfile +++ b/ui/desktop/electron-app/tests/environments/ubuntu-focal64/Vagrantfile @@ -14,25 +14,28 @@ Vagrant.configure("2") do |config| vb.memory = "4096" end - # Setup for testing desktop config.vm.provision "shell", inline: <<-SHELL - sudo apt update -y - sudo apt upgrade -y - # Install desktop - sudo apt install -y --no-install-recommends lubuntu-desktop - sudo apt install -y --no-install-recommends virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11 + sudo apt-get update -y + sudo apt-get upgrade -y + # sudo apt-get install -y --no-install-recommends virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11 curl # Setup localhost ssh - yes | ssh-keygen -b 2048 -t rsa -f /home/vagrant/.ssh/id_rsa -q -N "" - cat /home/vagrant/.ssh/id_rsa.pub >> /home/vagrant/.ssh/authorized_keys + # yes | ssh-keygen -b 2048 -t rsa -f /home/vagrant/.ssh/id_rsa -q -N "" + # cat /home/vagrant/.ssh/id_rsa.pub >> /home/vagrant/.ssh/authorized_keys # Add vagrant to administrator group sudo usermod -aG sudo vagrant # Add vagrant to shared folder sudo usermod -aG vboxsf vagrant + SHELL + + # Setup for testing desktop + config.vm.provision "test", type: "shell", inline: <<-SHELL + # Install desktop GUI + sudo apt-get install -y --no-install-recommends lubuntu-desktop # Setup boundary cli - sudo apt install docker.io -y + sudo apt-get install docker.io -y sudo groupadd docker sudo usermod -aG docker vagrant - sudo apt install curl unzip + sudo apt-get install -y unzip cd /home/vagrant/Desktop curl https://releases.hashicorp.com/boundary/0.5.0/boundary_0.5.0_linux_amd64.zip -o boundary-cli.zip unzip boundary-cli.zip @@ -41,15 +44,15 @@ Vagrant.configure("2") do |config| SHELL # Setup for developing desktop - config.vm.provision "shell", inline: <<-SHELL - sudo apt remove cmdtest - sudo apt install -y npm curl git + config.vm.provision "development", type: "shell", inline: <<-SHELL + sudo apt-get remove cmdtest + sudo apt-get install -y npm git git clone https://github.com/hashicorp/boundary-ui.git /home/vagrant/Desktop/boundary-ui sudo npm install yarn # Setup node 12 source curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - - sudo apt install -y nodejs + sudo apt-get install -y nodejs # Install boundary-ui dependencies cd /home/vagrant/Desktop/boundary-ui diff --git a/ui/desktop/electron-app/yarn.lock b/ui/desktop/electron-app/yarn.lock index 51a814e6f..98828a5fb 100644 --- a/ui/desktop/electron-app/yarn.lock +++ b/ui/desktop/electron-app/yarn.lock @@ -24,17 +24,6 @@ ora "^5.0.0" pretty-ms "^7.0.0" -"@electron-forge/async-ora@6.0.0-beta.59": - version "6.0.0-beta.59" - resolved "https://registry.yarnpkg.com/@electron-forge/async-ora/-/async-ora-6.0.0-beta.59.tgz#66fa8eef7f80bd662abe4657ac1fef69fdd8a98f" - integrity sha512-vF60XyjHCyoyXHgkDi/tZy+OB9K6oSBio2at7B4pwZLO6nqstofkeAB+Gz/XUsVj9Nim+vHKtyXPzE0BTXQkZQ== - dependencies: - colors "^1.4.0" - debug "^4.3.1" - log-symbols "^4.0.0" - ora "^5.0.0" - pretty-ms "^7.0.0" - "@electron-forge/cli@6.0.0-beta.54": version "6.0.0-beta.54" resolved "https://registry.yarnpkg.com/@electron-forge/cli/-/cli-6.0.0-beta.54.tgz#5105b1eab38f8f66d39903174f49428c155dbb0e" @@ -175,22 +164,13 @@ fs-extra "^9.0.1" which "^2.0.2" -"@electron-forge/maker-base@6.0.0-beta.59": - version "6.0.0-beta.59" - resolved "https://registry.yarnpkg.com/@electron-forge/maker-base/-/maker-base-6.0.0-beta.59.tgz#5a26e40edb0d619254c61fd504eb055cf86c5c87" - integrity sha512-S/Qdu2kwio5PdZgoDDxZPo6JSf2YwcuXi3sy9Tw2Qj58+ZT9nOHn0C+JBHI8sREv3IRK52Axu1/RYkwtX9+V8w== +"@electron-forge/maker-deb@6.0.0-beta.54": + version "6.0.0-beta.54" + resolved "https://registry.yarnpkg.com/@electron-forge/maker-deb/-/maker-deb-6.0.0-beta.54.tgz#00aa6d7fd7c6b5984079c374b24a3c99052ed379" + integrity sha512-PEAYULi7n/JkwvaEQnM554ewmLYkxGtHvuh6vUf5wsh48Xw3jcEVHejsc4FDjx5I6cKAByb9nscTtZpKt3ngXw== dependencies: - "@electron-forge/shared-types" "6.0.0-beta.59" - fs-extra "^10.0.0" - which "^2.0.2" - -"@electron-forge/maker-deb@^6.0.0-beta.54": - version "6.0.0-beta.59" - resolved "https://registry.yarnpkg.com/@electron-forge/maker-deb/-/maker-deb-6.0.0-beta.59.tgz#13a20011062a49c2d99f1adf23ce043202ef988c" - integrity sha512-HrdUWajIA5Vis7WFSjAjzxX3M+fhHU2Di22xEHZEi9Ya+qpJf9U/MQjzf5Etc5tVgAtfcIL5+lFj0/KEdNYu0g== - dependencies: - "@electron-forge/maker-base" "6.0.0-beta.59" - "@electron-forge/shared-types" "6.0.0-beta.59" + "@electron-forge/maker-base" "6.0.0-beta.54" + "@electron-forge/shared-types" "6.0.0-beta.54" optionalDependencies: electron-installer-debian "^3.0.0" @@ -260,16 +240,6 @@ electron-rebuild "^2.3.2" ora "^5.0.0" -"@electron-forge/shared-types@6.0.0-beta.59": - version "6.0.0-beta.59" - resolved "https://registry.yarnpkg.com/@electron-forge/shared-types/-/shared-types-6.0.0-beta.59.tgz#5be38b2f9c0cd236d7864cedffc9b6ee341d86cb" - integrity sha512-3tRCgfHqn5/8LijlVZsLb2xHm9W3qgzQ+KZNWXdYhb0Wj1+h6/sXn8rlxw10Mmb2mlYJEBW/NvIhpUDHgrGPXA== - dependencies: - "@electron-forge/async-ora" "6.0.0-beta.59" - electron-packager "^15.0.0" - electron-rebuild "^2.3.2" - ora "^5.0.0" - "@electron-forge/template-base@6.0.0-beta.54": version "6.0.0-beta.54" resolved "https://registry.yarnpkg.com/@electron-forge/template-base/-/template-base-6.0.0-beta.54.tgz#a7f875ac3e70398d0310ee27f38057a566c6176a" @@ -1553,15 +1523,6 @@ fs-constants@^1.0.0: resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== -fs-extra@^10.0.0: - version "10.0.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.0.0.tgz#9ff61b655dde53fb34a82df84bb214ce802e17c1" - integrity sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - fs-extra@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" From fdfa88e089c0d35fd6f0dc51034ac7a23d0005f4 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Thu, 2 Sep 2021 10:42:45 -0400 Subject: [PATCH 08/27] chore: Add file actions to linux frame --- ui/desktop/README.md | 12 +++++- ui/desktop/app/routes/application.js | 5 ++- ui/desktop/app/templates/application.hbs | 2 +- .../environments/ubuntu-focal64/Vagrantfile | 37 ++++++++++++------- 4 files changed, 38 insertions(+), 18 deletions(-) diff --git a/ui/desktop/README.md b/ui/desktop/README.md index 860405c7f..c01042195 100644 --- a/ui/desktop/README.md +++ b/ui/desktop/README.md @@ -41,6 +41,7 @@ List of available project commands. `yarn run ` | ------- | ----------- | | build:development | Builds the UI in development mode. | | build | Builds the UI for production. | +| build:desktop:debian | Builds debian based linux artifacts on MacOS. | | lint | Runs all lint commands. | | lint:hbs | Lints `hbs` template files. | | lint:js | Lints `js` files. | @@ -76,7 +77,6 @@ These environment variables may be used to customized the build. | `APP_UPDATER_CURRENT_VERSION` | Version of client. | | `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. | -| `BUILD_DEBIAN` | Enable to build debian artifacts on MacOS. | | `BYPASS_CLI_SETUP` | Disable download and extraction of cli. For development use only. | ### Building for Production @@ -91,12 +91,20 @@ yarn build ``` `BOUNDARY_DESKTOP_SIGNING_IDENTITY` environment variable must be provided -to codesign in production. +to codesign MacOS artifacts in production. 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`. +To build debian based linux artifacts on MacOS, additional [MacOS tools](https://www.electronforge.io/config/makers/deb) need to be installed before running the following commands from this folder. + +``` +yarn install +yarn build:production # Build assets +yarn build:desktop:debian # Build app +``` + #### Environment Variables These environment variables may be used to customized the build. diff --git a/ui/desktop/app/routes/application.js b/ui/desktop/app/routes/application.js index f2f8e11fe..311765c56 100644 --- a/ui/desktop/app/routes/application.js +++ b/ui/desktop/app/routes/application.js @@ -31,11 +31,14 @@ export default class ApplicationRoute extends Route { } /** - * Add OS config on controller + * Add OS config on controller. + * Display OS container actions (minimize, fullscreen, close) for + * Windows and Linux. Not enabled for MacOS. */ async setupController(controller) { controller.set('isMacOS', await this.ipc.invoke('isMacOS')); controller.set('isWindowsOS', await this.ipc.invoke('isWindowsOS')); + controller.set('showFrameActions', !controller.isMacOS); } // =actions diff --git a/ui/desktop/app/templates/application.hbs b/ui/desktop/app/templates/application.hbs index 50c65b475..2e8d01b51 100644 --- a/ui/desktop/app/templates/application.hbs +++ b/ui/desktop/app/templates/application.hbs @@ -19,7 +19,7 @@ {{/if}} - {{#if this.isWindowsOS}} + {{#if this.showFrameActions}} > /home/vagrant/.ssh/authorized_keys + sudo apt-get install curl # Add vagrant to administrator group sudo usermod -aG sudo vagrant # Add vagrant to shared folder @@ -28,36 +33,40 @@ Vagrant.configure("2") do |config| SHELL # Setup for testing desktop - config.vm.provision "test", type: "shell", inline: <<-SHELL - # Install desktop GUI + config.vm.provision "cli", type: "shell", inline: <<-SHELL + # Install ubuntu desktop GUI sudo apt-get install -y --no-install-recommends lubuntu-desktop # Setup boundary cli sudo apt-get install docker.io -y sudo groupadd docker sudo usermod -aG docker vagrant sudo apt-get install -y unzip - cd /home/vagrant/Desktop curl https://releases.hashicorp.com/boundary/0.5.0/boundary_0.5.0_linux_amd64.zip -o boundary-cli.zip - unzip boundary-cli.zip + unzip -o boundary-cli.zip -d /home/vagrant/desktop/ + # Setup localhost ssh + yes | ssh-keygen -t rsa -N "" -f /home/vagrant/.ssh/id_rsa -C vagrant@ubuntu-focal + cat /home/vagrant/.ssh/id_rsa.pub >> /home/vagrant/.ssh/authorized_keys + sudo chown -R vagrant:vagrant .ssh # Restart sudo shutdown -r now SHELL # Setup for developing desktop config.vm.provision "development", type: "shell", inline: <<-SHELL + # Setup node 12 source + curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - + sudo apt-get install -y nodejs + sudo apt-get remove cmdtest sudo apt-get install -y npm git git clone https://github.com/hashicorp/boundary-ui.git /home/vagrant/Desktop/boundary-ui - sudo npm install yarn - # Setup node 12 source - curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - - sudo apt-get install -y nodejs + sudo npm install -g yarn # Install boundary-ui dependencies cd /home/vagrant/Desktop/boundary-ui yarn install SHELL - config.vm.post_up_message = "Login using username/password: vagrant/vagrant.\nBoundary Desktop: /media/sf_vagrant-boundary-desktop-app.\nBoundary CLI: /home/vagrant/Desktop." + config.vm.post_up_message = "Login using username/password: vagrant/vagrant.\nBoundary Desktop Artifacts: /media/sf_vagrant-boundary-desktop-app.\nBoundary CLI: /home/vagrant/desktop/boundary." end From b96510de655c10364e7c0581db6236956c02e193 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Thu, 2 Sep 2021 13:57:12 -0400 Subject: [PATCH 09/27] chore: Enable icon in ubuntu toolbar --- .../electron-app/assets/app-icons/icon.png | Bin 0 -> 11365 bytes ui/desktop/electron-app/src/index.js | 13 ++++++++++--- .../environments/ubuntu-focal64/Vagrantfile | 6 ++++-- ui/desktop/package.json | 1 + 4 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 ui/desktop/electron-app/assets/app-icons/icon.png diff --git a/ui/desktop/electron-app/assets/app-icons/icon.png b/ui/desktop/electron-app/assets/app-icons/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..9d162ec103dc0ecb97654257ed7f9738faa6a4bc GIT binary patch literal 11365 zcmbt)byQSe^zWS+x=~sh2|=a1h7yn#X{05kONJT{5CI86>6A_ZL6I8ilA)U+1qP&R z=-+(b`|JJj{&?%Hd+s{-p0hvatb5MBJI>x8bhTAUi5Q3g03cOYQ+@#eAnYRuAi%>` z=3b@t*b2u%K}!JuY7>aBt#PsMthQ<|v;Y9c1px2}0Jy|9!M6awR{#LEtpGqO4FG68 zvVQ5wU_0<^G*p#=yZ^4d){CVDh}`{==|`WMPpC zS&f2LP*ygay4sI_WcG*lhMD&RT6a!|=1=4N9sV&{BBkxmKl;ZvoL>YW;J*pFtm!!@ z-oIv}V5MLsd^obW=v=m6A3roB&tA{V$G5Y+7dKRS8;q*htE{}Xw^x34EwoBY3#GtO z`2Q*q48|kk6hgco$Ybg~IPB4BlE2M0hbp`L4L6M0GotS;sifPwWSHtKTcl?OTyvTC z3IcN%PpamQru^DknheZF7w%OsAA_Cu}$Q}Y+l?h}$A^-!B(;RQKt+KM$g5w@+Jtf8wOy8QFqy?p; z5CH6eLQtU=>m$};RspsMI#ISLVMUU(V#ze2kK@VoYbVB1z8e^f@m;2a_Q&g8=^C9A z?qsKcw(#c1uj$xz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PM$j&3$Ao4h#qSq~eLFaV(4A3GRFaMZ0es zOYB#lMbes2&A?_mj8|>7GTKCj-%2O`NqTf z`s;L0RQ!z_=A;ZO^KBF9=Or^6vS)W)Hy_AP_}uN%VWjLj0?-{@=D` z{lCw-d!ta9j1K}so!hV$B>DN?s_X&;G^n;(plitH?amRGF=C*O30zGuL)qxz>3ILo!F^!^wLa{JX zK)*wTTWdT^fYi3D&kpaSkNr>|-Th)~F0Jv_nc{jkw@`n3*d~#z1Xq{^PI%MvqwI6U z&R+lSaNqD(3jm>N3yOJw~4|jX6 z>=H4rL(cEeAuYp3_a|WBvw_N@n6tmAv!d0CsWqWD(L^D92E3(qmYmZuBHn_db@!G` zB6|($a&?tB4Z!FAdMloy0g;!2qEdq5QbOW<0s>M30)A!NAN~)3tGk_( YeZc=6fPeBr6bk^6|KVm2MBM;x&QzG literal 0 HcmV?d00001 diff --git a/ui/desktop/electron-app/src/index.js b/ui/desktop/electron-app/src/index.js index 3f113cca2..66272336a 100644 --- a/ui/desktop/electron-app/src/index.js +++ b/ui/desktop/electron-app/src/index.js @@ -22,7 +22,7 @@ const sessionManager = require('./services/session-manager.js'); const menu = require('./config/menu.js'); const appUpdater = require('./helpers/app-updater.js'); -const { isMac } = require('./helpers/platform.js'); +const { isMac, isLinux } = require('./helpers/platform.js'); const isDev = require('electron-is-dev'); // Register the custom file protocol @@ -113,7 +113,7 @@ app.on('ready', async () => { } Menu.setApplicationMenu(menuTemplate); - mainWindow = new BrowserWindow({ + const browserWindowOptions = { width: 1280, height: 760, titleBarStyle: 'hiddenInset', @@ -131,7 +131,14 @@ app.on('ready', async () => { preload: preloadPath /* eng-disable PRELOAD_JS_CHECK */, disableBlinkFeatures: 'Auxclick', }, - }); + }; + + // To show app icon in toolbar in linux, set browser window icon. + // This is a limitation of electron build. + if (isLinux()) + browserWindowOptions.icon = path.join(__dirname, '..', 'assets', 'app-icons', 'icon.png'); + + mainWindow = new BrowserWindow(browserWindowOptions); // If the user-specified origin changes, reload the page so that // the CSP can be refreshed with the this source allowed diff --git a/ui/desktop/electron-app/tests/environments/ubuntu-focal64/Vagrantfile b/ui/desktop/electron-app/tests/environments/ubuntu-focal64/Vagrantfile index 34fc0cf13..4c2c51616 100644 --- a/ui/desktop/electron-app/tests/environments/ubuntu-focal64/Vagrantfile +++ b/ui/desktop/electron-app/tests/environments/ubuntu-focal64/Vagrantfile @@ -35,6 +35,8 @@ Vagrant.configure("2") do |config| # Setup for testing desktop config.vm.provision "cli", type: "shell", inline: <<-SHELL # Install ubuntu desktop GUI + # For GNOME desktop: + # sudo apt install gnome-session gnome-terminal sudo apt-get install -y --no-install-recommends lubuntu-desktop # Setup boundary cli sudo apt-get install docker.io -y @@ -42,7 +44,7 @@ Vagrant.configure("2") do |config| sudo usermod -aG docker vagrant sudo apt-get install -y unzip curl https://releases.hashicorp.com/boundary/0.5.0/boundary_0.5.0_linux_amd64.zip -o boundary-cli.zip - unzip -o boundary-cli.zip -d /home/vagrant/desktop/ + unzip -o boundary-cli.zip -d /home/vagrant/Desktop/ # Setup localhost ssh yes | ssh-keygen -t rsa -N "" -f /home/vagrant/.ssh/id_rsa -C vagrant@ubuntu-focal cat /home/vagrant/.ssh/id_rsa.pub >> /home/vagrant/.ssh/authorized_keys @@ -68,5 +70,5 @@ Vagrant.configure("2") do |config| yarn install SHELL - config.vm.post_up_message = "Login using username/password: vagrant/vagrant.\nBoundary Desktop Artifacts: /media/sf_vagrant-boundary-desktop-app.\nBoundary CLI: /home/vagrant/desktop/boundary." + config.vm.post_up_message = "Login using username/password: vagrant/vagrant.\nBoundary Desktop Artifacts: /media/sf_vagrant-boundary-desktop-app.\nBoundary CLI: /home/vagrant/Desktop/boundary." end diff --git a/ui/desktop/package.json b/ui/desktop/package.json index 13e2ed6db..aa4e59fa7 100755 --- a/ui/desktop/package.json +++ b/ui/desktop/package.json @@ -43,6 +43,7 @@ "cross-os": { "prebuild:desktop": { "darwin": "cp -r dist/ electron-app/ember-dist/", + "linux": "cp -r dist/ electron-app/ember-dist/", "win32": "(robocopy dist electron-app\\ember-dist /MIR) ^& exit 0" } }, From af9555e7f343df0f7a8f6d0bee0ed5beaabe2643 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Fri, 3 Sep 2021 10:23:15 -0400 Subject: [PATCH 10/27] chore: Update desktop changelog --- ui/desktop/CHANGELOG.md | 6 ++++++ ui/desktop/electron-app/config/forge.config.js | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ui/desktop/CHANGELOG.md b/ui/desktop/CHANGELOG.md index eeb56bd30..f1ed869a5 100644 --- a/ui/desktop/CHANGELOG.md +++ b/ui/desktop/CHANGELOG.md @@ -4,6 +4,12 @@ Canonical reference for changes, improvements, and bugfixes for Boundary Desktop ## Next +## v1.3.0 [CLI 0.0.0] (0000.00.00) + +### New + +- Add Debian based linux support for client. ([PR](https://github.com/hashicorp/boundary-ui/pull/719)) + ## v1.2.1 [CLI 0.5.0] (2021.08.03) ### New diff --git a/ui/desktop/electron-app/config/forge.config.js b/ui/desktop/electron-app/config/forge.config.js index 478c7e0e9..b38ee4584 100644 --- a/ui/desktop/electron-app/config/forge.config.js +++ b/ui/desktop/electron-app/config/forge.config.js @@ -52,10 +52,12 @@ module.exports = { }, { name: '@electron-forge/maker-deb', - dist: 'out/test', options: { name: config.name, productName: config.productName, + version: config.releaseVersion, + description: 'Desktop Client for Boundary', + productDescription: 'Desktop Client for Boundary', }, }, ], From 73002a38c45350e9d6e54c67378a6efcc1a1b435 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Fri, 3 Sep 2021 11:32:17 -0400 Subject: [PATCH 11/27] chore: Add window actions test --- addons/core/translations/actions/en-us.yaml | 2 + ui/desktop/app/routes/application.js | 4 +- ui/desktop/app/templates/application.hbs | 9 ++- .../tests/acceptance/application-test.js | 67 +++++++++++++++++++ ui/desktop/tests/acceptance/targets-test.js | 12 ++-- 5 files changed, 82 insertions(+), 12 deletions(-) create mode 100644 ui/desktop/tests/acceptance/application-test.js diff --git a/addons/core/translations/actions/en-us.yaml b/addons/core/translations/actions/en-us.yaml index 49bde4799..9b7a8561d 100644 --- a/addons/core/translations/actions/en-us.yaml +++ b/addons/core/translations/actions/en-us.yaml @@ -34,3 +34,5 @@ change-origin: Change Origin URL change-state: Change State close: Close toggle-secret: Toggle secret visibility +minimize: Minimize +fullscreen: Fullscreen diff --git a/ui/desktop/app/routes/application.js b/ui/desktop/app/routes/application.js index 311765c56..1ea18ec04 100644 --- a/ui/desktop/app/routes/application.js +++ b/ui/desktop/app/routes/application.js @@ -32,13 +32,13 @@ export default class ApplicationRoute extends Route { /** * Add OS config on controller. - * Display OS container actions (minimize, fullscreen, close) for + * Display OS window actions (minimize, fullscreen, close) for * Windows and Linux. Not enabled for MacOS. */ async setupController(controller) { controller.set('isMacOS', await this.ipc.invoke('isMacOS')); controller.set('isWindowsOS', await this.ipc.invoke('isWindowsOS')); - controller.set('showFrameActions', !controller.isMacOS); + controller.set('showWindowActions', !controller.isMacOS); } // =actions diff --git a/ui/desktop/app/templates/application.hbs b/ui/desktop/app/templates/application.hbs index 9ab80e5b8..24293ed6d 100644 --- a/ui/desktop/app/templates/application.hbs +++ b/ui/desktop/app/templates/application.hbs @@ -19,23 +19,26 @@ {{/if}} - {{#if this.showFrameActions}} + {{#if this.showWindowActions}} {{/if}} diff --git a/ui/desktop/tests/acceptance/application-test.js b/ui/desktop/tests/acceptance/application-test.js new file mode 100644 index 000000000..23a254e0e --- /dev/null +++ b/ui/desktop/tests/acceptance/application-test.js @@ -0,0 +1,67 @@ +import { module, test } from 'qunit'; +import { + visit, + // currentURL, + // fillIn, + // click, + find, + //findAll, + //getRootElement + //setupOnerror, +} from '@ember/test-helpers'; +import { setupApplicationTest } from 'ember-qunit'; +import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; +// import { Response } from 'miragejs'; +// import a11yAudit from 'ember-a11y-testing/test-support/audit'; +import sinon from 'sinon'; +import { + // currentSession, + // authenticateSession, + invalidateSession, +} from 'ember-simple-auth/test-support'; +import { setupBrowserFakes } from 'ember-browser-services/test-support'; + +module('Acceptance | origin', function (hooks) { + setupApplicationTest(hooks); + setupBrowserFakes(hooks, { window: true }); + setupMirage(hooks); + + const stubs = { + ipcService: null, + }; + + const urls = { + origin: null, + }; + + hooks.beforeEach(function () { + invalidateSession(); + + urls.origin = '/origin'; + + const ipcService = this.owner.lookup('service:ipc'); + stubs.ipcService = sinon.stub(ipcService, 'invoke'); + }); + + hooks.afterEach(function () { + sinon.restore(); + }); + + test('visiting index on MacOS hides custom window actions', async function (assert) { + assert.expect(3); + stubs.ipcService.withArgs('isMacOS').returns(true); + await visit(urls.origin); + assert.notOk(find('.button-window-close')); + assert.notOk(find('.button-window-minimize')); + assert.notOk(find('.button-window-fullscreen')); + }); + + test('visiting index on non-MacOS shows custom window actions', async function (assert) { + assert.expect(3); + stubs.ipcService.withArgs('isMacOS').returns(false); + await visit(urls.origin); + assert.ok(find('.button-window-close')); + assert.ok(find('.button-window-minimize')); + assert.ok(find('.button-window-fullscreen')); + }); +}); diff --git a/ui/desktop/tests/acceptance/targets-test.js b/ui/desktop/tests/acceptance/targets-test.js index f92168c3a..1e8967543 100644 --- a/ui/desktop/tests/acceptance/targets-test.js +++ b/ui/desktop/tests/acceptance/targets-test.js @@ -12,8 +12,8 @@ import { import { run, later } from '@ember/runloop'; import { setupApplicationTest } from 'ember-qunit'; import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; -//import { Response } from 'miragejs'; -//import a11yAudit from 'ember-a11y-testing/test-support/audit'; +// import { Response } from 'miragejs'; +import a11yAudit from 'ember-a11y-testing/test-support/audit'; import { currentSession, authenticateSession, @@ -43,8 +43,6 @@ module('Acceptance | targets', function (hooks) { }; const urls = { - index: '/', - origin: '/origin', scopes: { global: null, org: null, @@ -113,7 +111,7 @@ module('Acceptance | targets', function (hooks) { invalidateSession(); assert.expect(2); await visit(urls.targets); - //await a11yAudit(); + await a11yAudit(); assert.notOk(currentSession().isAuthenticated); assert.equal(currentURL(), urls.authenticate.methods.global); }); @@ -123,11 +121,11 @@ module('Acceptance | targets', function (hooks) { // This later/cancelTimers technique allows us to test a page with // active polling. Normally an acceptance test waits for all runloop timers // to stop before returning from an awaited test, but polling means that - // runloop timers exist indefinitely. We thus schedule a cancelation before + // runloop timers exist indefinitely. We thus schedule a cancellation before // proceeding with our tests. later(async () => { run.cancelTimers(); - //await a11yAudit(); + await a11yAudit(); assert.equal(currentURL(), urls.targets); }, 750); await visit(urls.targets); From 7bfa3da53de5a5ae8f0aa5ca236560fc155cf26d Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Fri, 3 Sep 2021 15:27:29 -0400 Subject: [PATCH 12/27] chore: Update vagrant usage doc --- .../environments/ubuntu-focal64/Vagrantfile | 45 ++++++++++++++++--- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/ui/desktop/electron-app/tests/environments/ubuntu-focal64/Vagrantfile b/ui/desktop/electron-app/tests/environments/ubuntu-focal64/Vagrantfile index 4c2c51616..85fd11cb3 100644 --- a/ui/desktop/electron-app/tests/environments/ubuntu-focal64/Vagrantfile +++ b/ui/desktop/electron-app/tests/environments/ubuntu-focal64/Vagrantfile @@ -1,19 +1,45 @@ # -*- mode: ruby -*- # vi: set ft=ruby : -# User --provision-with option to setup machine for either cli or development -# To setup a machine for testing: -# vagrant up --provision-with setup,cli -# To setup a machine for developing desktop client: -# vagrant up --provision-with setup,development -# To destroy machine: -# vagrant destroy -f +=begin +This vagrant script is used to setup Ubuntu in Virtualbox and deploy both the desktop client and cli +in preparation for testing linux support for desktop client. + +## Setup Desktop +For staged or release build: +- Download Desktop Client `*.deb` package from release url to `ubuntu-focal64/staged-release` + ``` +wget -P staged-release http://hc-releases-boundary-desktop-staging.s3-website-us-east-1.amazonaws.com/boundary-desktop/1.3.0/boundary-desktop_1.3.0_linux_amd64.deb +``` +For using locally built debian artifacts: +- Refer to 'Building for Production' section in /boundary-ui/ui/desktop/README to build debian artifacts on MacOS + +## Setup Ubuntu +- Create a ubuntu desktop box using vagrant: `vagrant up --provision-with setup,cli,staged-desktop` +- Desktop client artifact and cli will be available in `/home/vagrant/Desktop` after logging into ubuntu. + Username/password for login: vagrant/vagrant. Navigate to `/home/vagrant/Desktop` in a terminal app. +- To install desktop app use either `apt` or `dpkg` + - `sudo apt install ./boundary-desktop_1.3.0_linux_amd64.deb` + - `sudo dpkg -i ./boundary-desktop_1.3.0_linux_amd64.deb` + - To launch desktop client from terminal: `boundary-desktop` +- To launch cli: `./boundary dev` + +## Provision types +User --provision-with option to setup machine for either cli or development +To setup a machine for testing: + vagrant up --provision-with setup,cli +To setup a machine for developing desktop client: + vagrant up --provision-with setup,development +To destroy machine: + vagrant destroy -f +=end Vagrant.configure("2") do |config| config.vm.box = "ubuntu/focal64" # Share desktop artifacts folder config.vm.synced_folder "../../../out/release", "/vagrant-desktop-app", create: true, owner: "vagrant", group: "vagrant", automount: true + config.vm.synced_folder "./staged-release", "/vagrant-desktop-staged-app", create: true, owner: "vagrant", group: "vagrant", automount: true config.vm.provider "virtualbox" do |vb| # Display the VirtualBox GUI when booting the machine @@ -70,5 +96,10 @@ Vagrant.configure("2") do |config| yarn install SHELL + config.vm.provision "staged-desktop", type: "shell", inline: <<-SHELL + sudo cp -r /media/sf_vagrant-desktop-staged-app/. /home/vagrant/Desktop + chown -R vagrant:vagrant /home/vagrant/Desktop + SHELL + config.vm.post_up_message = "Login using username/password: vagrant/vagrant.\nBoundary Desktop Artifacts: /media/sf_vagrant-boundary-desktop-app.\nBoundary CLI: /home/vagrant/Desktop/boundary." end From bce44de8e085bc28a14f2b1387326d034df3d2c0 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Fri, 3 Sep 2021 16:00:08 -0400 Subject: [PATCH 13/27] chore: Move vagrant scripts to root level --- ui/desktop/.gitignore | 3 +++ ui/desktop/electron-app/.gitignore | 3 --- .../tests => }/environments/ubuntu-focal64/Vagrantfile | 9 +++++---- 3 files changed, 8 insertions(+), 7 deletions(-) rename ui/desktop/{electron-app/tests => }/environments/ubuntu-focal64/Vagrantfile (93%) diff --git a/ui/desktop/.gitignore b/ui/desktop/.gitignore index 7e0f7ddce..f414c569a 100644 --- a/ui/desktop/.gitignore +++ b/ui/desktop/.gitignore @@ -24,3 +24,6 @@ /.node_modules.ember-try/ /bower.json.ember-try /package.json.ember-try + +# Vagrant +.vagrant/ diff --git a/ui/desktop/electron-app/.gitignore b/ui/desktop/electron-app/.gitignore index 3236c0e01..3aca4c453 100644 --- a/ui/desktop/electron-app/.gitignore +++ b/ui/desktop/electron-app/.gitignore @@ -100,6 +100,3 @@ ember-test/ # Autoupdate nextVersion/ - -# Vagrant -.vagrant/ diff --git a/ui/desktop/electron-app/tests/environments/ubuntu-focal64/Vagrantfile b/ui/desktop/environments/ubuntu-focal64/Vagrantfile similarity index 93% rename from ui/desktop/electron-app/tests/environments/ubuntu-focal64/Vagrantfile rename to ui/desktop/environments/ubuntu-focal64/Vagrantfile index 85fd11cb3..5b145380d 100644 --- a/ui/desktop/electron-app/tests/environments/ubuntu-focal64/Vagrantfile +++ b/ui/desktop/environments/ubuntu-focal64/Vagrantfile @@ -26,10 +26,12 @@ For using locally built debian artifacts: ## Provision types User --provision-with option to setup machine for either cli or development -To setup a machine for testing: +Setup for testing: vagrant up --provision-with setup,cli -To setup a machine for developing desktop client: +Setup for developing desktop client: vagrant up --provision-with setup,development +Setup for staged desktop release: + vagrant up --provision-with setup,cli,staged-desktop To destroy machine: vagrant destroy -f =end @@ -98,8 +100,7 @@ Vagrant.configure("2") do |config| config.vm.provision "staged-desktop", type: "shell", inline: <<-SHELL sudo cp -r /media/sf_vagrant-desktop-staged-app/. /home/vagrant/Desktop - chown -R vagrant:vagrant /home/vagrant/Desktop SHELL - config.vm.post_up_message = "Login using username/password: vagrant/vagrant.\nBoundary Desktop Artifacts: /media/sf_vagrant-boundary-desktop-app.\nBoundary CLI: /home/vagrant/Desktop/boundary." + config.vm.post_up_message = "Login using username/password: vagrant/vagrant.\nArtifacts: /home/vagrant/Desktop" end From 1978b1c08e5ff12524cd9b340819a0285b24383f Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Fri, 3 Sep 2021 16:18:43 -0400 Subject: [PATCH 14/27] chore: Add staged build download to vagrantfile --- ui/desktop/environments/ubuntu-focal64/Vagrantfile | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/ui/desktop/environments/ubuntu-focal64/Vagrantfile b/ui/desktop/environments/ubuntu-focal64/Vagrantfile index 5b145380d..6eef580f7 100644 --- a/ui/desktop/environments/ubuntu-focal64/Vagrantfile +++ b/ui/desktop/environments/ubuntu-focal64/Vagrantfile @@ -5,14 +5,12 @@ This vagrant script is used to setup Ubuntu in Virtualbox and deploy both the desktop client and cli in preparation for testing linux support for desktop client. +Install vagrant guest additions plugin: `vagrant plugin install vagrant-vbguest`. + ## Setup Desktop -For staged or release build: -- Download Desktop Client `*.deb` package from release url to `ubuntu-focal64/staged-release` - ``` -wget -P staged-release http://hc-releases-boundary-desktop-staging.s3-website-us-east-1.amazonaws.com/boundary-desktop/1.3.0/boundary-desktop_1.3.0_linux_amd64.deb -``` For using locally built debian artifacts: -- Refer to 'Building for Production' section in /boundary-ui/ui/desktop/README to build debian artifacts on MacOS +- Refer to 'Building for Production' section in /boundary-ui/ui/desktop/README to build debian + artifacts on MacOS ## Setup Ubuntu - Create a ubuntu desktop box using vagrant: `vagrant up --provision-with setup,cli,staged-desktop` @@ -41,7 +39,6 @@ Vagrant.configure("2") do |config| # Share desktop artifacts folder config.vm.synced_folder "../../../out/release", "/vagrant-desktop-app", create: true, owner: "vagrant", group: "vagrant", automount: true - config.vm.synced_folder "./staged-release", "/vagrant-desktop-staged-app", create: true, owner: "vagrant", group: "vagrant", automount: true config.vm.provider "virtualbox" do |vb| # Display the VirtualBox GUI when booting the machine @@ -99,7 +96,8 @@ Vagrant.configure("2") do |config| SHELL config.vm.provision "staged-desktop", type: "shell", inline: <<-SHELL - sudo cp -r /media/sf_vagrant-desktop-staged-app/. /home/vagrant/Desktop + sudo apt install wget -y + wget -P /home/vagrant/Desktop/ http://hc-releases-boundary-desktop-staging.s3-website-us-east-1.amazonaws.com/boundary-desktop/1.3.0/boundary-desktop_1.3.0_linux_amd64.deb SHELL config.vm.post_up_message = "Login using username/password: vagrant/vagrant.\nArtifacts: /home/vagrant/Desktop" From 0bda47ec296cbc0dc47f6e7b8a3cdb917ff41ff5 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Mon, 6 Sep 2021 22:49:59 -0400 Subject: [PATCH 15/27] chore: Use browserwindow for launching urls in linux --- ui/desktop/electron-app/src/ipc/handlers.js | 22 +++++++++++++++---- .../environments/ubuntu-focal64/Vagrantfile | 12 +++++----- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/ui/desktop/electron-app/src/ipc/handlers.js b/ui/desktop/electron-app/src/ipc/handlers.js index d5aac6fb4..9f956d49b 100644 --- a/ui/desktop/electron-app/src/ipc/handlers.js +++ b/ui/desktop/electron-app/src/ipc/handlers.js @@ -5,7 +5,7 @@ const boundaryCli = require('../cli/index.js'); const sessionManager = require('../services/session-manager.js'); const runtimeSettings = require('../services/runtime-settings.js'); const sanitizer = require('../utils/sanitizer.js'); -const { isMac, isWindows } = require('../helpers/platform.js'); +const { isMac, isWindows, isLinux } = require('../helpers/platform.js'); /** * Returns the current runtime origin, which is used by the main thread to @@ -38,9 +38,23 @@ handle('openExternal', async (href) => { const isLocalhost = href.startsWith('http://localhost') || href.startsWith('http://127.0.0.1'); if (isSecure || isLocalhost || isDev) { - // openExternal is necessary in order to display documentation and to - // support arbitrary OIDC flows. The protocol is validated (see above). - shell.openExternal(href); /* eng-disable OPEN_EXTERNAL_JS_CHECK */ + /** + * Launch browser to display documentation and to support arbitrary OIDC flows. + * The protocol is validated (see above). + * In linux, launch application (xdg-open) does not launch browser window + * and fails silently. As a bypass, launch a new browser window attached + * to main window. + */ + if (isLinux()) { + const browserWindow = new BrowserWindow({ + parent: BrowserWindow.getFocusedWindow(), + }); + browserWindow.loadURL(href); + browserWindow.show(); + } else { + // openExternal is necessary to open urls in Windows and MacOS + shell.openExternal(href); /* eng-disable OPEN_EXTERNAL_JS_CHECK */ + } } else { throw new Error( `URLs may only be opened over HTTPS in an external browser. diff --git a/ui/desktop/environments/ubuntu-focal64/Vagrantfile b/ui/desktop/environments/ubuntu-focal64/Vagrantfile index 6eef580f7..e037674ad 100644 --- a/ui/desktop/environments/ubuntu-focal64/Vagrantfile +++ b/ui/desktop/environments/ubuntu-focal64/Vagrantfile @@ -13,7 +13,7 @@ For using locally built debian artifacts: artifacts on MacOS ## Setup Ubuntu -- Create a ubuntu desktop box using vagrant: `vagrant up --provision-with setup,cli,staged-desktop` +- Create a ubuntu desktop box using vagrant: `vagrant up --provision-with setup,cli,staged-desktop`. - Desktop client artifact and cli will be available in `/home/vagrant/Desktop` after logging into ubuntu. Username/password for login: vagrant/vagrant. Navigate to `/home/vagrant/Desktop` in a terminal app. - To install desktop app use either `apt` or `dpkg` @@ -24,12 +24,12 @@ For using locally built debian artifacts: ## Provision types User --provision-with option to setup machine for either cli or development -Setup for testing: +Setup for testing staged desktop release: + vagrant up --provision-with setup,cli,staged-desktop +Setup for testing artifacts built locally: vagrant up --provision-with setup,cli Setup for developing desktop client: vagrant up --provision-with setup,development -Setup for staged desktop release: - vagrant up --provision-with setup,cli,staged-desktop To destroy machine: vagrant destroy -f =end @@ -50,7 +50,7 @@ Vagrant.configure("2") do |config| config.vm.provision "setup", type: "shell", inline: <<-SHELL sudo apt-get update -y sudo apt-get upgrade -y - sudo apt-get install curl + sudo apt-get install curl firefox # Add vagrant to administrator group sudo usermod -aG sudo vagrant # Add vagrant to shared folder @@ -85,7 +85,7 @@ Vagrant.configure("2") do |config| sudo apt-get install -y nodejs sudo apt-get remove cmdtest - sudo apt-get install -y npm git + sudo apt-get install -y npm git chromium-browser git clone https://github.com/hashicorp/boundary-ui.git /home/vagrant/Desktop/boundary-ui sudo npm install -g yarn From b22ea6fa796348f6d9e27187c6e9cf358c445f6d Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Mon, 6 Sep 2021 22:53:22 -0400 Subject: [PATCH 16/27] chore: Clarify debian build of macos --- ui/desktop/README.md | 4 ++-- ui/desktop/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/desktop/README.md b/ui/desktop/README.md index c01042195..8efc3e47f 100644 --- a/ui/desktop/README.md +++ b/ui/desktop/README.md @@ -41,7 +41,7 @@ List of available project commands. `yarn run ` | ------- | ----------- | | build:development | Builds the UI in development mode. | | build | Builds the UI for production. | -| build:desktop:debian | Builds debian based linux artifacts on MacOS. | +| build:desktop:debianOnMacOS | Builds debian based linux artifacts on MacOS. | | lint | Runs all lint commands. | | lint:hbs | Lints `hbs` template files. | | lint:js | Lints `js` files. | @@ -102,7 +102,7 @@ To build debian based linux artifacts on MacOS, additional [MacOS tools](https:/ ``` yarn install yarn build:production # Build assets -yarn build:desktop:debian # Build app +yarn build:desktop:debianOnMacOS # Build app ``` #### Environment Variables diff --git a/ui/desktop/package.json b/ui/desktop/package.json index b6c7c7647..7cc33278c 100755 --- a/ui/desktop/package.json +++ b/ui/desktop/package.json @@ -16,7 +16,7 @@ "build:development": "ember build", "prebuild:desktop": "cross-os prebuild:desktop", "build:desktop": "yarn build:desktop:install && yarn --cwd electron-app make", - "build:desktop:debian": "yarn build:desktop:install && BUILD_DEBIAN=true yarn --cwd electron-app make --platform linux --arch x64", + "build:desktop:debianOnMacOS": "yarn build:desktop:install && BUILD_DEBIAN=true yarn --cwd electron-app make --platform linux --arch x64", "build:desktop:install": "yarn install --cwd electron-app", "lint": "npm-run-all --aggregate-output --continue-on-error --parallel 'lint:!(fix)'", "lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix", From af87d85a347027b8a85e385816ac7a40258bbccf Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Tue, 7 Sep 2021 09:54:14 -0400 Subject: [PATCH 17/27] chore: Update desktop changelog with cli release date --- ui/desktop/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/desktop/CHANGELOG.md b/ui/desktop/CHANGELOG.md index f1ed869a5..5ad565466 100644 --- a/ui/desktop/CHANGELOG.md +++ b/ui/desktop/CHANGELOG.md @@ -4,7 +4,7 @@ Canonical reference for changes, improvements, and bugfixes for Boundary Desktop ## Next -## v1.3.0 [CLI 0.0.0] (0000.00.00) +## v1.3.0 [CLI 0.6.0] (2021.09.08) ### New From 865e36c03c652e5c92f0a926c5427f2883d35344 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Tue, 7 Sep 2021 11:29:46 -0400 Subject: [PATCH 18/27] chore: Revert linux openExternal fix for additional tests --- ui/desktop/electron-app/src/ipc/handlers.js | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/ui/desktop/electron-app/src/ipc/handlers.js b/ui/desktop/electron-app/src/ipc/handlers.js index 9f956d49b..6ed7cf4c3 100644 --- a/ui/desktop/electron-app/src/ipc/handlers.js +++ b/ui/desktop/electron-app/src/ipc/handlers.js @@ -5,7 +5,7 @@ const boundaryCli = require('../cli/index.js'); const sessionManager = require('../services/session-manager.js'); const runtimeSettings = require('../services/runtime-settings.js'); const sanitizer = require('../utils/sanitizer.js'); -const { isMac, isWindows, isLinux } = require('../helpers/platform.js'); +const { isMac, isWindows } = require('../helpers/platform.js'); /** * Returns the current runtime origin, which is used by the main thread to @@ -39,22 +39,10 @@ handle('openExternal', async (href) => { href.startsWith('http://localhost') || href.startsWith('http://127.0.0.1'); if (isSecure || isLocalhost || isDev) { /** - * Launch browser to display documentation and to support arbitrary OIDC flows. - * The protocol is validated (see above). - * In linux, launch application (xdg-open) does not launch browser window - * and fails silently. As a bypass, launch a new browser window attached - * to main window. + * Launch browser to display documentation and to support arbitrary OIDC flows + * using openExternal. The protocol is validated (see above). */ - if (isLinux()) { - const browserWindow = new BrowserWindow({ - parent: BrowserWindow.getFocusedWindow(), - }); - browserWindow.loadURL(href); - browserWindow.show(); - } else { - // openExternal is necessary to open urls in Windows and MacOS - shell.openExternal(href); /* eng-disable OPEN_EXTERNAL_JS_CHECK */ - } + shell.openExternal(href); /* eng-disable OPEN_EXTERNAL_JS_CHECK */ } else { throw new Error( `URLs may only be opened over HTTPS in an external browser. From c7c54daaadaec2a4e859581f68c6b6565dcfb71f Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Tue, 7 Sep 2021 14:59:09 -0400 Subject: [PATCH 19/27] chore: Add overlow scroll class for linux and windows frame --- ui/desktop/app/controllers/application.js | 14 ++++++++++++++ ui/desktop/app/routes/application.js | 3 --- ui/desktop/app/templates/application.hbs | 4 ++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/ui/desktop/app/controllers/application.js b/ui/desktop/app/controllers/application.js index 0eb5226e0..10cf5fcc7 100644 --- a/ui/desktop/app/controllers/application.js +++ b/ui/desktop/app/controllers/application.js @@ -1,6 +1,7 @@ import Controller from '@ember/controller'; import { inject as service } from '@ember/service'; import config from '../config/environment'; +import { computed } from '@ember/object'; export default class ApplicationController extends Controller { // =services @@ -10,4 +11,17 @@ export default class ApplicationController extends Controller { // =attributes notifyTimeout = config.notifyTimeout; + + // =attributes + + /** + * Display OS window actions (minimize, fullscreen, close) for + * Windows and Linux as OS frame/shell is disable. + * Does not apply to MacOS. + * @type {boolean} + */ + @computed('isMacOS') + get isFrameless() { + return !this.isMacOS; + } } diff --git a/ui/desktop/app/routes/application.js b/ui/desktop/app/routes/application.js index 1ea18ec04..5a115152a 100644 --- a/ui/desktop/app/routes/application.js +++ b/ui/desktop/app/routes/application.js @@ -32,13 +32,10 @@ export default class ApplicationRoute extends Route { /** * Add OS config on controller. - * Display OS window actions (minimize, fullscreen, close) for - * Windows and Linux. Not enabled for MacOS. */ async setupController(controller) { controller.set('isMacOS', await this.ipc.invoke('isMacOS')); controller.set('isWindowsOS', await this.ipc.invoke('isWindowsOS')); - controller.set('showWindowActions', !controller.isMacOS); } // =actions diff --git a/ui/desktop/app/templates/application.hbs b/ui/desktop/app/templates/application.hbs index 24293ed6d..501eb1db1 100644 --- a/ui/desktop/app/templates/application.hbs +++ b/ui/desktop/app/templates/application.hbs @@ -1,7 +1,7 @@ {{page-title (app-name)}} @@ -19,7 +19,7 @@ {{/if}} - {{#if this.showWindowActions}} + {{#if this.isFrameless}} Date: Tue, 7 Sep 2021 15:03:33 -0400 Subject: [PATCH 20/27] chore: Disable unsupported app update feature for linux --- ui/desktop/electron-app/src/helpers/app-updater.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ui/desktop/electron-app/src/helpers/app-updater.js b/ui/desktop/electron-app/src/helpers/app-updater.js index d36d18fff..70e4a8426 100644 --- a/ui/desktop/electron-app/src/helpers/app-updater.js +++ b/ui/desktop/electron-app/src/helpers/app-updater.js @@ -4,7 +4,7 @@ const https = require('https'); const semver = require('semver'); const { parse } = require('node-html-parser'); const { autoUpdater, dialog } = require('electron'); -const { isWindows } = require('../helpers/platform.js'); +const { isWindows, isLinux } = require('../helpers/platform.js'); const config = require('../../config/config.js'); let currentVersion = config.releaseVersion; @@ -124,8 +124,11 @@ const displayDownloadPrompt = (version, url) => { **/ module.exports = { run: async ({ suppressNoUpdatePrompt } = {}) => { - // Do nothing on Windows - yet - if (isWindows()) return; + /** + * Disable app updater check for linux as update is unsupported. + * TODO: Enable for windows pending feature dev. Windows is supported. + */ + if (isWindows() || isLinux()) return; let latestVersion; if (debug) { From f956f95e78c4e55ae2aec887334c5486a544ac0e Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Tue, 7 Sep 2021 16:00:27 -0400 Subject: [PATCH 21/27] refactor: Remove unused windows os check in desktop app --- ui/desktop/app/routes/application.js | 1 - ui/desktop/electron-app/src/ipc/handlers.js | 7 +------ ui/desktop/tests/helpers/window-mock-ipc.js | 1 - 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/ui/desktop/app/routes/application.js b/ui/desktop/app/routes/application.js index 5a115152a..4acb8a175 100644 --- a/ui/desktop/app/routes/application.js +++ b/ui/desktop/app/routes/application.js @@ -35,7 +35,6 @@ export default class ApplicationRoute extends Route { */ async setupController(controller) { controller.set('isMacOS', await this.ipc.invoke('isMacOS')); - controller.set('isWindowsOS', await this.ipc.invoke('isWindowsOS')); } // =actions diff --git a/ui/desktop/electron-app/src/ipc/handlers.js b/ui/desktop/electron-app/src/ipc/handlers.js index 6ed7cf4c3..d66182f4c 100644 --- a/ui/desktop/electron-app/src/ipc/handlers.js +++ b/ui/desktop/electron-app/src/ipc/handlers.js @@ -5,7 +5,7 @@ const boundaryCli = require('../cli/index.js'); const sessionManager = require('../services/session-manager.js'); const runtimeSettings = require('../services/runtime-settings.js'); const sanitizer = require('../utils/sanitizer.js'); -const { isMac, isWindows } = require('../helpers/platform.js'); +const { isMac } = require('../helpers/platform.js'); /** * Returns the current runtime origin, which is used by the main thread to @@ -73,11 +73,6 @@ handle('stop', ({ session_id }) => sessionManager.stopById(session_id)); */ handle('isMacOS', () => isMac()); -/** - * Check for Windows OS - */ -handle('isWindowsOS', () => isWindows()); - /** * Minimize window */ diff --git a/ui/desktop/tests/helpers/window-mock-ipc.js b/ui/desktop/tests/helpers/window-mock-ipc.js index 18195accb..8151c8cbc 100644 --- a/ui/desktop/tests/helpers/window-mock-ipc.js +++ b/ui/desktop/tests/helpers/window-mock-ipc.js @@ -18,7 +18,6 @@ class MockIPC { resetOrigin() {} isMacOS() {} - isWindowsOS() {} } /** From 7988eee93d182b94211b93c356d71492314f4b13 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Tue, 7 Sep 2021 18:02:40 -0400 Subject: [PATCH 22/27] chore: Update debian maker config object to correct usage --- ui/desktop/electron-app/config/desktop.js | 2 +- ui/desktop/electron-app/config/forge.config.js | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ui/desktop/electron-app/config/desktop.js b/ui/desktop/electron-app/config/desktop.js index fe3651478..b7c5416b7 100644 --- a/ui/desktop/electron-app/config/desktop.js +++ b/ui/desktop/electron-app/config/desktop.js @@ -12,7 +12,7 @@ const createConfig = () => { releaseCommit: process.env.RELEASE_COMMIT, }; - if (isLinux() || process.env.BUILD_DEBIAN) { + if (process.env.BUILD_DEBIAN) { config.name = 'boundary-desktop'; config.productName = 'boundary-desktop'; } diff --git a/ui/desktop/electron-app/config/forge.config.js b/ui/desktop/electron-app/config/forge.config.js index b38ee4584..9a0525e02 100644 --- a/ui/desktop/electron-app/config/forge.config.js +++ b/ui/desktop/electron-app/config/forge.config.js @@ -52,12 +52,14 @@ module.exports = { }, { name: '@electron-forge/maker-deb', - options: { - name: config.name, - productName: config.productName, - version: config.releaseVersion, - description: 'Desktop Client for Boundary', - productDescription: 'Desktop Client for Boundary', + config: { + options: { + name: 'boundary-desktop', + version: config.releaseVersion, + icon: './assets/app-icons/icon.png', + description: 'Desktop Client for Boundary', + productDescription: 'Desktop Client for Boundary', + }, }, }, ], From fe9ce25ed06796ea21c2895e5f1925fdabf9ac27 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Tue, 7 Sep 2021 18:33:13 -0400 Subject: [PATCH 23/27] fix: Add linux executable name for linux binary name --- ui/desktop/electron-app/config/forge.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/desktop/electron-app/config/forge.config.js b/ui/desktop/electron-app/config/forge.config.js index 9a0525e02..e1804d700 100644 --- a/ui/desktop/electron-app/config/forge.config.js +++ b/ui/desktop/electron-app/config/forge.config.js @@ -26,6 +26,7 @@ module.exports = { appVersion: config.releaseVersion, appBundleId: 'com.electron.boundary', appCopyright: config.copyright, + executableName: 'boundary-desktop', osxSign: { identity: process.env.BOUNDARY_DESKTOP_SIGNING_IDENTITY, 'hardened-runtime': true, From 6df7624afcacd0c0ba92eef9f730ece4906f68b3 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Wed, 8 Sep 2021 13:35:16 -0400 Subject: [PATCH 24/27] fix: Update windows executable name in desktop --- ui/desktop/electron-app/config/desktop.js | 3 +++ ui/desktop/electron-app/config/forge.config.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/desktop/electron-app/config/desktop.js b/ui/desktop/electron-app/config/desktop.js index b7c5416b7..87588619f 100644 --- a/ui/desktop/electron-app/config/desktop.js +++ b/ui/desktop/electron-app/config/desktop.js @@ -10,6 +10,7 @@ const createConfig = () => { copyright: `Copyright © ${new Date().getFullYear()} HashiCorp, Inc.`, releaseVersion: process.env.RELEASE_VERSION, releaseCommit: process.env.RELEASE_COMMIT, + executableName: 'Boundary', }; if (process.env.BUILD_DEBIAN) { @@ -17,6 +18,8 @@ const createConfig = () => { config.productName = 'boundary-desktop'; } + if (isLinux() || process.env.BUILD_DEBIAN) config.executableName = 'boundary-desktop'; + if (!config.releaseVersion) config.releaseVersion = '0.0.0'; return config; }; diff --git a/ui/desktop/electron-app/config/forge.config.js b/ui/desktop/electron-app/config/forge.config.js index e1804d700..8b12936fc 100644 --- a/ui/desktop/electron-app/config/forge.config.js +++ b/ui/desktop/electron-app/config/forge.config.js @@ -26,7 +26,7 @@ module.exports = { appVersion: config.releaseVersion, appBundleId: 'com.electron.boundary', appCopyright: config.copyright, - executableName: 'boundary-desktop', + executableName: config.executableName, osxSign: { identity: process.env.BOUNDARY_DESKTOP_SIGNING_IDENTITY, 'hardened-runtime': true, From d07407e881dfce1c917d24260904bfc888295f16 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 8 Sep 2021 16:03:10 -0400 Subject: [PATCH 25/27] chore: mocks should have scope collection grants --- addons/api/mirage/factories/scope.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/api/mirage/factories/scope.js b/addons/api/mirage/factories/scope.js index edd0aeb11..b631c00e0 100644 --- a/addons/api/mirage/factories/scope.js +++ b/addons/api/mirage/factories/scope.js @@ -15,6 +15,7 @@ export default factory.extend({ authorized_collection_actions: () => { return { + scopes: ['create', 'list'], users: ['create', 'list'], sessions: ['list'], groups: ['create', 'list'], From 015b034feb65766df5f5f5cd00cffebb0c512218 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Thu, 9 Sep 2021 08:11:17 -0400 Subject: [PATCH 26/27] chore: Install staged desktop build in ubuntu vm --- ui/desktop/environments/ubuntu-focal64/Vagrantfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/desktop/environments/ubuntu-focal64/Vagrantfile b/ui/desktop/environments/ubuntu-focal64/Vagrantfile index e037674ad..0d647d6da 100644 --- a/ui/desktop/environments/ubuntu-focal64/Vagrantfile +++ b/ui/desktop/environments/ubuntu-focal64/Vagrantfile @@ -75,7 +75,7 @@ Vagrant.configure("2") do |config| cat /home/vagrant/.ssh/id_rsa.pub >> /home/vagrant/.ssh/authorized_keys sudo chown -R vagrant:vagrant .ssh # Restart - sudo shutdown -r now + # sudo shutdown -r now SHELL # Setup for developing desktop @@ -96,8 +96,11 @@ Vagrant.configure("2") do |config| SHELL config.vm.provision "staged-desktop", type: "shell", inline: <<-SHELL + # Download staged desktop sudo apt install wget -y wget -P /home/vagrant/Desktop/ http://hc-releases-boundary-desktop-staging.s3-website-us-east-1.amazonaws.com/boundary-desktop/1.3.0/boundary-desktop_1.3.0_linux_amd64.deb + # Install + sudo apt install /home/vagrant/Desktop/boundary-desktop_1.3.0_linux_amd64.deb SHELL config.vm.post_up_message = "Login using username/password: vagrant/vagrant.\nArtifacts: /home/vagrant/Desktop" From faae34ccf58ae52ac86f3d233dc16f69e517c108 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Thu, 9 Sep 2021 08:11:47 -0400 Subject: [PATCH 27/27] chore: Bump desktop cli version to 0.6.0 --- ui/desktop/CHANGELOG.md | 2 +- ui/desktop/electron-app/config/cli/VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/desktop/CHANGELOG.md b/ui/desktop/CHANGELOG.md index 5ad565466..c02fcc34f 100644 --- a/ui/desktop/CHANGELOG.md +++ b/ui/desktop/CHANGELOG.md @@ -4,7 +4,7 @@ Canonical reference for changes, improvements, and bugfixes for Boundary Desktop ## Next -## v1.3.0 [CLI 0.6.0] (2021.09.08) +## v1.3.0 [CLI 0.6.0] (2021.09.09) ### New diff --git a/ui/desktop/electron-app/config/cli/VERSION b/ui/desktop/electron-app/config/cli/VERSION index 79a2734bb..09a3acfa1 100644 --- a/ui/desktop/electron-app/config/cli/VERSION +++ b/ui/desktop/electron-app/config/cli/VERSION @@ -1 +1 @@ -0.5.0 \ No newline at end of file +0.6.0 \ No newline at end of file