diff --git a/configs/development.ini b/configs/development.ini --- a/configs/development.ini +++ b/configs/development.ini @@ -307,6 +307,9 @@ archive_cache.objectstore.key = key ; secret for s3 auth archive_cache.objectstore.secret = secret +;region for s3 storage +archive_cache.objectstore.region = eu-central-1 + ; number of sharded buckets to create to distribute archives across ; default is 8 shards archive_cache.objectstore.bucket_shards = 8 diff --git a/configs/production.ini b/configs/production.ini --- a/configs/production.ini +++ b/configs/production.ini @@ -275,6 +275,9 @@ archive_cache.objectstore.key = key ; secret for s3 auth archive_cache.objectstore.secret = secret +;region for s3 storage +archive_cache.objectstore.region = eu-central-1 + ; number of sharded buckets to create to distribute archives across ; default is 8 shards archive_cache.objectstore.bucket_shards = 8 diff --git a/rhodecode/config/config_maker.py b/rhodecode/config/config_maker.py --- a/rhodecode/config/config_maker.py +++ b/rhodecode/config/config_maker.py @@ -204,6 +204,7 @@ def sanitize_settings_and_apply_defaults settings_maker.make_setting('archive_cache.objectstore.url', jn(default_cache_dir, 'archive_cache'), default_when_empty=True,) settings_maker.make_setting('archive_cache.objectstore.key', '') settings_maker.make_setting('archive_cache.objectstore.secret', '') + settings_maker.make_setting('archive_cache.objectstore.region', 'eu-central-1') settings_maker.make_setting('archive_cache.objectstore.bucket', 'rhodecode-archive-cache', default_when_empty=True,) settings_maker.make_setting('archive_cache.objectstore.bucket_shards', 8, parser='int') diff --git a/rhodecode/lib/archive_cache/backends/objectstore_cache.py b/rhodecode/lib/archive_cache/backends/objectstore_cache.py --- a/rhodecode/lib/archive_cache/backends/objectstore_cache.py +++ b/rhodecode/lib/archive_cache/backends/objectstore_cache.py @@ -142,10 +142,11 @@ class ObjectStoreCache(BaseCache): endpoint_url = settings.pop('archive_cache.objectstore.url') key = settings.pop('archive_cache.objectstore.key') secret = settings.pop('archive_cache.objectstore.secret') + region = settings.pop('archive_cache.objectstore.region') log.debug('Initializing %s archival cache instance', self) - fs = fsspec.filesystem('s3', anon=False, endpoint_url=endpoint_url, key=key, secret=secret) + fs = fsspec.filesystem('s3', anon=False, endpoint_url=endpoint_url, key=key, secret=secret, region=region) # init main bucket if not fs.exists(self._bucket): diff --git a/rhodecode/tests/rhodecode.ini b/rhodecode/tests/rhodecode.ini --- a/rhodecode/tests/rhodecode.ini +++ b/rhodecode/tests/rhodecode.ini @@ -275,6 +275,9 @@ archive_cache.objectstore.key = key ; secret for s3 auth archive_cache.objectstore.secret = secret +;region for s3 storage +archive_cache.objectstore.region = eu-central-1 + ; number of sharded buckets to create to distribute archives across ; default is 8 shards archive_cache.objectstore.bucket_shards = 8