Реализовала лабораторную 3 на оценку 4

This commit is contained in:
MacBook
2026-10-16 12:42:16 +03:00
parent 0ab3a341aa
commit c1d62f7f23
32 changed files with 2141 additions and 35 deletions
+18
View File
@@ -0,0 +1,18 @@
#!/bin/sh
set -eu
mkdir -p secrets
if [ ! -f secrets/postgres_password ]; then
umask 077
openssl rand -hex 24 > secrets/postgres_password
fi
if [ ! -f secrets/redis_password ]; then
umask 077
openssl rand -hex 24 > secrets/redis_password
fi
postgres_password=$(cat secrets/postgres_password)
redis_password=$(cat secrets/redis_password)
umask 077
printf 'postgres://messenger:%s@postgres:5432/messenger?sslmode=disable\n' "$postgres_password" > secrets/database_url
printf 'redis://:%s@redis:6379/0\n' "$redis_password" > secrets/cache_url
if [ ! -f .env ]; then cp .env.example .env; fi
printf '%s\n' 'Local .env and secret files are ready.'