From 1707778fa8024e3c68ade1c2dd56d50ec98af218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Tue, 19 May 2020 20:57:21 +0000 Subject: [PATCH 1/6] Upgrade synapse to 1.13.0 --- README.md | 2 +- conf/armv7_stretch.src | 4 ++-- manifest.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 23a69da..be61ad9 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Instant messaging server matrix network. Yunohost chatroom with matrix : [https://riot.im/app/#/room/#yunohost:matrix.org](https://riot.im/app/#/room/#yunohost:matrix.org) -**Shipped version:** 1.12.4 +**Shipped version:** 1.13.0 ## Configuration diff --git a/conf/armv7_stretch.src b/conf/armv7_stretch.src index e0218cf..4c3cdb8 100644 --- a/conf/armv7_stretch.src +++ b/conf/armv7_stretch.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/YunoHost-Apps/synapse_python_build/releases/download/v1.12.4/matrix-synapse_1.12.4-stretch-bin1_armv7l.tar.gz -SOURCE_SUM=2e36e8e280e9f72de575cc33e825a72d9229614ce2c7b91dc3e73fa455a8cf4d +SOURCE_URL=https://github.com/YunoHost-Apps/synapse_python_build/releases/download/v1.13.0/matrix-synapse_1.13.0-stretch-bin1_armv7l.tar.gz +SOURCE_SUM=56e599c3191af59deac4438d2dbdf465ea0f8ffb0b3f151178bd51d43d1d4055 # (Optional) Program to check the integrity (sha256sum, md5sum...) # default: sha256 SOURCE_SUM_PRG=sha256sum diff --git a/manifest.json b/manifest.json index 39eac76..5b1ff3b 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Instant messaging server which uses Matrix", "fr": "Un serveur de messagerie instantané basé sur Matrix" }, - "version": "1.12.4~ynh1", + "version": "1.13.0~ynh1", "url": "http://matrix.org", "license": "Apache-2.0", "maintainer": { From 4f4d7424366aaa8e1b73ec7edb7a2ab4f5147bde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Wed, 20 May 2020 22:08:14 +0200 Subject: [PATCH 2/6] Fix dh_file path on turnserver config --- conf/turnserver.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/turnserver.conf b/conf/turnserver.conf index 70d8086..bd9fbe9 100644 --- a/conf/turnserver.conf +++ b/conf/turnserver.conf @@ -11,7 +11,7 @@ cli-port=__CLI_PORT__ cert=/etc/yunohost/certs/__DOMAIN__/crt.pem pkey=/etc/yunohost/certs/__DOMAIN__/key.pem -dh-file=/etc/matrix-__APP__/__DOMAIN__.tls.dh +dh-file=/etc/ssl/private/dh2048.pem no-sslv2 no-sslv3 From ac78f19224d5cadc81561f92ca867d3fdee752b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Wed, 20 May 2020 23:41:04 +0200 Subject: [PATCH 3/6] Fix and improve coturn config --- conf/turnserver.conf | 6 +++--- scripts/install | 8 ++------ scripts/restore | 8 ++------ scripts/upgrade | 8 ++------ sources/Coturn_config_rotate.sh | 12 ++++-------- 5 files changed, 13 insertions(+), 29 deletions(-) diff --git a/conf/turnserver.conf b/conf/turnserver.conf index bd9fbe9..c3149da 100644 --- a/conf/turnserver.conf +++ b/conf/turnserver.conf @@ -16,13 +16,13 @@ dh-file=/etc/ssl/private/dh2048.pem no-sslv2 no-sslv3 no-tlsv1 +no-tlsv1_1 no-loopback-peers no-multicast-peers +no-cli + log-file=/var/log/matrix-__APP__/turnserver.log pidfile=/var/run/coturn-__APP__/turnserver.pid simple-log - -external-ip=__IPV4__,__IPV6__ - diff --git a/scripts/install b/scripts/install index eb98c2c..09edb6d 100644 --- a/scripts/install +++ b/scripts/install @@ -363,16 +363,12 @@ public_ip6="$(curl ipv6.yunohost.org)" || true if [ -n "$public_ip4" ] && ynh_validate_ip4 --ip_address="$public_ip4" then - ynh_replace_string --match_string='__IPV4__' --replace_string="$public_ip4" --target_file="$coturn_config_path" -else - ynh_replace_string --match_string='__IPV4__,' --replace_string="" --target_file="$coturn_config_path" + echo "external-ip=$public_ip4" >> "$coturn_config_path" fi if [ -n "$public_ip6" ] && ynh_validate_ip6 --ip_address="$public_ip6" then - ynh_replace_string --match_string='__IPV6__' --replace_string="$public_ip6" --target_file="$coturn_config_path" -else - ynh_replace_string --match_string=',__IPV6__' --replace_string="" --target_file="$coturn_config_path" + echo "external-ip=$public_ip6" >> "$coturn_config_path" fi ynh_store_file_checksum --file="$coturn_config_path" diff --git a/scripts/restore b/scripts/restore index d3d3cfb..cf0cb62 100644 --- a/scripts/restore +++ b/scripts/restore @@ -185,16 +185,12 @@ public_ip6="$(curl ipv6.yunohost.org)" || true if [ -n "$public_ip4" ] && ynh_validate_ip4 --ip_address="$public_ip4" then - ynh_replace_string --match_string='__IPV4__' --replace_string="$public_ip4" --target_file="$coturn_config_path" -else - ynh_replace_string --match_string='__IPV4__,' --replace_string="" --target_file="$coturn_config_path" + echo "external-ip=$public_ip4" >> "$coturn_config_path" fi if [ -n "$public_ip6" ] && ynh_validate_ip6 --ip_address="$public_ip6" then - ynh_replace_string --match_string='__IPV6__' --replace_string="$public_ip6" --target_file="$coturn_config_path" -else - ynh_replace_string --match_string=',__IPV6__' --replace_string="" --target_file="$coturn_config_path" + echo "external-ip=$public_ip6" >> "$coturn_config_path" fi ynh_store_file_checksum --file="$coturn_config_path" diff --git a/scripts/upgrade b/scripts/upgrade index 8239b74..f441395 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -406,16 +406,12 @@ public_ip6="$(curl ipv6.yunohost.org)" || true if [ -n "$public_ip4" ] && ynh_validate_ip4 --ip_address="$public_ip4" then - ynh_replace_string --match_string='__IPV4__' --replace_string="$public_ip4" --target_file="$coturn_config_path" -else - ynh_replace_string --match_string='__IPV4__,' --replace_string="" --target_file="$coturn_config_path" + echo "external-ip=$public_ip4" >> "$coturn_config_path" fi if [ -n "$public_ip6" ] && ynh_validate_ip6 --ip_address="$public_ip6" then - ynh_replace_string --match_string='__IPV6__' --replace_string="$public_ip6" --target_file="$coturn_config_path" -else - ynh_replace_string --match_string=',__IPV6__' --replace_string="" --target_file="$coturn_config_path" + echo "external-ip=$public_ip6" >> "$coturn_config_path" fi ynh_store_file_checksum --file="$coturn_config_path" diff --git a/sources/Coturn_config_rotate.sh b/sources/Coturn_config_rotate.sh index e1a99ac..7c2d704 100644 --- a/sources/Coturn_config_rotate.sh +++ b/sources/Coturn_config_rotate.sh @@ -9,18 +9,14 @@ external_IP_line="external-ip=__IPV4__,__IPV6__" public_ip4="$(curl ip.yunohost.org)" || true public_ip6="$(curl ipv6.yunohost.org)" || true -if [[ -n "$public_ip4" ]] && ynh_validate_ip 4 "$public_ip4" +if [ -n "$public_ip4" ] && ynh_validate_ip4 --ip_address="$public_ip4" then - external_IP_line="${external_IP_line/'__IPV4__'/$public_ip4}" -else - external_IP_line="${external_IP_line/'__IPV4__,'/}" + echo "external-ip=$public_ip4" >> "$coturn_config_path" fi -if [[ -n "$public_ip6" ]] && ynh_validate_ip 6 "$public_ip6" +if [ -n "$public_ip6" ] && ynh_validate_ip6 --ip_address="$public_ip6" then - external_IP_line="${external_IP_line/'__IPV6__'/$public_ip6}" -else - external_IP_line="${external_IP_line/',__IPV6__'/}" + echo "external-ip=$public_ip6" >> "$coturn_config_path" fi old_config_line=$(egrep "^external-ip=.*\$" "/etc/matrix-$app_instance/coturn.conf") From 92dc0a3466118f8adc9bfdf9ab9075d2d4c6d978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Thu, 28 May 2020 21:18:18 +0200 Subject: [PATCH 4/6] Fix documentation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index be61ad9..a824607 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Yunohost chatroom with matrix : [https://riot.im/app/#/room/#yunohost:matrix.org ### Install for ARM arch (or slow arch) For all slow or arm architecture it's recommended to build the dh file before the install to have a quicker install. -You could build it by this cmd : `mkdir -p /etc/matrix-synapse && openssl dhparam -out /etc/matrix-synapse/dh.pem 2048 > /dev/null` +You could build it by this cmd : `openssl dhparam -out /etc/ssl/private/dh2048.pem 2048 > /dev/null` After that you can install it without problem. The package uses a prebuilt python virtual environnement. The binary are taken from this repository: https://github.com/Josue-T/synapse_python_build From ab2273fe4e22575bbcbb3d6ce9c9cb8f5a125d53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Thu, 28 May 2020 21:32:09 +0000 Subject: [PATCH 5/6] Upgrade synapse to 1.14.0 --- README.md | 2 +- conf/armv7_stretch.src | 4 ++-- manifest.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a824607..5146708 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Instant messaging server matrix network. Yunohost chatroom with matrix : [https://riot.im/app/#/room/#yunohost:matrix.org](https://riot.im/app/#/room/#yunohost:matrix.org) -**Shipped version:** 1.13.0 +**Shipped version:** 1.14.0 ## Configuration diff --git a/conf/armv7_stretch.src b/conf/armv7_stretch.src index 4c3cdb8..d944b98 100644 --- a/conf/armv7_stretch.src +++ b/conf/armv7_stretch.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/YunoHost-Apps/synapse_python_build/releases/download/v1.13.0/matrix-synapse_1.13.0-stretch-bin1_armv7l.tar.gz -SOURCE_SUM=56e599c3191af59deac4438d2dbdf465ea0f8ffb0b3f151178bd51d43d1d4055 +SOURCE_URL=https://github.com/YunoHost-Apps/synapse_python_build/releases/download/v1.14.0/matrix-synapse_1.14.0-stretch-bin1_armv7l.tar.gz +SOURCE_SUM=baff395839d1b4aba2d9864e106cbb87417a7fe9afdf4dedfdde08e456a343cf # (Optional) Program to check the integrity (sha256sum, md5sum...) # default: sha256 SOURCE_SUM_PRG=sha256sum diff --git a/manifest.json b/manifest.json index 5b1ff3b..67cd6e5 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Instant messaging server which uses Matrix", "fr": "Un serveur de messagerie instantané basé sur Matrix" }, - "version": "1.13.0~ynh1", + "version": "1.14.0~ynh1", "url": "http://matrix.org", "license": "Apache-2.0", "maintainer": { From c2620569be6870ad4aef4a930de04a2912365307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Fri, 29 May 2020 22:39:15 +0200 Subject: [PATCH 6/6] Fix config panel --- scripts/config | 13 +++++++++++++ scripts/upgrade | 22 ++++++++++------------ 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/scripts/config b/scripts/config index 6a4f2c5..ca43f24 100644 --- a/scripts/config +++ b/scripts/config @@ -57,6 +57,19 @@ apply_config() { is_public=${YNH_CONFIG_SYNAPSE_CONFIG_SERVER_CONFIG_IS_PUBLIC:-$is_public} jitsi_server=${YNH_CONFIG_SYNAPSE_CONFIG_CLIENT_CONFIG_JITSI_SERVER:-$jitsi_server} + if [ $report_stats == 1 ]; then + report_stats=true + fi + if [ $report_stats == 0 ]; then + report_stats=false + fi + if [ $allow_public_rooms == 1 ]; then + allow_public_rooms=true + fi + if [ $allow_public_rooms == 0 ]; then + allow_public_rooms=false + fi + ynh_app_setting_set --app $app --key report_stats --value $report_stats ynh_app_setting_set --app $app --key allow_public_rooms --value $allow_public_rooms ynh_app_setting_set --app $app --key is_public --value $is_public diff --git a/scripts/upgrade b/scripts/upgrade index f441395..05860e2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -117,6 +117,16 @@ if [ -z $jitsi_server ]; then ynh_app_setting_set --app=$app --key=jitsi_server --value=$jitsi_server fi +if [ -z $report_stats ]; then + report_stats="false" + ynh_app_setting_set --app=$app --key=report_stats --value=$report_stats +fi + +if [ -z $allow_public_rooms ]; then + allow_public_rooms="false" + ynh_app_setting_set --app=$app --key=allow_public_rooms --value=$allow_public_rooms +fi + #================================================= # INSTALL DEPENDENCIES #================================================= @@ -220,18 +230,6 @@ then fi ynh_print_ON -#================================================= -# MIGRATION 5 : DEFINE UNDEFINED SETTINGS -#================================================= - -if [ -n $report_stats ]; then - report_stats="false" -fi - -if [ -n $allow_public_rooms ]; then - allow_public_rooms="false" -fi - #================================================= # UPDATE SYNAPSE CONFIG #=================================================