forked from mtusi2026/mtusi2026lab6
Собрать наблюдаемый стенд, чтобы причину деградации API и worker было видно по метрикам, логам и трассам.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
"""Write the local SeaweedFS identity file from .env. The file is gitignored."""
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
root = Path(__file__).resolve().parents[1]
|
||||
env = {}
|
||||
for line in (root / ".env").read_text(encoding="utf-8").splitlines():
|
||||
line = line.strip()
|
||||
if not line or line.startswith("#") or "=" not in line:
|
||||
continue
|
||||
key, value = line.split("=", 1)
|
||||
env[key] = value
|
||||
|
||||
out = root / "infra" / "seaweed" / "s3.json"
|
||||
out.parent.mkdir(parents=True, exist_ok=True)
|
||||
document = {
|
||||
"identities": [
|
||||
{
|
||||
"name": "app",
|
||||
"credentials": [
|
||||
{
|
||||
"accessKey": env["S3_ACCESS_KEY"],
|
||||
"secretKey": env["S3_SECRET_KEY"],
|
||||
}
|
||||
],
|
||||
"actions": ["Admin", "Read", "List", "Write", "Tagging"],
|
||||
}
|
||||
]
|
||||
}
|
||||
out.write_text(json.dumps(document), encoding="utf-8")
|
||||
print("wrote infra/seaweed/s3.json")
|
||||
Reference in New Issue
Block a user