Skip to content

Commit

Permalink
feat(verdaccio-aws-s3-storage): Allow endpoint to be configurable (#319)
Browse files Browse the repository at this point in the history
* fix: allow endpoint to be configurable

Recently a new feature ws introduced to allow passing the configuration values through environment variables only this didn't cover the `endpoint`-config this PR adds supports for defining the S3 Endpoint in the environment variables.

* docs: Updated README.md

Added call out that `endpoint` is also supported for the environment variables
  • Loading branch information
weyert authored and juanpicado committed Jan 28, 2020
1 parent 26ddd6a commit 1191dcd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plugins/aws-s3-storage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ The configured values can either be the actual value or the name of an environme
- `bucket`
- `keyPrefix`
- `region`
- `endpoint`
- `accessKeyID`
- `secretAccessKey`

Expand All @@ -64,6 +65,7 @@ store:
aws-s3-storage:
bucket: S3_BUCKET # If an environment variable named S3_BUCKET is set, it will use that value. Otherwise assumes the bucket is named 'S3_BUCKET'
keyPrefix: S3_KEY_PREFIX # If an environment variable named S3_KEY_PREFIX is set, it will use that value. Otherwise assumes the bucket is named 'S3_KEY_PREFIX'
endpoint: S3_ENDPOINT # If an environment variable named S3_ENDPOINT is set, it will use that value. Otherwise assumes the bucket is named 'S3_ENDPOINT'
...
```

Expand Down
1 change: 1 addition & 0 deletions plugins/aws-s3-storage/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export default class S3Database implements IPluginStorage<S3Config> {

this.config.bucket = setConfigValue(this.config.bucket);
this.config.keyPrefix = setConfigValue(this.config.keyPrefix);
this.config.endpoint = setConfigValue(this.config.endpoint);
this.config.region = setConfigValue(this.config.region);
this.config.accessKeyId = setConfigValue(this.config.accessKeyId);
this.config.secretAccessKey = setConfigValue(this.config.secretAccessKey);
Expand Down

0 comments on commit 1191dcd

Please sign in to comment.