#!/bin/bash source _common.sh source /usr/share/yunohost/helpers #================================================= # MODIFY URL IN NGINX CONF #================================================= ynh_script_progression "Updating NGINX web server configuration..." ynh_config_change_url_nginx #================================================= # SPECIFIC MODIFICATIONS #================================================= # SETUP FAIL2BAN #================================================= ynh_script_progression "Configuring Fail2Ban..." # Remove the config file with $old_domain ynh_config_remove_fail2ban # Add config file with $new_domain ynh_config_add_fail2ban --logpath="/var/log/nginx/${new_domain}-error.log" --failregex="^.*authentication failure\" while reading response header from upstream, client: ,.*$" #================================================= # UPDATE A CONFIG FILE #================================================= ynh_script_progression "Updating configuration..." if [ $change_domain -eq 1 ] then # Change domain in Kanboard configuration ynh_replace --match="'${old_domain}'" --replace="'${new_domain}'" --file="${install_dir}/config.php" fi #================================================= # END OF SCRIPT #================================================= ynh_script_progression "Change of URL completed for $app"