add level 4

This commit is contained in:
Матвей
2026-10-22 11:37:09 +03:00
parent e9ef559c34
commit 9017861707
24 changed files with 571 additions and 31 deletions
+4 -2
View File
@@ -25,10 +25,12 @@ admin_key = write("s3_admin_key", secrets.token_hex(16))
admin_secret = write("s3_admin_secret", secrets.token_hex(32))
app_key = write("s3_access_key_id", secrets.token_hex(16))
app_secret = write("s3_secret_access_key", secrets.token_hex(32))
write("s3.json", json.dumps({"identities": [
config_path = root / "s3.json"
config_path.write_text(json.dumps({"identities": [
{"name": "bootstrap", "credentials": [{"accessKey": admin_key, "secretKey": admin_secret}],
"actions": ["Admin", "Read", "Write", "List", "Tagging"]},
{"name": "api", "credentials": [{"accessKey": app_key, "secretKey": app_secret}],
"actions": ["Read:messenger-attachments", "Write:messenger-attachments", "List:messenger-attachments"]},
]}, indent=2))
]}, indent=2) + "\n")
config_path.chmod(0o600)
print("Local secrets ready; existing values preserved.")
+1
View File
@@ -3,5 +3,6 @@ set -eu
cd "$(dirname "$0")/.."
docker compose restart postgres s3
docker compose up -d --wait postgres s3
docker compose run --rm --no-deps s3-init
docker compose restart api-a api-b load_balancer
docker compose up -d --wait api-a api-b load_balancer