forked from mtusi2026/mtusi2026lab5
Исходники, миграции, Dockerfile и стенд lab4 нужны как основа асинхронной обработки вложений. Co-authored-by: Cursor <cursoragent@cursor.com>
49 lines
1010 B
Bash
49 lines
1010 B
Bash
#!/bin/sh
|
|
# One SeaweedFS process: master, volume, filer, S3. The filer UI is off.
|
|
# Anonymous identity has no actions. The API user is limited to one bucket.
|
|
set -eu
|
|
: "${S3_BUCKET:?}"
|
|
: "${S3_ACCESS_KEY_ID:?}"
|
|
: "${S3_SECRET_ACCESS_KEY:?}"
|
|
|
|
cat > /tmp/s3.json <<EOF
|
|
{
|
|
"identities": [
|
|
{
|
|
"name": "anonymous",
|
|
"actions": []
|
|
},
|
|
{
|
|
"name": "messenger-app",
|
|
"credentials": [
|
|
{
|
|
"accessKey": "${S3_ACCESS_KEY_ID}",
|
|
"secretKey": "${S3_SECRET_ACCESS_KEY}"
|
|
}
|
|
],
|
|
"actions": [
|
|
"Read:${S3_BUCKET}",
|
|
"Read:${S3_BUCKET}/*",
|
|
"Write:${S3_BUCKET}",
|
|
"Write:${S3_BUCKET}/*",
|
|
"List:${S3_BUCKET}",
|
|
"Tagging:${S3_BUCKET}/*",
|
|
"Admin:${S3_BUCKET}"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
EOF
|
|
|
|
exec weed server \
|
|
-dir=/data \
|
|
-ip.bind=0.0.0.0 \
|
|
-master.port=9333 \
|
|
-volume.port=8080 \
|
|
-filer \
|
|
-filer.port=8888 \
|
|
-filer.exposeDirectoryData=false \
|
|
-s3 \
|
|
-s3.port=9000 \
|
|
-s3.config=/tmp/s3.json
|