add level 3

This commit is contained in:
Матвей
2026-11-07 15:00:53 +03:00
parent eafb825657
commit 7b6c10cde9
54 changed files with 1593 additions and 120 deletions
+4 -1
View File
@@ -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"),