diff --git a/scripts/install b/scripts/install index d27de19..d8f0461 100644 --- a/scripts/install +++ b/scripts/install @@ -36,7 +36,7 @@ ynh_setup_source --dest_dir="$install_dir" mkdir -p $install_dir/sessions/ -chown -R $app $install_dir/{data,plugins,sessions} +chown -R $app $install_dir/{plugins,sessions} chmod -R 700 $install_dir/sessions chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -59,7 +59,6 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -dir="__DIR__" ynh_add_config --template="../conf/config.php" --destination="$install_dir/config.php" chmod 400 "$install_dir/config.php" diff --git a/scripts/upgrade b/scripts/upgrade index d206d28..eb2a5bd 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -49,7 +49,7 @@ then ynh_script_progression --message="Upgrading source files..." --weight=3 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --keep="data/ config.php" + ynh_setup_source --dest_dir="$install_dir" --keep="config.php" fi mkdir -p $install_dir/sessions/ @@ -70,6 +70,23 @@ ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint # Create a dedicated NGINX config ynh_add_nginx_config +# Create a dedicated Fail2Ban config +ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="^.*authentication failure\" while reading response header from upstream, client: ,.*$" --max_retry=5 + +ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" +chown root: "/etc/cron.d/$app" +chmod 644 "/etc/cron.d/$app" + +#================================================= +# ADD A CONFIGURATION +#================================================= +ynh_script_progression --message="Adding a configuration file..." --weight=1 + +ynh_add_config --template="../conf/config.php" --destination="$install_dir/config.php" + +chmod 400 "$install_dir/config.php" +chown $app "$install_dir/config.php" + #================================================= # SPECIFIC UPGRADE #================================================= @@ -84,25 +101,6 @@ pushd $install_dir php$phpversion cli plugin:upgrade --no-interaction --verbose popd -#================================================= -# SETUP CRON -#================================================= -ynh_script_progression --message="Setuping a cron..." --weight=2 - -ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" -chown root: "/etc/cron.d/$app" -chmod 644 "/etc/cron.d/$app" - -#================================================= -# GENERIC FINALIZATION -#================================================= -# UPGRADE FAIL2BAN -#================================================= -ynh_script_progression --message="Reconfiguring Fail2Ban..." --weight=7 - -# Create a dedicated Fail2Ban config -ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="^.*authentication failure\" while reading response header from upstream, client: ,.*$" --max_retry=5 - #================================================= # END OF SCRIPT #=================================================