Skip to content

Commit

Permalink
[FIX] S3 uplaods not working for custom URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigok committed Jul 6, 2017
1 parent a3b64c0 commit 2a8ea73
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/rocketchat-file-upload/server/config/AmazonS3.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const configure = _.debounce(function() {
const URLExpiryTimeSpan = RocketChat.settings.get('FileUpload_S3_URLExpiryTimeSpan');
const Region = RocketChat.settings.get('FileUpload_S3_Region');
// const CDN = RocketChat.settings.get('FileUpload_S3_CDN');
// const BucketURL = RocketChat.settings.get('FileUpload_S3_BucketURL');
const BucketURL = RocketChat.settings.get('FileUpload_S3_BucketURL');

if (!Bucket || !AWSAccessKeyId || !AWSSecretAccessKey) {
return;
Expand All @@ -53,6 +53,10 @@ const configure = _.debounce(function() {
URLExpiryTimeSpan
};

if (BucketURL) {
config.connection.endpoint = BucketURL;
}

AmazonS3Uploads.store = FileUpload.configureUploadsStore('AmazonS3', AmazonS3Uploads.name, config);
AmazonS3Avatars.store = FileUpload.configureUploadsStore('AmazonS3', AmazonS3Avatars.name, config);
}, 500);
Expand Down

0 comments on commit 2a8ea73

Please sign in to comment.