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
Josué Tille b435f316a2
Full rework of all scripts
- Adapt all script with packaging v2
- Rework cleanly control pannel and remove all replace in file as it's breaken after each update
- Cleanup
2023-11-01 18:52:07 +01:00

58 lines
1.8 KiB
Bash

#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
source ./experimental_helper.sh
source ./_common.sh
source /usr/share/yunohost/helpers
path=$new_path
domain=$new_domain
# Check if the new path stay /_matrix if not exit
if [[ $path != "/_matrix" ]]
then
ynh_die --message "You can't use an other path than '/_matrix'. You can only change the domain."
fi
# We stop the service
ynh_systemd_action --service_name=matrix-$app.service --action=stop
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Updating NGINX configuration..."
ynh_change_url_nginx_config
configure_nginx
#=================================================
# UPDATE SYNAPSE CONFIG
#=================================================
ynh_script_progression --message="Updating Synapse config..." --weight=2
configure_synapse
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
ynh_script_progression --message="Protecting directories..." --weight=3
set_permissions
#=================================================
# RELOAD SERVICES
#=================================================
ynh_script_progression --message="Restarting Synapse services..." --weight=5
ynh_systemd_action --service_name=coturn-$app.service --action=restart
ynh_systemd_action --service_name=matrix-$app --action=restart --line_match="Synapse now listening on TCP port $port_synapse_tls" --log_path="/var/log/matrix-$app/homeserver.log" --timeout=300
ynh_script_progression --message="Change of URL completed for $app" --last