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/change_url

50 lines
1.7 KiB
Text
Raw Permalink Normal View History

2019-05-06 19:31:34 +02:00
#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2
2019-05-06 19:31:34 +02:00
2023-03-06 13:24:53 +01:00
ynh_change_url_nginx_config
2022-10-19 00:46:33 +02:00
#=================================================
# SPECIFIC MODIFICATIONS
#=================================================
# SETUP FAIL2BAN
#=================================================
ynh_script_progression --message="Configuring Fail2Ban..." --weight=10
# Remove the config file with $old_domain
ynh_remove_fail2ban_config
# Add config file with $new_domain
2023-03-06 13:29:34 +01:00
ynh_add_fail2ban_config --logpath="/var/log/nginx/${new_domain}-error.log" --failregex="^.*authentication failure\" while reading response header from upstream, client: <HOST>,.*$" --max_retry=5
#=================================================
2022-10-19 00:46:33 +02:00
# UPDATE A CONFIG FILE
#=================================================
2022-10-19 00:46:33 +02:00
ynh_script_progression --message="Updating a configuration file..." --weight=2
if [ $change_domain -eq 1 ]
then
# Change domain in Kanboard configuration
2023-03-06 13:24:53 +01:00
ynh_replace_string --match_string="'${old_domain}'" --replace_string="'${new_domain}'" --target_file="${install_dir}/config.php"
fi
2019-05-06 19:31:34 +02:00
#=================================================
# END OF SCRIPT
#=================================================
2022-05-27 23:17:20 +02:00
ynh_script_progression --message="Change of URL completed for $app" --last