1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/kanboard_ynh.git synced 2024-09-03 19:36:17 +02:00
kanboard_ynh/scripts/install
Éric Gaspar 5bbd5b3703 cleaning
2024-08-31 21:47:23 +02:00

58 lines
1.7 KiB
Bash

#!/bin/bash
source _common.sh
source /usr/share/yunohost/helpers
ynh_app_setting_set --key=php_upload_max_filesize --value=100M
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression "Setting up source files..."
ynh_setup_source --dest_dir="$install_dir"
mkdir -p $install_dir/sessions/
chown -R $app $install_dir/{plugins,sessions}
chmod -R 700 $install_dir/sessions
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression "Configuring PHP-FPM..."
ynh_config_add_phpfpm
ynh_config_add_nginx
ynh_config_add --template="cron" --destination="/etc/cron.d/$app"
ynh_config_add_fail2ban --logpath="/var/log/nginx/${domain}-error.log" --failregex="^.*authentication failure\" while reading response header from upstream, client: <HOST>,.*$"
#=================================================
# SPECIFIC SETUP
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression "Adding $app's configuration..."
dir="__DIR__"
ynh_config_add --template="config.php" --destination="$install_dir/config.php"
#=================================================
# DATABASE INITIALIZATION
#=================================================
ynh_script_progression "Initializing database..."
ynh_mysql_db_shell < "$install_dir/app/Schema/Sql/mysql.sql"
pushd $install_dir
php$php_version cli db:migrate --no-interaction --verbose
popd
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression "Installation of $app completed"