forked from mtusi2026/mtusi2026lab4
Собрать стенд lab4 с вложениями в приватном S3-bucket.
Метаданные остаются в PostgreSQL, байты — в RustFS, чтобы скачивание пережило остановку одной реплики API.
This commit is contained in:
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
docker compose --env-file .env -f compose.yaml exec -T api python3 - <<'PY'
|
||||
from urllib.request import urlopen
|
||||
try:
|
||||
urlopen("http://s3:9000/messenger-attachments/", timeout=3)
|
||||
raise SystemExit("anonymous bucket read was allowed")
|
||||
except Exception as exc:
|
||||
code = getattr(exc, "code", None)
|
||||
if code not in (401, 403):
|
||||
raise SystemExit("unexpected result %s %s" % (type(exc).__name__, code))
|
||||
print("anonymous S3 status", code)
|
||||
PY
|
||||
Reference in New Issue
Block a user