Skip to content

Latest commit

 

History

History
117 lines (78 loc) · 4.03 KB

File metadata and controls

117 lines (78 loc) · 4.03 KB

Table of Contents

OpenBao UI

This README outlines the details of collaborating on this Ember application.

Prerequisites

You will need the following things properly installed on your computer.

Running an OpenBao Server

Before running the OpenBao UI locally, an OpenBao server must be running. First, ensure a dev build of OpenBao is available according the the instructions in ../README.md. To start a single local OpenBao server:

  • pnpm openbao

To start a local OpenBao cluster:

  • pnpm openbao:cluster

Running / Development

To get all of the JavaScript dependencies installed, run this in the ui directory:

  • pnpm install

If you want to run the OpenBao UI and proxy back to an OpenBao server running on the default port, 8200, run the following in the ui directory:

  • pnpm start

This will start an Ember CLI server that proxies requests to port 8200, and enable live rebuilding of the application as you change the UI application code. Visit your app at http://localhost:4200.

If your OpenBao server is running on a different port you can use the long-form version of the npm script:

ember server --proxy=http://localhost:PORT

To run pnpm with mirage, do:

  • pnpm start:mirage handlername

Where handlername is one of the options exported in mirage/handlers/index

Code Generators

Make use of the many generators for code, try ember help generate for more details. If you're using a component that can be widely-used, consider making it an addon component instead (see this PR for more details)

eg. a reusable component named foo that you'd like in the core engine

  • ember g component foo --in lib/core
  • echo "export { default } from 'core/components/foo';" > lib/core/app/components/foo.js

Running Tests

Running tests will spin up an OpenBao dev server on port 9200 via a pretest script that testem (the test runner) executes. All of the acceptance tests then run, proxing requests back to that server.

  • pnpm test
  • pnpm test -s to keep the test server running after the initial run.
  • pnpm test -f="policies" to filter the tests that are run. -f gets passed into QUnit's filter config

Linting

  • pnpm lint
  • pnpm lint:fix

Building the OpenBao UI into an OpenBao Binary

We use the embed package from Go 1.16+ to build the static assets of the Ember application into an OpenBao binary.

This can be done by running these commands from the root directory run: make static-dist make dev-ui

This will result in an OpenBao binary that has the UI built-in - though in a non-dev setup it will still need to be enabled via the ui config or setting VAULT_UI environment variable.

Further Reading / Useful Links