1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/synapse_ynh.git synced 2024-09-03 20:26:38 +02:00
synapse_ynh/scripts/change_url

54 lines
1.8 KiB
Text
Raw Normal View History

2019-12-14 15:15:25 +01:00
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
source ./experimental_helper.sh
source ./_common.sh
source /usr/share/yunohost/helpers
2019-12-14 15:15:25 +01:00
# We stop the service
ynh_systemd_action --service_name=$app.service --action=stop
2019-12-14 15:15:25 +01:00
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Updating NGINX configuration..."
2019-12-14 15:15:25 +01:00
2023-10-31 22:19:40 +01:00
ynh_change_url_nginx_config
configure_nginx
2019-12-14 15:15:25 +01:00
#=================================================
# UPDATE SYNAPSE CONFIG
#=================================================
ynh_script_progression --message="Updating Synapse config..." --weight=2
2019-12-14 15:15:25 +01:00
configure_synapse
2019-12-14 15:15:25 +01:00
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
ynh_script_progression --message="Protecting directories..." --weight=3
set_permissions
2019-12-14 15:15:25 +01:00
#=================================================
# RELOAD SERVICES
#=================================================
ynh_script_progression --message="Restarting Synapse services..." --weight=5
2019-12-14 15:15:25 +01:00
ynh_systemd_action --service_name=$app-coturn.service --action=restart
ynh_systemd_action --service_name=$app.service --action=restart --line_match="Synapse now listening on TCP port $port_synapse_tls" --log_path="/var/log/matrix-$app/homeserver.log" --timeout=300
2019-12-14 15:15:25 +01:00
if ! yunohost --output-as plain domain list | grep -q "^$server_name"'$'; then
ynh_print_warn "Note yunohost won't be able to manage the required config for $server_name. So please add the needed DNS config as described on the documentation"
fi
2019-12-14 15:15:25 +01:00
ynh_script_progression --message="Change of URL completed for $app" --last