-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated documentation to include more installation instructions
- Loading branch information
Showing
5 changed files
with
58 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# PostgreSQL | ||
|
||
Terrashine requires postgreSQL to store metadata associated with upstream registries and downloaded terraform providers. | ||
Terrashine does not store any terraform providers inside of postgreSQL itself so the requirements are typically fairly light. | ||
|
||
Please see postgreSQL's [excellent documentation](https://www.postgresql.org/docs/16/admin.html) to set up the database. | ||
|
||
## Database migrations | ||
|
||
When upgrading or starting up terrashine for the first time, we need to run database migrations against the database. | ||
For this, you'll need the [sqlx](https://github.com/launchbadge/sqlx) migration tool. | ||
We can perform the migration with the following command. | ||
|
||
``` bash | ||
sqlx migrate run --database-url postgres://postgres:password@localhost/ | ||
``` | ||
|
||
This command should be executed from a checkout of the git repository associated with the version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Setting up S3-compatible object storage | ||
|
||
Terrashine requires an S3 compatible storage to cache terraform providers. | ||
It is currently tested against AWS S3 and Minio. | ||
To set up AWS S3, please follow the AWS instruction to [create a bucket and obtain a set of credentials](https://docs.aws.amazon.com/AmazonS3/latest/userguide/GetStartedWithS3.html). | ||
|
||
Terrashine requires a bucket to be created and a set of credentials to be available. | ||
The AWS Rust SDK is used to authenticate to S3 so the credentials can be provided to the binary using any supported credential provider. | ||
Most commonly, this can be provided using the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_KEY_ID` environment variables. | ||
|
||
Terrashine requires the following actions in the IAM policy: | ||
|
||
* GetObject | ||
* PutObject | ||
|
||
For a non-AWS S3 compatible object storage, see the `docker-compose.yml` in the repository where an example minio integration is used. | ||
In this case, a CLI flag `--s3-endpoint` can be used to point terrashine at an alternative URL. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Starting terrashine | ||
|
||
At this point, its expected that you now have a postgres database provisioned, an S3 endpoint for object storage and a reverse proxy for TLS termination. | ||
|
||
Terrashine is configured via CLI flags and environment variables. | ||
For a complete list of environment variables see: | ||
|
||
``` | ||
terrashine --help | ||
``` | ||
|
||
## Example | ||
|
||
Here is an example of starting up terrashine using an S3 bucket named `terrashine-example-test-1111`, with credentials provided as environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`. | ||
A TLS terminating reverse proxy hosted is on `example.com` in this setup. | ||
Note that the `/mirror/v1/` path is required in the URL to allow the backend server to serve up redirects correctly. | ||
|
||
``` | ||
AWS_REGION=eu-west-1 AWS_ACCESS_KEY_ID=xxx AWS_SECRET_ACCESS_KEY=xxx RUST_LOG=info ./terrashine --s3-bucket-name terrashine-example-test-1111 --http-redirect-url https://example.com/mirror/v1/ | ||
``` |