forked from mtusi2026/mtusi2026lab2
lab2: PostgreSQL, sessions, compose, evidence tooling.
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
# Создаёт локальные секреты (не коммитятся). Безопасно повторять: существующие не перезаписываются.
|
||||
set -eu
|
||||
mkdir -p secrets
|
||||
if [ ! -f secrets/pg_password ]; then
|
||||
head -c 24 /dev/urandom | base64 | tr -d '/+=\n' > secrets/pg_password
|
||||
fi
|
||||
if [ ! -f secrets/database_url ]; then
|
||||
printf 'postgresql://msg:%s@postgres:5432/msg' "$(cat secrets/pg_password)" > secrets/database_url
|
||||
fi
|
||||
chmod 600 secrets/*
|
||||
Reference in New Issue
Block a user