feat(lab4): MinIO S3 private bucket, streaming image validation, attachment endpoints, Grade 5 Track 2 reconciler

This commit is contained in:
2026-11-17 02:55:14 +03:00
parent ec540a1a72
commit eaf3963e05
33 changed files with 8458 additions and 21 deletions
+40
View File
@@ -0,0 +1,40 @@
global
log stdout format raw local0
maxconn 4096
defaults
mode http
log global
option httplog
option dontlognull
option redispatch
retries 2
timeout connect 2s
timeout client 30s
timeout server 30s
timeout check 1500ms
resolvers docker_dns
nameserver dns 127.0.0.11:53
resolve_retries 3
timeout resolve 1s
timeout retry 1s
hold other 2s
hold refused 2s
hold nx 2s
hold timeout 2s
hold valid 2s
hold obsolete 2s
frontend http_front
bind *:80
default_backend api_back
backend api_back
balance roundrobin
http-reuse safe
option httpchk
http-check send meth GET uri /health/ready ver HTTP/1.1 hdr Host localhost
http-check expect status 200
default-server inter 1s fastinter 500ms downinter 1s fall 2 rise 1 resolvers docker_dns resolve-prefer ipv4 init-addr none maxconn 256
server-template api 1-8 api:8080 check
+26
View File
@@ -0,0 +1,26 @@
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetBucketLocation",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::messenger-attachments"
]
},
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:PutObject",
"s3:DeleteObject"
],
"Resource": [
"arn:aws:s3:::messenger-attachments/*"
]
}
]
}
+14
View File
@@ -0,0 +1,14 @@
# Redis 7.4 configuration for MTUCI Lab 3 (Shared Sessions + History Cache)
bind 0.0.0.0
port 6379
protected-mode no
# Durable persistence (AOF + RDB snapshot) so cached sessions survive container restarts
appendonly yes
appendfilename "appendonly.aof"
appendfsync everysec
save 60 1
# Memory limits
maxmemory 128mb
maxmemory-policy volatile-lru
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
set -eu
mc alias set local http://s3:9000 "${MINIO_ROOT_USER}" "${MINIO_ROOT_PASSWORD}"
mc mb --ignore-existing "local/${S3_BUCKET}"
mc anonymous set none "local/${S3_BUCKET}"
mc admin user add local "${S3_ACCESS_KEY_ID}" "${S3_SECRET_ACCESS_KEY}"
mc admin policy create local messenger-api-policy /infra/minio-api-policy.json
mc admin policy attach local messenger-api-policy --user "${S3_ACCESS_KEY_ID}"