Add Kanboard admin password generation

This commit is contained in:
Disassembler 2017-10-14 12:50:36 +02:00
parent 4fcaf89aa8
commit 153c6b2572
2 changed files with 2 additions and 4 deletions

View File

@ -38,6 +38,7 @@ psql -f /srv/kanboard/app/Schema/Sql/postgres.sql kanboard kanboard
envsubst <${SOURCE_DIR}/kanboard/srv/kanboard/config.php >/srv/kanboard/config.php
export KANBOARD_ADMIN_USER=admin
export KANBOARD_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
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
psql -f /tmp/kanboard-adminpwd.sql kanboard kanboard
unset PGPASSWORD
@ -60,6 +61,3 @@ cp ${SOURCE_DIR}/kanboard/etc/cron.d/kanboard /etc/cron.d/kanboard
# Add portal application definition
${SOURCE_DIR}/basic/portal-app-manager.py kanboard "/kanboard/" "${KANBOARD_ADMIN_USER}" "${KANBOARD_ADMIN_PWD}"
# TODO: Admin pwd set
# TODO: Portal card

View File

@ -2,4 +2,4 @@ UPDATE settings SET value = 'cs_CZ' WHERE option = 'application_language';
UPDATE settings SET value = 'Europe/Prague' WHERE option = 'application_timezone';
UPDATE settings SET value = 'd.m.Y' WHERE option = 'application_date_format';
-- UPDATE users SET password = '${KANBOARD_ADMIN_PWD}' WHERE username = 'admin';
UPDATE users SET password = '${KANBOARD_ADMIN_HASH}' WHERE username = 'admin';