forked from mtusi2026/mtusi2026lab5
ЛР 5: реализация мессенджера и сценарии проверки
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
global
|
||||
maxconn 128
|
||||
log stdout format raw local0
|
||||
|
||||
defaults
|
||||
mode http
|
||||
log global
|
||||
timeout connect 1s
|
||||
timeout client 15s
|
||||
timeout server 15s
|
||||
timeout http-request 8s
|
||||
timeout queue 2s
|
||||
timeout check 1s
|
||||
retries 0
|
||||
|
||||
resolvers docker
|
||||
nameserver internal 127.0.0.11:53
|
||||
resolve_retries 2
|
||||
timeout resolve 500ms
|
||||
timeout retry 500ms
|
||||
hold valid 2s
|
||||
|
||||
frontend public
|
||||
bind :8080
|
||||
default_backend messenger
|
||||
|
||||
backend messenger
|
||||
balance roundrobin
|
||||
option httpchk GET /health/ready
|
||||
http-check expect status 200
|
||||
server-template api 8 api:8080 check inter 500ms fall 2 rise 1 resolvers docker resolve-prefer ipv4 init-addr none
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{"Effect": "Allow", "Action": ["s3:ListBucket"], "Resource": ["arn:aws:s3:::attachments"]},
|
||||
{"Effect": "Allow", "Action": ["s3:PutObject", "s3:GetObject", "s3:DeleteObject"],
|
||||
"Resource": ["arn:aws:s3:::attachments/original/*", "arn:aws:s3:::attachments/staging/*",
|
||||
"arn:aws:s3:::attachments/results/*"]}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
export HOME=/tmp
|
||||
rc alias set lab http://s3:9000 "$RUSTFS_ACCESS_KEY" "$RUSTFS_SECRET_KEY"
|
||||
rc mb --ignore-existing lab/attachments
|
||||
access=$(cat /run/secrets/s3_access)
|
||||
secret=$(cat /run/secrets/s3_secret)
|
||||
rc admin user add lab/ "$access" "$secret"
|
||||
rc admin policy create lab/ messenger-objects /bootstrap/api-policy.json
|
||||
rc admin policy attach lab/ messenger-objects --user "$access"
|
||||
Reference in New Issue
Block a user