Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(apps/dump-store-s3): allow setting custom S3 endpoint #127

Merged
merged 2 commits into from
Feb 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)));
});
}
}