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

51 lines
1.8 KiB
Bash

#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
source ./experimental_helper.sh
source ./_common.sh
source /usr/share/yunohost/helpers
# We stop the service
ynh_systemctl --service="$app".service --action=stop
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression "Updating NGINX configuration..."
ynh_config_change_url_nginx
configure_nginx
#=================================================
# UPDATE SYNAPSE CONFIG
#=================================================
ynh_script_progression "Updating Synapse config..."
ynh_config_add --jinja --template="homeserver.yaml" --destination="/etc/matrix-$app/homeserver.yaml"
ynh_config_add --template="log.yaml" --destination="/etc/matrix-$app/log.yaml"
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
ynh_script_progression "Protecting directories..."
set_permissions
#=================================================
# RELOAD SERVICES
#=================================================
ynh_script_progression "Restarting Synapse services..."
ynh_systemctl --service="$app"-coturn.service --action=restart
ynh_systemctl --service="$app".service --action=restart --wait_until="Synapse now listening on TCP port $port_synapse_tls" --log_path="/var/log/matrix-$app/homeserver.log" --timeout=300
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
ynh_script_progression "Change of URL completed for $app"