feat: крролик, по тщ 5 лаба

This commit is contained in:
Enterxx2
2026-11-10 12:38:09 +03:00
parent 1d8dfb7ea4
commit 595a959b96
65 changed files with 2692 additions and 216 deletions
+15
View File
@@ -71,3 +71,18 @@ cat >secrets/s3_identities.json <<EOF
EOF
chmod 644 secrets/s3_identities.json
echo "secrets ready in secrets/ (values are not printed)"
# URL хранится в файле и монтируется только dispatcher/worker.
if [ ! -s secrets/broker_url ]; then
python3 - <<'PYTHON'
from pathlib import Path
from urllib.parse import quote
values = dict(line.split("=", 1) for line in Path(".env").read_text().splitlines()
if "=" in line and not line.startswith("#"))
user = quote(values.get("RABBITMQ_USER", "test"), safe="")
password = quote(values.get("RABBITMQ_PASS", "test"), safe="")
Path("secrets/broker_url").write_text(f"amqp://{user}:{password}@broker:5672/")
PYTHON
echo "created secrets/broker_url"
fi
chmod 644 secrets/broker_url