Reorder KanBoard install script

This commit is contained in:
Disassembler 2019-12-09 22:28:11 +01:00
parent 9532bc7405
commit c2a30bc4c1
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499
2 changed files with 7 additions and 5 deletions

@ -1 +1 @@
Subproject commit ad1bfc8860b84148794f26c437a42b932087495f Subproject commit e867ee7e64183b9391a68aeea8d1f9b0023d27be

View File

@ -11,16 +11,18 @@ lxc-execute -n kanboard-postgres -- initdb -D /var/lib/postgresql
cp postgres_data/postgresql.conf /srv/kanboard/postgres_data/postgresql.conf cp postgres_data/postgresql.conf /srv/kanboard/postgres_data/postgresql.conf
cp postgres_data/pg_hba.conf /srv/kanboard/postgres_data/pg_hba.conf cp postgres_data/pg_hba.conf /srv/kanboard/postgres_data/pg_hba.conf
# Configure Kanboard
mkdir -p /srv/kanboard/kanboard_conf /srv/kanboard/kanboard_data
chown -R 108080:108080 /srv/kanboard/kanboard_data
envsubst <kanboard_conf/config.php >/srv/kanboard/kanboard_conf/config.php
# Populate database # Populate database
export KANBOARD_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=') export KANBOARD_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=')
service lxc-kanboard-postgres start service lxc-kanboard-postgres start
envsubst <createdb.sql | lxc-attach -u 5432 -g 5432 kanboard-postgres -- psql envsubst <createdb.sql | lxc-attach -u 5432 -g 5432 kanboard-postgres -- psql
lxc-execute kanboard -- cat /srv/kanboard/app/Schema/Sql/postgres.sql | lxc-attach -u 5432 -g 5432 kanboard-postgres -- sh -c "PGPASSWORD=${KANBOARD_PWD} psql kanboard kanboard" lxc-execute kanboard -- cat /srv/kanboard/app/Schema/Sql/postgres.sql | lxc-attach -u 5432 -g 5432 kanboard-postgres -- sh -c "PGPASSWORD=${KANBOARD_PWD} psql kanboard kanboard"
# Configure Kanboard # Create admin account
mkdir -p /srv/kanboard/kanboard_conf /srv/kanboard/kanboard_data
chown -R 108080:108080 /srv/kanboard/kanboard_data
envsubst <kanboard_conf/config.php >/srv/kanboard/kanboard_conf/config.php
export KANBOARD_ADMIN_USER=admin export KANBOARD_ADMIN_USER=admin
export KANBOARD_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=') export KANBOARD_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=')
export KANBOARD_ADMIN_HASH=$(python3 -c "import bcrypt; print(bcrypt.hashpw('${KANBOARD_ADMIN_PWD}'.encode(), bcrypt.gensalt()).decode().replace('2b', '2y'))") export KANBOARD_ADMIN_HASH=$(python3 -c "import bcrypt; print(bcrypt.hashpw('${KANBOARD_ADMIN_PWD}'.encode(), bcrypt.gensalt()).decode().replace('2b', '2y'))")