#!/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: ,.*$" #================================================= # 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"