diff --git a/README.md b/README.md index 23a69da..5146708 100644 --- a/README.md +++ b/README.md @@ -14,14 +14,14 @@ 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.14.0 ## Configuration ### 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 diff --git a/conf/armv7_stretch.src b/conf/armv7_stretch.src index e0218cf..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.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.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/conf/turnserver.conf b/conf/turnserver.conf index 70d8086..c3149da 100644 --- a/conf/turnserver.conf +++ b/conf/turnserver.conf @@ -11,18 +11,18 @@ 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 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/manifest.json b/manifest.json index 39eac76..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.12.4~ynh1", + "version": "1.14.0~ynh1", "url": "http://matrix.org", "license": "Apache-2.0", "maintainer": { 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/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..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 #================================================= @@ -406,16 +404,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")