Skip to content

Commit

Permalink
feat(apps/dump-store-s3): allow setting custom S3 endpoint (#127)
Browse files Browse the repository at this point in the history
Allows using a custom s3-compatible store for persisting board data

When S3_ENDPOINT is not set, defaults to AWS-specific endpoints.

Co-authored-by: Mitch Fossen <mitch@fossen.io>
Co-authored-by: Nico Rehwaldt <git_nikku@nixis.de>
  • Loading branch information
3 people authored Feb 16, 2022
1 parent 7c59caa commit 6ed51fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Several aspects of [wuffle](https://wuffle.dev) are configured via environment v
| `S3_BUCKET` | | Name of S3 bucket to load and dump task board to |
| `S3_REGION` | | Region of the S3 bucket to dump to |
| `S3_KEY` | | Name of the file to store in the bucket; defaults to `storedump.json` |
| `S3_ENDPOINT` | | Fully qualified domain name of the S3 compatible endpoint to use; defaults to AWS S3 endpoints |


### Background Sync
Expand Down
6 changes: 4 additions & 2 deletions packages/app/lib/apps/dump-store/s3/S3.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ function S3() {
AWS_SECRET_ACCESS_KEY: secretAccessKey,
S3_BUCKET: bucket,
S3_REGION: region,
S3_KEY: key = 'storedump.json'
S3_KEY: key = 'storedump.json',
S3_ENDPOINT: endpoint
} = process.env;

const s3client = new S3Client({
region,
endpoint,
credentials: {
accessKeyId,
secretAccessKey
Expand Down Expand Up @@ -68,4 +70,4 @@ function streamToBuffer(readable) {
readable.on('data', (data) => buffers.push(data));
readable.on('end', () => resolve(Buffer.concat(buffers)));
});
}
}

0 comments on commit 6ed51fc

Please sign in to comment.