2017-10-13 09:33:26 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-12-04 17:48:37 +01:00
|
|
|
SOURCE_DIR=$(realpath $(dirname "${0}"))/kanboard
|
2017-10-13 09:33:26 +02:00
|
|
|
|
|
|
|
# Install dependencies for Kanboard
|
|
|
|
apt-get -y --no-install-recommends install php7.0-gd php7.0-fpm php7.0-mbstring php7.0-pgsql php7.0-zip
|
|
|
|
|
|
|
|
# Install Kanboard
|
|
|
|
wget https://github.com/kanboard/kanboard/releases/download/v1.0.47/kanboard-1.0.47.zip -O /srv/kanboard.zip
|
|
|
|
unzip /srv/kanboard.zip -d /srv
|
|
|
|
rm -f /srv/kanboard.zip
|
|
|
|
|
2017-10-14 10:30:47 +02:00
|
|
|
# Install plugins
|
|
|
|
git clone --depth=1 https://github.com/BlueTeck/kanboard_plugin_overwrite_translation /srv/kanboard/plugins/Overwrite_translation
|
|
|
|
git clone --depth=1 https://github.com/BlueTeck/kanboard_plugin_coverimage /srv/kanboard/plugins/Coverimage
|
|
|
|
git clone --depth=1 https://github.com/BlueTeck/kanboard_plugin_metadata /srv/kanboard/plugins/Metadata
|
|
|
|
git clone --depth=1 https://github.com/eSkiSo/Subtaskdate /srv/kanboard/plugins/Subtaskdate
|
|
|
|
git clone --depth=1 https://github.com/kanboard/plugin-budget /srv/kanboard/plugins/Budget
|
|
|
|
git clone --depth=1 https://github.com/kanboard/plugin-calendar /srv/kanboard/plugins/Calendar
|
|
|
|
git clone --depth=1 https://github.com/kanboard/plugin-chat /srv/kanboard/plugins/Chat
|
|
|
|
git clone --depth=1 https://github.com/kanboard/plugin-gantt /srv/kanboard/plugins/Gantt
|
|
|
|
git clone --depth=1 https://github.com/kanboard/plugin-gravatar /srv/kanboard/plugins/Gravatar
|
|
|
|
git clone --depth=1 https://github.com/kanboard/plugin-registration /srv/kanboard/plugins/Registration
|
|
|
|
git clone --depth=1 https://github.com/kanboard/plugin-sms-2fa /srv/kanboard/plugins/SmsTwoFactor
|
|
|
|
git clone --depth=1 https://github.com/kanboard/plugin-task-board-date /srv/kanboard/plugins/TaskBoardDate
|
|
|
|
git clone --depth=1 https://github.com/oliviermaridat/kanboard-milestone-plugin /srv/kanboard/plugins/Milestone
|
|
|
|
git clone --depth=1 https://github.com/xavividal/kanboard-plugin-relationgraph /srv/kanboard/plugins/Relationgraph
|
|
|
|
|
2017-10-13 09:33:26 +02:00
|
|
|
# Populate database
|
|
|
|
export KANBOARD_PWD=$(head -c 18 /dev/urandom | base64)
|
2017-12-04 17:48:37 +01:00
|
|
|
envsubst <${SOURCE_DIR}/tmp/kanboard-createdb.sql >/tmp/kanboard-createdb.sql
|
2017-10-13 09:33:26 +02:00
|
|
|
sudo -u postgres psql -f /tmp/kanboard-createdb.sql
|
|
|
|
rm -f /tmp/kanboard-createdb.sql
|
|
|
|
export PGPASSWORD=${KANBOARD_PWD}
|
|
|
|
psql -f /srv/kanboard/app/Schema/Sql/postgres.sql kanboard kanboard
|
2017-11-29 21:10:23 +01:00
|
|
|
unset PGPASSWORD
|
2017-10-13 09:33:26 +02:00
|
|
|
|
|
|
|
# Configure Kanboard
|
2017-12-04 17:48:37 +01:00
|
|
|
envsubst <${SOURCE_DIR}/srv/kanboard/config.php >/srv/kanboard/config.php
|
2017-10-13 09:33:26 +02:00
|
|
|
export KANBOARD_ADMIN_USER=admin
|
|
|
|
export KANBOARD_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
|
2017-10-14 12:50:36 +02:00
|
|
|
export KANBOARD_ADMIN_HASH=$(php -r "echo password_hash('${KANBOARD_ADMIN_PWD}', PASSWORD_BCRYPT);")
|
2017-12-04 17:48:37 +01:00
|
|
|
envsubst <${SOURCE_DIR}/tmp/kanboard-adminpwd.sql >/tmp/kanboard-adminpwd.sql
|
2017-11-29 21:10:23 +01:00
|
|
|
sudo -u postgres psql -f /tmp/kanboard-adminpwd.sql kanboard
|
2017-10-13 09:33:26 +02:00
|
|
|
|
|
|
|
# Create OS user
|
|
|
|
adduser --system --group --home /srv/kanboard --shell /bin/false kanboard
|
|
|
|
chown -R kanboard:www-data /srv/kanboard/
|
|
|
|
|
|
|
|
# Create PHP and nginx app definition
|
2017-12-04 17:48:37 +01:00
|
|
|
cp ${SOURCE_DIR}/etc/php/7.0/fpm/pool.d/kanboard.conf /etc/php/7.0/fpm/pool.d/kanboard.conf
|
|
|
|
cp ${SOURCE_DIR}/etc/nginx/apps-available/kanboard /etc/nginx/apps-available/kanboard
|
2017-10-13 09:33:26 +02:00
|
|
|
ln -s /etc/nginx/apps-available/kanboard /etc/nginx/apps-enabled/kanboard
|
|
|
|
|
|
|
|
# Restart services
|
|
|
|
systemctl restart php7.0-fpm
|
|
|
|
systemctl restart nginx
|
|
|
|
|
|
|
|
# Install cron job
|
2017-12-04 17:48:37 +01:00
|
|
|
cp ${SOURCE_DIR}/etc/cron.d/kanboard /etc/cron.d/kanboard
|
2017-10-13 09:33:26 +02:00
|
|
|
|
|
|
|
# Add portal application definition
|
2017-12-04 17:38:48 +01:00
|
|
|
portal-app-manager kanboard "/kanboard/" "${KANBOARD_ADMIN_USER}" "${KANBOARD_ADMIN_PWD}"
|
|
|
|
portal-app-manager kanboard-mobile
|