mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
s3: Add a setting for S3 addressing style.
This controls if boto3 attempts to use
`https://bucketname.endpointname/` or `https://endpointname/bucket/`
as its prefix. See
https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
Fixes: #28424.
(cherry picked from commit c1a26380a9)
This commit is contained in:
committed by
Tim Abbott
parent
5192ae0fd2
commit
da49f1bac1
@@ -65,6 +65,7 @@ def get_bucket(bucket_name: str, authed: bool = True) -> Bucket:
|
||||
endpoint_url=settings.S3_ENDPOINT_URL,
|
||||
config=Config(
|
||||
signature_version=None if authed else botocore.UNSIGNED,
|
||||
s3={"addressing_style": settings.S3_ADDRESSING_STYLE},
|
||||
),
|
||||
).Bucket(bucket_name)
|
||||
|
||||
|
||||
@@ -148,6 +148,7 @@ S3_AVATAR_BUCKET = ""
|
||||
S3_AUTH_UPLOADS_BUCKET = ""
|
||||
S3_REGION: Optional[str] = None
|
||||
S3_ENDPOINT_URL: Optional[str] = None
|
||||
S3_ADDRESSING_STYLE: Literal["auto", "virtual", "path"] = "auto"
|
||||
S3_SKIP_PROXY = True
|
||||
S3_UPLOADS_STORAGE_CLASS: Literal[
|
||||
"GLACIER_IR",
|
||||
|
||||
@@ -788,6 +788,7 @@ LOCAL_UPLOADS_DIR = "/home/zulip/uploads"
|
||||
# S3_AVATAR_BUCKET = ""
|
||||
# S3_REGION = None
|
||||
# S3_ENDPOINT_URL = None
|
||||
# S3_ADDRESSING_STYLE = "auto"
|
||||
# S3_SKIP_PROXY = True
|
||||
# S3_UPLOADS_STORAGE_CLASS = "STANDARD"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user