copilot/README.md

92 lines
2.8 KiB
Markdown
Raw Permalink Normal View History

2017-09-14 18:22:12 +03:00
![CoPilot Logo](./assets/logo_dark.png)
2017-08-03 00:56:53 +03:00
2016-11-04 13:36:28 +02:00
2017-09-14 18:22:12 +03:00
[![CircleCI](https://img.shields.io/circleci/project/github/yldio/copilot/master.svg)](https://circleci.com/gh/yldio/copilot)
2017-06-01 00:35:35 +03:00
[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)
[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg)](https://github.com/RichardLitt/standard-readme)
2016-10-10 18:44:23 +03:00
## Table of Contents
2017-05-09 19:03:21 +03:00
2017-08-03 00:56:53 +03:00
- [Requirements](#requirements)
- [Install](#install)
- [Usage](#usage)
- [Contribute](#contribute)
- [License](#license)
2017-05-09 19:03:21 +03:00
2017-08-03 00:56:53 +03:00
## Requirements
- [Triton account](https://sso.joyent.com/signup)
- [Triton CLI](https://www.npmjs.com/package/triton)
- [Docker](https://www.docker.com/)
2017-05-09 19:03:21 +03:00
## Install
2017-01-23 18:28:01 +02:00
2017-08-03 00:56:53 +03:00
### Set local environment variables
There is a [`setup.sh`](./setup.sh) script that is used to create an environment (`_env`) file that will contain the keys you use to connect to Triton as well as the keys used to secure the CoPilot installation. In order for this to work correctly you will need to first load the Triton environment variables with the `triton profile` you plan to use. Below is an example of setting these environment variables using the `triton` CLI.
```sh
$ eval "$(triton env)"
```
2017-08-03 00:56:53 +03:00
Additionally, you will need a Certificate Authority certificate file, a server certificate, and a server key file. In the subsection below is an example of generating these files.
### Generating Certificates to Secure CoPilot
2017-09-05 19:43:11 +03:00
To help simplify the creation of certificates there is a _gen-keys.sh_ script. Run it and answer the prompts to generate all of the required keys to secure CoPilot.
2017-08-03 00:56:53 +03:00
```sh
2017-09-05 19:43:11 +03:00
$ ./gen-keys.sh
2017-08-03 00:56:53 +03:00
```
2017-09-13 04:37:01 +03:00
After the client certificate is installed, you may need to restart your browser.
2017-08-03 00:56:53 +03:00
### Generate `_env` file from _setup.sh_
Execute the _setup.sh_ script with the path to your key files.
```sh
2017-09-05 19:43:11 +03:00
$ ./setup.sh ~/path/to/TRITON_PRIVATE_KEY keys-test.com/ca.crt keys-test.com/server.key keys-test.com/server.crt
2016-10-25 19:51:20 +03:00
```
## Usage
2016-10-10 18:44:23 +03:00
2017-09-15 03:08:35 +03:00
You have 3 options for where to run CoPilot. You can either run it using the published docker images on Triton or locally. The last option is to build the docker images and run docker containers from these locally built images.
2017-08-03 00:56:53 +03:00
2017-09-15 03:08:35 +03:00
### Deploy and run CoPilot on Triton
Optionally use [_triton-docker_](https://github.com/joyent/triton-docker-cli)
2017-08-03 00:56:53 +03:00
```sh
2017-09-15 03:08:35 +03:00
$ triton-compose up -d
2016-10-10 18:44:23 +03:00
```
2017-08-03 00:56:53 +03:00
2017-09-15 03:08:35 +03:00
Or use `docker-compose` with preconfigured Triton environment variables
```sh
$ docker-compose up -d
```
2017-08-03 00:56:53 +03:00
2017-09-15 03:08:35 +03:00
### Start CoPilot using published docker images locally
2017-08-03 00:56:53 +03:00
```sh
2017-09-15 03:08:35 +03:00
$ docker-compose -f local-compose.yml up -d
2016-10-10 18:44:23 +03:00
```
2017-09-15 03:08:35 +03:00
Navigate to [https://localhost]() to load the dashboard.
2017-08-03 00:56:53 +03:00
2017-09-15 03:08:35 +03:00
### Build and run CoPilot locally for development
2017-08-03 00:56:53 +03:00
```sh
2017-09-15 03:08:35 +03:00
$ docker-compose -f dev-compose.yml up -d
2017-08-03 00:56:53 +03:00
```
2017-01-27 19:49:31 +02:00
## Contribute
2017-01-27 19:49:31 +02:00
See [the contribute file](CONTRIBUTING.md)!
## License
2017-08-03 00:56:53 +03:00
[MPL-2.0](LICENSE)