Skip to content

Commit

Permalink
feat(apps/dump-store-s3): allow setting custom S3 endpoint
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
  • Loading branch information
Mitch Fossen committed Feb 16, 2022
1 parent 7c59caa commit 4b365a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docs/CONFIG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Config


Several aspects of [wuffle](https://wuffle.dev) are configured via environment variables:

Expand Down 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 service you are using to persist data with; 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 4b365a7

Please sign in to comment.