1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-17 18:44:45 +02:00

All: Resolves #3691: Added support for a custom S3 URL (#3921)

This commit is contained in:
Aaron 2020-10-20 11:44:11 +01:00 committed by GitHub
parent 0f9d92dd3d
commit a93bda71fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View File

@ -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'),
};
}
@ -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);

View File

@ -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,