ЛР 2: PostgreSQL, сессии, Redis и исследование
Skeleton contracts / contracts (pull_request) Failing after 30s
Skeleton contracts / contracts (pull_request) Failing after 30s
This commit is contained in:
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
umask 077
|
||||
mkdir -p secrets
|
||||
|
||||
if [ -e secrets/postgres_password ] || [ -e secrets/database_url ]; then
|
||||
if [ ! -s secrets/postgres_password ] || [ ! -s secrets/database_url ]; then
|
||||
printf '%s\n' 'Incomplete secrets directory; repair it manually without replacing an existing database password.' >&2
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
password="$(openssl rand -hex 24)"
|
||||
printf '%s' "$password" > secrets/postgres_password
|
||||
printf 'Host=postgres;Port=5432;Database=messenger;Username=messenger;Password=%s' "$password" > secrets/database_url
|
||||
printf '%s\n' 'Created local database secrets in ignored secrets/ directory.'
|
||||
Reference in New Issue
Block a user