Completed for a grade of four
This commit is contained in:
+11
-8
@@ -6,11 +6,14 @@ cd "$(dirname "$0")/.."
|
||||
|
||||
mkdir -p secrets
|
||||
|
||||
if [ ! -s secrets/db_password ]; then
|
||||
# Readable by the non-root users inside the api/postgres containers (bind-mounted as is).
|
||||
umask 022
|
||||
openssl rand -hex 24 > secrets/db_password
|
||||
echo "created secrets/db_password"
|
||||
else
|
||||
echo "secrets/db_password already exists, keeping it"
|
||||
fi
|
||||
# Readable by the non-root users inside the containers (bind-mounted as is).
|
||||
umask 022
|
||||
|
||||
for name in db_password redis_password; do
|
||||
if [ ! -s "secrets/$name" ]; then
|
||||
openssl rand -hex 24 > "secrets/$name"
|
||||
echo "created secrets/$name"
|
||||
else
|
||||
echo "secrets/$name already exists, keeping it"
|
||||
fi
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user