forked from mtusi2026/mtusi2026lab4
11 lines
484 B
Bash
Executable File
11 lines
484 B
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
cd "$(dirname "$0")/.."
|
|
[ -f .env ] || { cp .env.example .env; echo ".env создан из .env.example"; }
|
|
mkdir -p secrets
|
|
[ -f secrets/postgres_password.txt ] || printf '%s' "$(grep '^POSTGRES_PASSWORD=' .env | cut -d= -f2-)" > secrets/postgres_password.txt
|
|
[ -f secrets/database_url.txt ] || printf '%s' "$(grep '^DATABASE_URL=' .env | cut -d= -f2-)" > secrets/database_url.txt
|
|
./scripts/gen-s3-secrets.sh
|
|
chmod 644 secrets/*
|
|
echo "секреты готовы"
|