Skip to content

Commit

Permalink
feat: Added option to set endpoint on s3
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed Aug 27, 2023
1 parent 47bd7a6 commit bdf4934
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/config.ts
Expand Up @@ -85,5 +85,7 @@ export default {
access_key_id: null,
secret_key: null,
defaultBucketName: null,
endpoint: null,
forcePathStyle: null,
},
};
6 changes: 5 additions & 1 deletion src/util/functions.ts
Expand Up @@ -149,7 +149,11 @@ async function autoDownload(client: any, req: any, message: any) {
!config.aws_s3.secret_key
)
throw new Error('Please, configure your aws configs');
const s3Client = new S3Client({ region: config.aws_s3.region });
const s3Client = new S3Client({
region: config.aws_s3.region,
endpoint: config.aws_s3.endpoint || undefined,
forcePathStyle: config.aws_s3.forcePathStyle || undefined,
});
let bucketName = config.aws_s3.defaultBucketName
? config.aws_s3.defaultBucketName
: client.session;
Expand Down

0 comments on commit bdf4934

Please sign in to comment.