forked from mtusi2026/mtusi2026lab5
lab5
This commit is contained in:
Executable
+7
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
mc alias set local http://minio:9000 "$S3_ROOT_USER" "$S3_ROOT_PASSWORD"
|
||||
mc mb --ignore-existing "local/$S3_BUCKET"
|
||||
mc admin policy create local messenger-api-policy-v2 /tmp/s3-policy.json || true
|
||||
mc admin user add local "$S3_ACCESS_KEY_ID" "$S3_SECRET_ACCESS_KEY" || true
|
||||
mc admin policy attach local messenger-api-policy-v2 --user "$S3_ACCESS_KEY_ID"
|
||||
@@ -0,0 +1,29 @@
|
||||
global
|
||||
log stdout format raw local0
|
||||
maxconn 2048
|
||||
|
||||
defaults
|
||||
mode http
|
||||
option httplog
|
||||
timeout http-request 5s
|
||||
timeout connect 1s
|
||||
timeout client 30s
|
||||
timeout server 30s
|
||||
option httpchk GET /health/ready
|
||||
http-check expect status 200
|
||||
|
||||
resolvers docker
|
||||
nameserver dns 127.0.0.11:53
|
||||
resolve_retries 3
|
||||
timeout resolve 1s
|
||||
timeout retry 1s
|
||||
hold valid 5s
|
||||
|
||||
frontend public
|
||||
bind :8080
|
||||
default_backend api_backend
|
||||
|
||||
backend api_backend
|
||||
balance roundrobin
|
||||
option httpchk GET /health/ready
|
||||
server-template api 4 api:8080 check inter 1s fall 2 rise 2 resolvers docker init-addr last,libc,none
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Action": ["s3:ListBucket", "s3:GetBucketLocation"],
|
||||
"Effect": "Allow",
|
||||
"Resource": ["arn:aws:s3:::messenger-attachments"]
|
||||
},
|
||||
{
|
||||
"Action": ["s3:GetObject", "s3:PutObject", "s3:DeleteObject"],
|
||||
"Effect": "Allow",
|
||||
"Resource": ["arn:aws:s3:::messenger-attachments/*"]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user