Skip to content

Commit d486011

Browse files
authored
Dev: Allow Minio to be used without debug mode (#11272)
The rclone setup currently assume that debug mode always implies using Minio. Allow developers to test with debug mode disabled by making the S3_PROVIDER explicit. Set S3_PROVIDER to "AWS" in settings/base.py and "minio" in settomgs/docker_compose.py Signed-off-by: Peter Hoyes <[email protected]>
1 parent 23330ff commit d486011

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

readthedocs/settings/base.py

+2
Original file line numberDiff line numberDiff line change
@@ -1047,3 +1047,5 @@ def SOCIALACCOUNT_PROVIDERS(self):
10471047
"timeout": CACHEOPS_TIMEOUT,
10481048
},
10491049
}
1050+
1051+
S3_PROVIDER = "AWS"

readthedocs/settings/docker_compose.py

+1
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ def DATABASES(self): # noqa
196196
S3_STATIC_STORAGE_BUCKET = "static"
197197
S3_STATIC_STORAGE_OVERRIDE_HOSTNAME = PRODUCTION_DOMAIN
198198
S3_MEDIA_STORAGE_OVERRIDE_HOSTNAME = PRODUCTION_DOMAIN
199+
S3_PROVIDER = "minio"
199200

200201
AWS_S3_ENCRYPTION = False
201202
AWS_S3_SECURE_URLS = False

readthedocs/storage/s3_storage.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@
2424
class S3BuildMediaStorageMixin(BuildMediaStorageMixin, S3Boto3Storage):
2525
@cached_property
2626
def _rclone(self):
27-
provider = "AWS"
28-
# If a custom endpoint URL is given and
29-
# we are running in DEBUG mode, use minio as provider.
30-
if self.endpoint_url and settings.DEBUG:
31-
provider = "minio"
27+
provider = settings.S3_PROVIDER
3228

3329
return RCloneS3Remote(
3430
bucket_name=self.bucket_name,

0 commit comments

Comments
 (0)