15
15
from storages .backends .s3boto3 import S3Boto3Storage
16
16
17
17
from readthedocs .builds .storage import BuildMediaStorageMixin
18
- from readthedocs .storage .mixins import OverrideHostnameMixin
18
+
19
+ from .mixins import OverrideHostnameMixin , S3PrivateBucketMixin
19
20
20
21
21
22
class S3BuildMediaStorage (BuildMediaStorageMixin , OverrideHostnameMixin , S3Boto3Storage ):
@@ -35,7 +36,7 @@ def __init__(self, *args, **kwargs):
35
36
)
36
37
37
38
38
- class S3BuildCommandsStorage (S3Boto3Storage ):
39
+ class S3BuildCommandsStorage (S3PrivateBucketMixin , S3Boto3Storage ):
39
40
40
41
"""An AWS S3 Storage backend for build commands."""
41
42
@@ -50,10 +51,6 @@ def __init__(self, *args, **kwargs):
50
51
'Ensure S3_BUILD_COMMANDS_STORAGE_BUCKET is defined.' ,
51
52
)
52
53
53
- self .bucket_acl = 'private'
54
- self .default_acl = 'private'
55
- self .querystring_auth = True
56
-
57
54
58
55
class S3StaticStorage (OverrideHostnameMixin , ManifestFilesMixin , S3Boto3Storage ):
59
56
@@ -80,7 +77,7 @@ def __init__(self, *args, **kwargs):
80
77
self .querystring_auth = False
81
78
82
79
83
- class S3BuildEnvironmentStorage (BuildMediaStorageMixin , S3Boto3Storage ):
80
+ class S3BuildEnvironmentStorage (S3PrivateBucketMixin , BuildMediaStorageMixin , S3Boto3Storage ):
84
81
85
82
bucket_name = getattr (settings , 'S3_BUILD_ENVIRONMENT_STORAGE_BUCKET' , None )
86
83
@@ -92,7 +89,3 @@ def __init__(self, *args, **kwargs):
92
89
'AWS S3 not configured correctly. '
93
90
'Ensure S3_BUILD_ENVIRONMENT_STORAGE_BUCKET is defined.' ,
94
91
)
95
-
96
- self .bucket_acl = 'private'
97
- self .default_acl = 'private'
98
- self .querystring_auth = True
0 commit comments