ЛР3 - БПИ2303 - Стругов - на 4

This commit is contained in:
wanderinho
2026-11-10 15:19:31 +03:00
parent 0ab3a341aa
commit bdccb3ad7d
33 changed files with 3591 additions and 23 deletions
+10
View File
@@ -0,0 +1,10 @@
#!/bin/sh
set -eu
cd "$(dirname "$0")/.."
mkdir -p secrets
if [ -e secrets/postgres_password.txt ]; then echo 'Secrets already exist; leaving unchanged'; exit 0; fi
password=$(od -An -N24 -tx1 /dev/urandom | tr -d ' \n')
printf '%s' "$password" > secrets/postgres_password.txt
printf 'postgres://messenger:%s@postgres:5432/messenger?sslmode=disable' "$password" > secrets/database_url.txt
printf '%s' 'redis://redis:6379/0' > secrets/cache_url.txt
chmod 600 secrets/*.txt