From 11aabdf5c9373346e16316ff3d528b99b95c9191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sat, 14 Dec 2019 15:14:27 +0100 Subject: [PATCH] Move well-known config in nginx section --- scripts/install | 19 +++++++++---------- scripts/upgrade | 19 +++++++++---------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/scripts/install b/scripts/install index 6550690..5fd48a2 100644 --- a/scripts/install +++ b/scripts/install @@ -246,6 +246,15 @@ ynh_script_progression --message="Configuring nginx web server..." --weight=2 ynh_add_nginx_config +# Create .well-known redirection for access by federation +if yunohost --output-as plain domain list | grep -q "^$server_name$" +then + cp ../conf/server_name.conf /etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf + ynh_replace_string --match_string=__DOMAIN__ --replace_string=$domain --target_file="/etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf" + ynh_replace_string --match_string=__PORT__ --replace_string=$synapse_tls_port --target_file="/etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf" + ynh_store_file_checksum --file="/etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf" +fi + #================================================= # SET SYNAPSE CONFIG #================================================= @@ -296,16 +305,6 @@ fi ynh_store_file_checksum --file="$homeserver_config_path" ynh_store_file_checksum --file="/etc/matrix-$app/log.yaml" - -# Create .well-known redirection for access by federation -if yunohost --output-as plain domain list | grep -q "^$server_name$" -then - cp ../conf/server_name.conf /etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf - ynh_replace_string --match_string=__DOMAIN__ --replace_string=$domain --target_file="/etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf" - ynh_replace_string --match_string=__PORT__ --replace_string=$synapse_tls_port --target_file="/etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf" - ynh_store_file_checksum --file="/etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf" -fi - #================================================= # SET COTURN CONFIG #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 0174af2..6a8c0f0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -251,16 +251,6 @@ fi ynh_store_file_checksum --file="$homeserver_config_path" ynh_store_file_checksum --file="/etc/matrix-$app/log.yaml" -# Create .well-known redirection for access by federation if it doesn't exist -if yunohost --output-as plain domain list | grep -q "^$server_name$" -then - ynh_backup_if_checksum_is_different --file=/etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf - cp ../conf/server_name.conf /etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf - ynh_replace_string --match_string=__DOMAIN__ --replace_string=$domain --target_file="/etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf" - ynh_replace_string --match_string=__PORT__ --replace_string=$synapse_tls_port --target_file="/etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf" - ynh_store_file_checksum --file="/etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf" -fi - #================================================= # MIGRATION 2 : MULTINSTANCE SUPPORT #================================================= @@ -336,6 +326,15 @@ ynh_script_progression --message="Upgrading nginx web server configuration..." - # Create a dedicated nginx config ynh_add_nginx_config +# Create .well-known redirection for access by federation +if yunohost --output-as plain domain list | grep -q "^$server_name$" +then + cp ../conf/server_name.conf /etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf + ynh_replace_string --match_string=__DOMAIN__ --replace_string=$domain --target_file="/etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf" + ynh_replace_string --match_string=__PORT__ --replace_string=$synapse_tls_port --target_file="/etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf" + ynh_store_file_checksum --file="/etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf" +fi + #================================================= # SPECIFIC UPGRADE #=================================================