diff --git a/static/js/core-config-setup.js b/static/js/core-config-setup.js index 13b49b865..e100a01b5 100644 --- a/static/js/core-config-setup.js +++ b/static/js/core-config-setup.js @@ -69,7 +69,8 @@ angular.module("core-config-setup", ['angularFileUpload']) {'name': 's3_access_key', 'title': 'AWS Access Key', 'placeholder': 'accesskeyhere', 'kind': 'text'}, {'name': 's3_secret_key', 'title': 'AWS Secret Key', 'placeholder': 'secretkeyhere', 'kind': 'text'}, {'name': 's3_bucket', 'title': 'S3 Bucket', 'placeholder': 'my-cool-bucket', 'kind': 'text'}, - {'name': 'storage_path', 'title': 'Storage Directory', 'placeholder': '/path/inside/bucket', 'kind': 'text'} + {'name': 'storage_path', 'title': 'Storage Directory', 'placeholder': '/path/inside/bucket', 'kind': 'text'}, + {'name': 'host', 'title': 'S3 Host (optional)', 'placeholder': 's3.amazonaws.com', 'kind': 'text', 'optional': true} ], 'GoogleCloudStorage': [ diff --git a/storage/cloud.py b/storage/cloud.py index c1de05ad8..9148819dd 100644 --- a/storage/cloud.py +++ b/storage/cloud.py @@ -396,11 +396,13 @@ class _CloudStorage(BaseStorageV2): class S3Storage(_CloudStorage): - def __init__(self, storage_path, s3_access_key, s3_secret_key, s3_bucket): + def __init__(self, storage_path, s3_access_key, s3_secret_key, s3_bucket, host=None): upload_params = { 'encrypt_key': True, } connect_kwargs = {} + if host: + connect_kwargs['host'] = host super(S3Storage, self).__init__(boto.s3.connection.S3Connection, boto.s3.key.Key, connect_kwargs, upload_params, storage_path, s3_access_key, s3_secret_key, s3_bucket)