ЛР 4: реализация мессенджера и сценарии проверки

This commit is contained in:
Russiankryt
2026-12-03 17:20:50 +03:00
parent ec540a1a72
commit c87c84df1f
26 changed files with 1549 additions and 37 deletions
+31
View File
@@ -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
+8
View File
@@ -0,0 +1,8 @@
{
"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/*"]}
]
}
+10
View File
@@ -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"