Skip to content
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.

Cross platform Desktop app #85

Merged
merged 34 commits into from
Apr 8, 2017
Merged

Conversation

msessa
Copy link
Collaborator

@msessa msessa commented Mar 31, 2017

This PR introduces the necessary changes to make vault-ui a cross-platform desktop application.

Based on Electron, the desktop version will communicate directly with any vault server, regardless of the lack of CORS headers.

Apart from a few exceptions, any existing code will work seamlessly between web and desktop versions.

You can test it by running

npm install
npm run desktop

Notable changes:

  • New custom project logo!
  • Webpack configuration has been split in several files to accommodate building for two targets. From inside the app code, the WEBPACK_DEF_TARGET_WEB boolean define allows to differentiate behaviour between web/desktop versions
  • Web version uses react-router's browserHistory while desktop version uses hashHistory. (see VaultUtils.jsx:5)
  • Removed html templating from express/nodejs. index.html is now fully static
  • Introduced the /vaultui REST endpoint to communicate server-configured defaults to the client
  • Removed dependencies from external CDN-provided font-awesome, flexboxgrid. They are now webpacked into the final dist artifact
  • Cleaned up dependencies
  • Reduced footprint of the docker image (now only 92.2 MB, 184MB on disk)
  • Re authored README (preview at cotdsa:experimental/desktop)

@msessa msessa mentioned this pull request Mar 31, 2017
Copy link
Owner

@djenriquez djenriquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, looks like you've been quite busy. Had a busy weekend and didn't have much time to look into it, but hopefully will in the next few days.

Changes in your notes make sense, any breaking changes?


A beautiful way to manage your Hashicorp Vault

![](http://i.imgur.com/COBxk3m.gif)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome gif!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@msessa
Copy link
Collaborator Author

msessa commented Apr 3, 2017

Hopefully I haven't introduced any regression. All functionalities seem to be left intact.

The only noticeable change from a dev point of view is in the browserHistory/hashHistory difference, but as long as you import history from vaultUtils it will be handled automatically.

Give it try when you have some time and let me know if you notice anything wrong

@fia5000
Copy link

fia5000 commented Apr 4, 2017

@msessa So, the standalone app fails when using self-signed TLS certificates with Vault. Would it make sense to perhaps include a checkbox that would do what NODE_TLS_REJECT_UNAUTHORIZED=0 does?

The App prompts to, what I am assuming, add the self-signed cert to the OSX keychain.

image

However, allowing it to do that does nothing. Vault shows TLS error:
http: TLS handshake error from <IP-ADDRESS>:60740: EOF

The only way to make this work is to install the self-signed cert on OSX manually and manually allow trust.
image

It then works... but, kind of a hassle.

@msessa
Copy link
Collaborator Author

msessa commented Apr 4, 2017

@fia5000 Thanks for reporting this! I'll look into it asap

@msessa
Copy link
Collaborator Author

msessa commented Apr 4, 2017

@fia5000 The TLS issue has been fixed. The app now presents a dialog to ignore the TLS certificate error:
image

@fia5000
Copy link

fia5000 commented Apr 4, 2017

@msessa Cool! I ran the app with npm run desktop it seems to work. Funnily enough, when I packaged the app using electron-package electron-packager electron-packager ~/Downloads/vault-ui-experimental-desktop Vault --icon build/icon.icns the TLS issue returned.

I will chalk it up to something wrong that I probably did until you release a new test packaged build on your forked repo perhaps.

@msessa
Copy link
Collaborator Author

msessa commented Apr 4, 2017

I used electron-builder for packaging and publishing.

If you look into package.json there's a few scripts:

  • package-mac
  • package-win32
  • package-linux

Or simply try npm run dist to build for your platform and architecture.

I've also updated the builds on https://github.com/cotdsa/vault-ui/releases

@fia5000
Copy link

fia5000 commented Apr 4, 2017

@msessa Excellent, sir! All works well.

Copy link
Owner

@djenriquez djenriquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@msessa Dove through the code, did a very quick overview of functional changes which seem to be transparent enough to the normal use case. I also ran the UI and didn't see any issues.

As far as I'm concerned, LGTM.

@msessa msessa merged commit dae4c76 into djenriquez:master Apr 8, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants