Выполнить лабораторную 4: S3-вложения и согласованность хранилищ

This commit is contained in:
wpyatzy
2026-11-06 19:53:58 +03:00
parent ec540a1a72
commit d228560474
77 changed files with 15769 additions and 63 deletions
+17
View File
@@ -0,0 +1,17 @@
#!/bin/sh
set -eu
ready=false
for attempt in $(seq 1 60); do
if mc alias set local http://s3:9000 "$S3_ROOT_USER" "$S3_ROOT_PASSWORD" >/dev/null 2>&1; then
ready=true
break
fi
sleep 1
done
[ "$ready" = true ] || exit 1
mc mb --ignore-existing local/messenger-attachments >/dev/null
mc anonymous set none local/messenger-attachments >/dev/null
mc admin user add local "$S3_API_USER" "$S3_API_PASSWORD" >/dev/null
mc admin policy create local lab4-attachments /bootstrap/api-policy.json >/dev/null
mc admin policy attach local lab4-attachments --user "$S3_API_USER" >/dev/null
printf '%s\n' 'PASS: private bucket and restricted application principal configured'