Files

260 lines
10 KiB
Markdown
Raw Permalink Normal View History

# Threshold UI Monorepo
2020-04-23 14:33:38 -04:00
This monorepo contains multiple projects, including UIs and addons, used by
Threshold (the admin web UI and the desktop client).
## About this fork
This repository is a community fork of
[hashicorp/boundary-ui](https://github.com/hashicorp/boundary-ui), rebranded
for the Threshold project (a community fork of Boundary CE). It is licensed
under the upstream Business Source License 1.1 (see [LICENSE](LICENSE) and
[NOTICE](NOTICE)) and is **not affiliated with, endorsed by, or sponsored by
HashiCorp or IBM**.
What changed relative to upstream:
- User-visible product name is Threshold (window titles, menus, about dialog,
installer/package names, app id `net.anhonesthost.cybercove.threshold`).
API paths, field names, protocol strings and environment variable names are
unchanged for compatibility with the server. The desktop client's persisted
settings are copied from the former "Boundary" user-data directory on first
launch.
- The desktop client looks for a `threshold` CLI first, then `boundary`.
- HashiCorp/IBM logos and brand art were removed and replaced with plain
placeholder marks.
- Nothing contacts HashiCorp services by default. The in-app updater, the
"unsupported controller" release-metadata lookup, and the CLI bundling
download are disabled until you configure your own hosts:
`THRESHOLD_UPDATE_FEED_URL` (desktop build, updater feed),
`THRESHOLD_RELEASES_METADATA_URL` / `THRESHOLD_RELEASES_PAGE_URL`
(desktop build, release links) and `THRESHOLD_CLI_RELEASES_URL` /
`THRESHOLD_CLI_ARCHIVE_PREFIX` (used with `SETUP_CLI=true` to bundle a CLI).
- Documentation links still point at the upstream Boundary documentation,
which is user-initiated only.
- Upstream HashiCorp-internal GitHub workflows and release metadata were
removed; CI lives in `.gitea/workflows/ci.yml`.
Upstream history, CHANGELOGs and copyright headers are preserved.
2020-04-23 12:59:40 -04:00
This top-level repository provides limited common tasks, such as installation
and commit assistance. However, most tasks must be executed from within a
subproject, e.g. running or testing.
2020-07-08 17:03:20 -04:00
2020-04-23 12:59:40 -04:00
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
2023-07-12 13:53:39 -07:00
2023-08-16 14:58:14 -07:00
- [Boundary UI Monorepo](#boundary-ui-monorepo)
- [Projects](#projects)
- [Core (addons/core):](#core-addonscore)
- [API (addons/api):](#api-addonsapi)
- [Auth (addons/auth):](#auth-addonsauth)
- [Rose (addons/rose)](#rose-addonsrose)
- [Admin (ui/admin)](#admin-uiadmin)
- [Desktop Client (ui/desktop)](#desktop-client-uidesktop)
- [Prerequisites](#prerequisites)
- [Optional Tooling](#optional-tooling)
- [Installation](#installation)
2025-06-03 12:55:12 -04:00
- [Pnpm Commands](#pnpm-commands)
2023-08-16 14:58:14 -07:00
- [Contributing](#contributing)
- [Branching](#branching)
- [Building ToC](#building-toc)
- [Building Admin UI for Production](#building-admin-ui-for-production)
- [Building with a Container](#building-with-a-container)
- [Building Desktop UI for Production](#building-desktop-ui-for-production)
- [Connect Boundary UI to Boundary local instance](#connect-boundary-ui-to-boundary-local-instance)
2025-06-03 12:55:12 -04:00
- [For Admin](#for-admin)
- [For Desktop](#for-desktop)
2023-08-16 14:58:14 -07:00
- [Committing](#committing)
- [License Checking](#license-checking)
2020-04-23 12:59:40 -04:00
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
2023-07-10 09:00:43 -07:00
## Projects
This monorepo contains multiple projects.
### Core (addons/core):
Core features use by Boundary UI's, i.e i18n, helpers or components. [Project Readme](addons/core).
### API (addons/api):
The API data access layer for Boundary and all the related mocks. [Project Readme](addons/api).
### Auth (addons/auth):
Authentication layer for Boundary. [Project Readme](addons/auth).
### Rose (addons/rose)
Common styles and components shared by Boundary UIs. [Project Readme](addons/rose).
### Admin (ui/admin)
The Admin UI for Boundary. [Project Readme](ui/admin).
### Desktop Client (ui/desktop)
The desktop client UI for Boundary. [Project Readme](ui/desktop).
## Prerequisites
You will need the following things properly installed on your computer.
* [Git][git]
* [Node.js][node]
* Supported versions: `v20` and `v22`.
2025-06-03 12:55:12 -04:00
* [Pnpm][pnpm] installed globally
* [Google Chrome][chrome]
* [Firefox][firefox]
2023-07-12 13:53:39 -07:00
## Optional Tooling
Our team finds the following applications useful in day-to-day development
workflows. These are merely recommendations. We encourage you to use the tools
that best suit you and your personal style.
* [VS Code][vscode]: Code editor for building and debugging web applications
* [Warp][warp]: Terminal application for macOS
* [Homebrew][homebrew]: The missing package manager for macOS and Linux
* [Ember Inspector][ember-inspector]: Understand and debug Ember applications
* [Postman][postman]: Test and inspect APIs
## Installation
* `git clone <repository-url>` this repository
2020-08-10 17:29:12 -04:00
* `cd boundary-ui`
2025-06-03 12:55:12 -04:00
* `pnpm install`
2025-06-03 12:55:12 -04:00
## Pnpm Commands
2020-04-23 14:05:49 -04:00
2025-06-03 12:55:12 -04:00
List of available project commands. `pnpm run <command-name>`
2020-04-23 14:05:49 -04:00
| Command | Description |
|---------------------|---|
| build | Builds Admin UI for production. |
| test | Runs tests in CI mode. |
| lint | Runs ember-template-lint on all of the hbs, js, and sass files. |
2025-06-03 12:55:12 -04:00
| compliance:audit | Checks for issues using `pnpm audit` with moderate and above criticality.|
| compliance:licenses | Checks that all dependencies have OSS-compatible licenses. |
| doc:toc | Automatically generates a table of contents for the README file. |
2020-04-23 14:05:49 -04:00
## Contributing
### Branching
We follow [GitHub Flow][github-flow].
2020-04-23 12:59:40 -04:00
### Building ToC
To autogenerate a ToC (table of contents) for this README,
2025-06-03 12:55:12 -04:00
run `pnpm doc:toc`. Please update the ToC whenever editing the structure
2020-04-23 12:59:40 -04:00
of README.
### Building Admin UI for Production
See [Admin UI README](ui/admin/README.md#building-for-production) for more information on how to
build the Admin UI for production. Be sure to set build-related environment variables as
necessary for your target environment, as described in the [Environment Variables](ui/admin/README.md#environment-variables) section of README.
To quickly produce a production build of Admin UI, run from this folder:
```bash
2025-06-03 12:55:12 -04:00
pnpm install
pnpm build
```
Assets are saved to `ui/admin/dist/`.
#### Building with a Container
Optionally, you may build the UI within a container. Execute the following command:
```bash
docker-compose -f docker-compose-embedding.yml run build
```
Assets are saved to `ui/admin/dist/`.
2021-01-25 12:06:15 -05:00
### Building Desktop UI for Production
2024-09-23 16:05:10 -05:00
See [Desktop UI README](ui/desktop/README.md#building-for-production) for more information on how to
2021-01-25 12:06:15 -05:00
build the Desktop UI. Be sure to set build-related environment variables as
2024-09-23 16:05:10 -05:00
necessary for your target environment, as described in the [Environment Variables](ui/desktop/README.md#environment-variables-prod) section of README.
2021-01-25 12:06:15 -05:00
To quickly produce a production build of Desktop UI, run from this folder:
```bash
2025-06-03 12:55:12 -04:00
pnpm install
pnpm build:ui:desktop
2021-01-25 12:06:15 -05:00
```
2021-06-01 10:20:25 -04:00
In windows, UI is generated using docker to provide a stable UI across platforms.
```cmd
2025-06-03 12:55:12 -04:00
pnpm install
2023-07-12 13:53:39 -07:00
docker-compose -f docker-compose-embedding.yml run build-desktop-production
2025-06-03 12:55:12 -04:00
pnpm build:ui:desktop:app
2021-06-01 10:20:25 -04:00
```
To provide a signing identify for macOS build, use `BOUNDARY_DESKTOP_SIGNING_IDENTITY`
2025-06-03 12:55:12 -04:00
environment variable to set signing certificate name (e.g Developer ID Application: * (*)) when building desktop app using `pnpm build:ui:desktop:app`.
2021-01-25 12:06:15 -05:00
Assets are saved to `ui/desktop/electron-app/out/make/`.
2021-02-23 17:01:11 -05:00
DMG packaged desktop UI is available at asset location as `boundary.dmg`.
2021-06-01 10:20:25 -04:00
EXE archived desktop UI is available at asset location under `zip` folder.
2021-01-25 12:06:15 -05:00
### Connect Boundary UI to Boundary local instance
This describes how to connect local Boundary UI to your local instance of Boundary.
This assumes you already have up and running a Boundary dev instance in your local environment with a listener `127.0.0.1:9200` (default behaviour). [Learn how to start a local Boundary dev instance](https://developer.hashicorp.com/boundary/tutorials/get-started-community/community-get-started-dev)
#### For Admin
This assumes you are within `boundary-ui/ui/admin`.
2025-06-03 12:55:12 -04:00
You will need to turn `off` mirage, tell the UI where to find Boundary and run it: `$ ENABLE_MIRAGE=false API_HOST=http://localhost:9200 pnpm start`.
Following terminal instructions, open in your browser: `http://localhost:4200/`.
2021-05-03 14:03:43 -07:00
Once you open the UI you will see the login screen, authenticate using generated admin login name and password.
#### For Desktop
This assumes you are within `boundary-ui/ui/desktop`.
2025-06-03 12:55:12 -04:00
You will need to turn `off` mirage and run it: `$ ENABLE_MIRAGE=false pnpm start:desktop`.
2021-05-03 14:13:52 -07:00
In login screen, authenticate using generated admin login name and password.
2022-07-27 10:25:01 -07:00
Enter the cluster URL of your Boundary dev instance, by default is: `http://localhost:9200`.
### Committing
2022-06-27 14:35:52 -04:00
We use `husky` and `lint-staged` to ensure linting and other checks pass before a
2025-06-03 12:55:12 -04:00
commit is completed. Simply do a `pnpm install` to make sure the hooks are installed.
2022-06-27 14:35:52 -04:00
Use a normal `git commit` to go through the checks, if you need to skip these checks,
use `git commit --no-verify` to bypass them. However, a consistent commit message will
still be enforced even if you use `--no-verify`.
2020-04-23 14:03:59 -04:00
#### License Checking
2020-12-14 12:29:32 -05:00
The licenses of dependencies are checking against an allowlist before every
2020-04-23 14:03:59 -04:00
commit. This helps catch undesirable licenses sooner (e.g. GPL). If your
2020-12-14 12:29:32 -05:00
commit fails due to a non-allowlisted license, you may add it to the allowlist
2020-04-23 14:03:59 -04:00
in `package.json` _as long as it is not a GPL variant or UNLICENSED_.
The change will be verified upon PR. GPL variants and UNLICENSED dependencies
will not be accepted.
[github-flow]: https://guides.github.com/introduction/flow/
2023-07-12 13:53:39 -07:00
[git]: https://git-scm.com/
[node]: https://nodejs.org/
2025-06-03 12:55:12 -04:00
[pnpm]: https://pnpm.io
2023-07-12 13:53:39 -07:00
[chrome]: https://google.com/chrome/
[firefox]: https://firefox.com/
2025-06-03 12:55:12 -04:00
[pnpm-workspaces]: https://pnpm.io/workspaces
2023-07-12 13:53:39 -07:00
[homebrew]: https://brew.sh
[warp]: https://www.warp.dev
[vscode]: https://code.visualstudio.com/
[ember-inspector]: https://guides.emberjs.com/release/ember-inspector/
[postman]: https://www.postman.com/downloads/