Unset Kanboard pgpassword earlier

This commit is contained in:
Disassembler 2017-11-29 21:10:23 +01:00
parent b46cd81b27
commit 81f4dd3dce

View File

@ -33,6 +33,7 @@ sudo -u postgres psql -f /tmp/kanboard-createdb.sql
rm -f /tmp/kanboard-createdb.sql rm -f /tmp/kanboard-createdb.sql
export PGPASSWORD=${KANBOARD_PWD} export PGPASSWORD=${KANBOARD_PWD}
psql -f /srv/kanboard/app/Schema/Sql/postgres.sql kanboard kanboard psql -f /srv/kanboard/app/Schema/Sql/postgres.sql kanboard kanboard
unset PGPASSWORD
# Configure Kanboard # Configure Kanboard
envsubst <${SOURCE_DIR}/kanboard/srv/kanboard/config.php >/srv/kanboard/config.php envsubst <${SOURCE_DIR}/kanboard/srv/kanboard/config.php >/srv/kanboard/config.php
@ -40,8 +41,7 @@ export KANBOARD_ADMIN_USER=admin
export KANBOARD_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) export KANBOARD_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
export KANBOARD_ADMIN_HASH=$(php -r "echo password_hash('${KANBOARD_ADMIN_PWD}', PASSWORD_BCRYPT);") export KANBOARD_ADMIN_HASH=$(php -r "echo password_hash('${KANBOARD_ADMIN_PWD}', PASSWORD_BCRYPT);")
envsubst <${SOURCE_DIR}/kanboard/tmp/kanboard-adminpwd.sql >/tmp/kanboard-adminpwd.sql envsubst <${SOURCE_DIR}/kanboard/tmp/kanboard-adminpwd.sql >/tmp/kanboard-adminpwd.sql
psql -f /tmp/kanboard-adminpwd.sql kanboard kanboard sudo -u postgres psql -f /tmp/kanboard-adminpwd.sql kanboard
unset PGPASSWORD
# Create OS user # Create OS user
adduser --system --group --home /srv/kanboard --shell /bin/false kanboard adduser --system --group --home /srv/kanboard --shell /bin/false kanboard