Skip to content

Commit

Permalink
updating docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kendavis2 committed Feb 19, 2019
1 parent 32ac355 commit 110906c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 22 deletions.
39 changes: 20 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The cStore CLI provides commands to push files `$ cstore push {{file}}` to remote storage. The pushed files are replaced by a catalog file, `cstore.yml`, that understands folder context, storage location, file encryption, and other details making restoration as simple as `$ cstore pull {{file}}`.

`*.env` and `*.json` files are special file types. Their contents can be parameterized with tokens, encrypted, and pushed to storage locations like AWS S3 or AWS Parameter Store.
`*.env` and `*.json` files are special file types whose contents can be parameterized with tokens, encrypted, and pushed to storage locations like AWS S3. `*.env` files can also be pushed to AWS Parameter Store.

TL;DR: cStore encrypts and stores environment configuration remotely using storage like AWS S3 or AWS Parameter Store and restores the configuration anywhere including Docker containers using a catalog file `cstore.yml` which can be checked into source control or stored with a project without exposing configuration or secrets.

Expand All @@ -17,14 +17,14 @@ TL;DR: cStore encrypts and stores environment configuration remotely using stora
│ └── env
│ └── dev
│ │ └── .env (stored)
| | └── .cstore (ghost)
| | └── fargate.yml
| └── .cstore (ghost)
| └── fargate.yml
│ | └── docker-compose.yml
│ │
│ └── qa
│ └── .env (stored)
| └── .cstore (ghost)
| └── fargate.yml
└── .cstore (ghost)
└── fargate.yml
│ └── docker-compose.yml
```
The `cstore.yml` catalog and hidden `.cstore` ghost files take the place of the stored `*.env` files. The `*.env` files can be encrypted and stored in AWS S3 and no longer checked into source control.
Expand All @@ -36,17 +36,23 @@ When the repository has been cloned or the project shared, running `$ cstore pul
Ensure a supported [storage](docs/STORES.md) location is already set up and available.

#### Install/Upgrade ####
mac: `$ sudo curl -L -o /usr/local/bin/cstore https://github.com/turnerlabs/cstore/releases/download/v2.3.0-alpha/cstore_darwin_amd64 && sudo chmod +x /usr/local/bin/cstore`
mac: `$ sudo curl -L -o /usr/local/bin/cstore https://github.com/turnerlabs/cstore/releases/download/v2.4.0-alpha/cstore_darwin_amd64 && sudo chmod +x /usr/local/bin/cstore`

linux: `$ sudo curl -L -o /usr/local/bin/cstore https://github.com/turnerlabs/cstore/releases/download/v2.3.0-alpha/cstore_linux_386 && sudo chmod +x /usr/local/bin/cstore`
linux: `$ sudo curl -L -o /usr/local/bin/cstore https://github.com/turnerlabs/cstore/releases/download/v2.4.0-alpha/cstore_linux_386 && sudo chmod +x /usr/local/bin/cstore`

win: `wget https://github.com/turnerlabs/cstore/releases/download/v2.4.0-alpha/cstore_windows_amd64.exe` (add download dir to the PATH environment variable)

The first push creates a catalog file in the same directory that can be checked into source control. Subsequent commands executed in the same directory will use the existing catalog.

By default, cStore will use the [AWS credential chain](https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html) and prompt for an AWS S3 Bucket ([create](docs/S3.md)).

### Store Files ###
```bash
$ cstore push {{file}} # use -s aws-paramter to push to Parameter Store insdea of S3
$ cstore push {{file}} -s aws-paramter # AWS Parameter Store
```
or
```bash
$ cstore push {{file}} -s aws-s3 # AWS S3 Bucket
```

Multiple files can be discovered and pushed in one command. If needed, replace `service` with a custom environments folder or `.` to search all project sub folders.
Expand All @@ -64,11 +70,6 @@ Instead of restoring files locally, export environment variables listed inside t
$ eval $( cstore pull {{file}} -e ) # works for '*.env' files only
```

## Architecture Example (AWS) ##

![AWS Architecture Example](docs/cstore.png "AWS Architecture Example")


## Advanced Usage ##

* [Migrate from v1 to v2](docs/MIGRATE.md) (breaking changes)
Expand All @@ -82,15 +83,15 @@ $ eval $( cstore pull {{file}} -e ) # works for '*.env' files only
* [Linking Catalogs](docs/LINKING.md)
* [CLI Commands and Flags](docs/CLI.md)

## Project Details ##

* [Goals](docs/GOALS.md)
* [Integration Testing](docs/TESTING.md)
* [Publish Release](docs/PUBLISH.md)

## Additional Info ##

* [Terms](docs/TERMS.md)
* [Stores](docs/STORES.md)
* [Vaults](docs/VAULTS.md)
* [Terraform State Files](docs/TERRAFORM.md)

## Project ##

* [Goals](docs/GOALS.md)
* [Integration Testing](docs/TESTING.md)
* [Publish Release](docs/PUBLISH.md)
4 changes: 2 additions & 2 deletions docs/DOCKER.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ exec ./my-application
```docker
ENTRYPOINT ["./docker-entrypoint.sh"]
```
4. Update the `Dockerfile` to install [cStore](https://github.com/turnerlabs/cstore/releases/download/v2.3.0-alpha/cstore_linux_amd64) for Linux (or the appropriate os) adding execute permissions.
4. Update the `Dockerfile` to install [cStore](https://github.com/turnerlabs/cstore/releases/download/v2.4.0-alpha/cstore_linux_amd64) for Linux (or the appropriate os) adding execute permissions.
```docker
RUN curl -L -o /usr/local/bin/cstore https://github.com/turnerlabs/cstore/releases/download/v2.3.0-alpha/cstore_linux_386 && chmod +x /usr/local/bin/cstore
RUN curl -L -o /usr/local/bin/cstore https://github.com/turnerlabs/cstore/releases/download/v2.4.0-alpha/cstore_linux_386 && chmod +x /usr/local/bin/cstore
```
5. Update the `docker-compose.yml` file to specify which environment config should be pulled by the `docker-entrypoint.sh` script.
```bash
Expand Down
2 changes: 1 addition & 1 deletion docs/LAMBDA.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Managing configuration from the command line is not enough. Functions need a way to get environment specific configuration in order to execute.

1. Place the following files in the lambda function folder.
- [cStore](https://github.com/turnerlabs/cstore/releases/download/v2.3.0-alpha/cstore_linux_amd64) (needs execute permissions)
- [cStore](https://github.com/turnerlabs/cstore/releases/download/v2.4.0-alpha/cstore_linux_amd64) (needs execute permissions)
- [cstore.js](../examples/cstore.js)

2. Create a configuration file `dev.json` in the lambda function folder.
Expand Down
4 changes: 4 additions & 0 deletions docs/S3.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ With the initial configuration push to Parameter Store, encryption settings are

## Set Up Infrastructure ##

![AWS Architecture Example](cstore.png "AWS Architecture Example")

### Add ###
Add terraform S3 Bucket and KMS Key files to the project's infrastructure.
- [bucket.tf](../infrastructure/s3/bucket.tf)
Expand Down Expand Up @@ -53,3 +55,5 @@ $ terraform apply
```

The S3 Bucket store is now set up and ready to be used. cStore prompts for an S3 bucket name when pushing any file for the first time.


0 comments on commit 110906c

Please sign in to comment.