forked from mtusi2026/mtusi2026lab7
add level 3
This commit is contained in:
+4
-1
@@ -36,7 +36,10 @@ class S3Settings:
|
||||
max_pixels = int(os.environ.get("MAX_IMAGE_PIXELS", "40000000"))
|
||||
if not 1 <= max_bytes <= 10485760 or not 1 <= max_pixels <= 40000000:
|
||||
raise ValueError("Image limits exceed contract")
|
||||
return cls(os.environ.get("S3_ENDPOINT", "http://s3:8333"),
|
||||
endpoint = os.environ.get("S3_ENDPOINT", "https://s3:8333")
|
||||
if not endpoint.startswith("https://") or not os.environ.get("AWS_CA_BUNDLE"):
|
||||
raise ValueError("S3 requires HTTPS and AWS_CA_BUNDLE")
|
||||
return cls(endpoint,
|
||||
os.environ.get("S3_REGION", "us-east-1"),
|
||||
os.environ.get("S3_BUCKET", "messenger-attachments"),
|
||||
secret("S3_ACCESS_KEY_ID"), secret("S3_SECRET_ACCESS_KEY"),
|
||||
|
||||
Reference in New Issue
Block a user