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