mirror of
https://github.com/YunoHost-Apps/snserver_ynh.git
synced 2024-09-03 20:26:22 +02:00
44 lines
1.5 KiB
Bash
44 lines
1.5 KiB
Bash
#!/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
|
|
|
|
ynh_change_url_nginx_config
|
|
|
|
#=================================================
|
|
# SPECIFIC MODIFICATIONS
|
|
#=================================================
|
|
# MODIFY CONFIG
|
|
#=================================================
|
|
ynh_script_progression --message="Modify configuring..." --weight=1
|
|
|
|
ynh_replace_string --match_string="^FILES_SERVER_URL.*$" --replace_string="FILES_SERVER_URL=https://$new_domain$new_path/files" --target_file="$config_api_gateway"
|
|
ynh_store_file_checksum --file="$config_api_gateway"
|
|
|
|
#=================================================
|
|
# SETUP FAIL2BAN
|
|
#=================================================
|
|
ynh_script_progression --message="Configuring Fail2Ban..." --weight=1
|
|
|
|
# Create a dedicated Fail2Ban config
|
|
ynh_add_fail2ban_config --use_template
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|