Skip to content

Commit

Permalink
Support s3 address style config (#835)
Browse files Browse the repository at this point in the history
Co-authored-by: mu <[email protected]>
  • Loading branch information
rzvoncek and dispensable authored Jan 8, 2025
1 parent f1013d8 commit 5930dfd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions medusa-example.ini
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ use_sudo_for_restore = True
; Enabling this is not yet supported - we don't have a good way to configure paths to custom certificates.
; ssl_verify = False

; addressing style of s3
; S3 supports two different ways to address a bucket, Virtual Host Style and Path Style.
; you can choose from auto/path/virtual
;s3_addressing_style = auto

;aws_cli_path = <Location of the aws cli binary if not in PATH>

; Read timeout in seconds for the storage provider. Not set by default.
Expand Down
5 changes: 3 additions & 2 deletions medusa/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
'base_path', 'max_backup_age', 'max_backup_count', 'api_profile', 'transfer_max_bandwidth',
'concurrent_transfers', 'multi_part_upload_threshold', 'multipart_chunksize', 'host', 'region', 'port', 'secure',
'ssl_verify', 'aws_cli_path', 'kms_id', 'backup_grace_period_in_days', 'use_sudo_for_restore', 'k8s_mode',
'read_timeout']
'read_timeout', 's3_addressing_style']
)

CassandraConfig = collections.namedtuple(
Expand Down Expand Up @@ -120,7 +120,8 @@ def _build_default_config():
'backup_grace_period_in_days': 10,
'use_sudo_for_restore': 'True',
'multipart_chunksize': '50MB',
'read_timeout': 60
'read_timeout': 60,
's3_addressing_style': 'auto',
}

config['logging'] = {
Expand Down
1 change: 1 addition & 0 deletions medusa/storage/s3_base_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ def connect(self):
tcp_keepalive=True,
max_pool_connections=max_pool_size,
read_timeout=self.read_timeout,
s3={'addressing_style': self.config.s3_addressing_style},
)
if self.credentials.access_key_id is not None:
self.s3_client = boto3.client(
Expand Down

0 comments on commit 5930dfd

Please sign in to comment.