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

This commit is contained in:
wanderinho
2026-11-22 22:11:48 +03:00
parent ec540a1a72
commit 0a942ff3ba
32 changed files with 4387 additions and 25 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