Skip to content

Commit

Permalink
All: Resolves #3691: Added support for a custom S3 URL (#3921)
Browse files Browse the repository at this point in the history
  • Loading branch information
thackeraaron authored Oct 20, 2020
1 parent 0f9d92d commit a93bda7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ReactNativeClient/lib/SyncTargetAmazonS3.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ class SyncTargetAmazonS3 extends BaseSyncTarget {
accessKeyId: Setting.value('sync.8.username'),
secretAccessKey: Setting.value('sync.8.password'),
s3UseArnRegion: true, // override the request region with the region inferred from requested resource's ARN
s3ForcePathStyle: true,
endpoint: Setting.value('sync.8.url'),
};
}

Expand All @@ -56,6 +58,8 @@ class SyncTargetAmazonS3 extends BaseSyncTarget {
accessKeyId: options.username(),
secretAccessKey: options.password(),
s3UseArnRegion: true,
s3ForcePathStyle: true,
endpoint: options.url(),
};

const api = new S3(apiOptions);
Expand Down
11 changes: 11 additions & 0 deletions ReactNativeClient/lib/models/Setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,17 @@ class Setting extends BaseModel {
label: () => _('AWS S3 bucket'),
description: () => emptyDirWarning,
},
'sync.8.url': {
value: 'https://s3.amazonaws.com/',
type: SettingItemType.String,
section: 'sync',
show: (settings:any) => {
return settings['sync.target'] == SyncTargetRegistry.nameToId('amazon_s3');
},
public: true,
label: () => _('AWS S3 URL'),
secure: false,
},
'sync.8.username': {
value: '',
type: SettingItemType.String,
Expand Down

0 comments on commit a93bda7

Please sign in to comment.