diff --git a/60-kanboard.sh b/60-kanboard.sh index f1785f1..60fc94b 100755 --- a/60-kanboard.sh +++ b/60-kanboard.sh @@ -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 diff --git a/kanboard/tmp/kanboard-adminpwd.sql b/kanboard/tmp/kanboard-adminpwd.sql index 330d395..c80afc5 100644 --- a/kanboard/tmp/kanboard-adminpwd.sql +++ b/kanboard/tmp/kanboard-adminpwd.sql @@ -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';