laba 5 mark 4

This commit is contained in:
2026-11-10 14:47:33 +03:00
parent 276dbdad8a
commit 5ca6b6f7ad
75 changed files with 7466 additions and 36 deletions
+22
View File
@@ -0,0 +1,22 @@
{
"identities": [
{
"name": "admin",
"credentials": [
{ "accessKey": "@ADMIN_ACCESS_KEY@", "secretKey": "@ADMIN_SECRET_KEY@" }
],
"actions": ["Admin", "Read", "List", "Tagging", "Write"]
},
{
"name": "messenger-api",
"credentials": [
{ "accessKey": "@API_ACCESS_KEY@", "secretKey": "@API_SECRET_KEY@" }
],
"actions": [
"Read:messenger-attachments",
"Write:messenger-attachments",
"List:messenger-attachments"
]
}
]
}
+24
View File
@@ -0,0 +1,24 @@
#!/bin/sh
# SeaweedFS all-in-one (master + volume + filer + S3 gateway) for the lab stand.
#
# - master/volume/filer and their web UIs listen on 127.0.0.1 INSIDE the
# container only (-ip.bind): their HTTP API has no authentication and must
# not be reachable from the Docker network. Only the S3 gateway (9000)
# listens on all interfaces, and it requires SigV4 credentials.
# - Identities and rights come from s3.json.template; the secret values are
# substituted at start from Docker secrets into a file readable by root
# only (never stored in Git or in the image).
set -eu
umask 077
s() { cat "/run/secrets/$1"; }
sed -e "s|@ADMIN_ACCESS_KEY@|$(s s3_admin_access_key_id)|" \
-e "s|@ADMIN_SECRET_KEY@|$(s s3_admin_secret_access_key)|" \
-e "s|@API_ACCESS_KEY@|$(s s3_access_key_id)|" \
-e "s|@API_SECRET_KEY@|$(s s3_secret_access_key)|" \
/opt/lab/s3.json.template > /tmp/s3.json
exec weed -logtostderr=true server \
-dir=/data \
-ip=127.0.0.1 -ip.bind=127.0.0.1 \
-master.volumeSizeLimitMB=256 -volume.max=0 \
-s3 -s3.port=9000 -s3.ip.bind=0.0.0.0 -s3.config=/tmp/s3.json