Done Track 4
This commit is contained in:
@@ -81,6 +81,12 @@ backend api
|
||||
http-request disable-l7-retry if METH_POST !is_message_post
|
||||
http-request disable-l7-retry if METH_POST !has_idem_key
|
||||
http-request disable-l7-retry if METH_DELETE
|
||||
# Lab4: 503 вложения означает отказ общего S3 — на другой реплике тот же S3, повтор
|
||||
# только утроил бы ожидание клиента (3 × S3_OPERATION_TIMEOUT_SECONDS). conn-failure остаётся.
|
||||
http-request disable-l7-retry if { path_beg /api/v1/attachments/ }
|
||||
# Upload: после приёма тела API проверяет PNG/JPEG и делает S3 PUT с дедлайном
|
||||
# 6 s + size / 1 MiB/s (<= 16 s для 10 MiB) — 10 s «timeout server» мало.
|
||||
http-request set-timeout server 40s if METH_POST { path_reg ^/api/v1/chats/[^/]+/attachments$ }
|
||||
|
||||
# До 8 реплик (scale/rolling update); пустые слоты остаются в MAINT, пока DNS не вернёт адрес.
|
||||
server-template api 8 api:8080
|
||||
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user