From acab96f9fac38b2f02021f6c0c47670f1adc6717 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 28 Oct 2022 09:26:12 +0200 Subject: [PATCH 1/7] Update config_panel.toml --- config_panel.toml | 69 ++++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 4e3c698..d2da7f9 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -1,53 +1,54 @@ -version = "0.1" -name = "Synapse configuration panel" +version = "1.0" -[synapse_config] +[main] name = "Synapse configuration" - [synapse_config.server_config] - name = "Synapse server configuration" + [main.config] + name = "Configuration Options" - [synapse_config.server_config.server_statistics] - ask = "Server statistics" - type = "boolean" - default = false - help = "True to send anonymous statistics about synapse to improve the performances" + [main.config.server_statistics] + ask = "Server statistics" + type = "boolean" + yes = true + no = false + help = "Set to 'true' to send anonymous statistics to Synapse to improve performance." - [synapse_config.server_config.is_free_registration] - ask = "Server with free registration" - type = "boolean" - default = false - help = "A public server means that anybody will be able to register on this server." + [main.config.is_free_registration] + ask = "Free registration" + type = "boolean" + yes = true + no = false + help = "A public server means that anybody will be able to register on this server." - [synapse_config.server_config.allow_public_rooms] - ask = "Public rooms directory" - type = "boolean" - default = false - help = "If set to 'false', requires authentication to access the server's public rooms directory through the client API and forbids any other homeserver to fetch the server's public rooms directory via federation." + [main.config.allow_public_rooms] + ask = "Public rooms directory" + type = "boolean" + yes = true + no = false + help = "If set to 'false', requires authentication to access the server's public rooms directory through the client API and forbids any other homeserver to fetch the server's public rooms directory via federation." - [synapse_config.client_config] + [main.client_config] name = "Matrix client configuration" - [synapse_config.client_config.jitsi_server] - ask = "Jitsi server address for conference" + [main.client_config.jitsi_server] + ask = "Jitsi server address" type = "string" default = 'jitsi.riot.im' - help = "Address of the Jitsi server for conference. Note that it's only for conference in rooms with more than 2 person. With 2 person the stun/turn server is used." + help = "Jitsi server address for the conference. Note that this is only for conferences in rooms with more than 2 people. With 2 people, the stun/turn server is used." - [synapse_config.client_config.e2e_enabled_by_default] + [main.client_config.e2e_enabled_by_default] ask = "End to end encryption by default for direct messages" type = "boolean" - default = true + yes = true + no = false help = "By default, Element will create encrypted DM rooms if the user you are chatting with has keys uploaded on their account. For private room creation, Element will default to encryption on but give you can disable this settings here." -[package_config] -name = "Package configuration" + [main.package_config] + name = "Package configuration" - [package_config.package_config] - name = "Upgrade" - - [package_config.package_config.backup_before_upgrade] + [main.package_config.backup_before_upgrade] ask = "Backup before upgrade" type = "boolean" - default = true - help = "True to do a backup before every upgrade" + yes = true + no = false + help = "Set to 'true' to back up before each upgrade." From eecdb6d35641d71ac8fcd45f96f35818aa85b0ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 28 Oct 2022 10:50:43 +0200 Subject: [PATCH 2/7] Silent warnings --- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 157f452..d31d760 100644 --- a/scripts/install +++ b/scripts/install @@ -138,7 +138,7 @@ ynh_script_progression --message="Installing dependencies..." --weight=80 # WARNING : theses command are used in INSTALL, UPGRADE, RESTORE # For any update do it in all files -ynh_install_app_dependencies $dependances +ynh_exec_warn_less ynh_install_app_dependencies $dependances #================================================= # CREATE DEDICATED USER diff --git a/scripts/restore b/scripts/restore index 347c02e..481c0bf 100644 --- a/scripts/restore +++ b/scripts/restore @@ -71,7 +71,7 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=70 # WARNING : theses command are used in INSTALL, UPGRADE, RESTORE # For any update do it in all files -ynh_install_app_dependencies $dependances +ynh_exec_warn_less ynh_install_app_dependencies $dependances #================================================= # RECREATE THE DEDICATED USER diff --git a/scripts/upgrade b/scripts/upgrade index 19d4504..ac2f4d6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -169,7 +169,7 @@ ynh_script_progression --message="Upgrading dependencies..." --weight=6 # WARNING : theses command are used in INSTALL, UPGRADE, RESTORE # For any update do it in all files -ynh_install_app_dependencies $dependances +ynh_exec_warn_less ynh_install_app_dependencies $dependances #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE From 0d549186e0857d196d0eba0cc7b9daef454507b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 28 Oct 2022 10:51:50 +0200 Subject: [PATCH 3/7] Update manifest.json --- manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index c197acd..ade9520 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,7 @@ "packaging_format": 1, "description": { "en": "Instant messaging server which uses Matrix", - "fr": "Un serveur de messagerie instantané basé sur Matrix" + "fr": "Serveur de messagerie instantané basé sur Matrix" }, "version": "1.70.0~ynh1", "url": "http://matrix.org", @@ -45,7 +45,7 @@ "name": "is_free_registration", "type": "boolean", "ask": { - "en": "Is it a server with free registration ?", + "en": "Is it a server with free registration?", "fr": "Est-ce un serveur avec création de compte libre ?" }, "default": false, From 319b0119b275f0ce5797f7bbfdb035686a00ee75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 28 Oct 2022 10:52:49 +0200 Subject: [PATCH 4/7] Update check_process --- check_process | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/check_process b/check_process index 77174f9..9c28469 100644 --- a/check_process +++ b/check_process @@ -1,9 +1,9 @@ ;; General ; Manifest - domain="domain.tld" (DOMAIN) - path="/_matrix/static/" (PATH) - is_free_registration=1 (PUBLIC|public=1|private=0) - server_name="domain.tld" (DOMAIN) + domain="domain.tld" + path="/_matrix/static/" + is_free_registration=1 + server_name="domain.tld" ; Checks pkg_linter=1 setup_sub_dir=1 From 011fc2a6c1254bcf7af122f9d0c01659317d691d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 28 Oct 2022 10:59:40 +0200 Subject: [PATCH 5/7] Fix typos and follow example_ynh template --- scripts/backup | 14 +++++--------- scripts/change_url | 6 +++--- scripts/install | 12 ++++++------ scripts/remove | 4 ++-- scripts/restore | 8 ++++---- scripts/upgrade | 10 +++++----- 6 files changed, 25 insertions(+), 29 deletions(-) diff --git a/scripts/backup b/scripts/backup index ae7c557..775dbab 100644 --- a/scripts/backup +++ b/scripts/backup @@ -45,12 +45,16 @@ upstream_version=$(ynh_app_upstream_version) final_www_path="/var/www/$app" data_path="/home/yunohost.app/matrix-$app" +#================================================= +# DECLARE DATA AND CONF FILES TO BACKUP +#================================================= +ynh_print_info --message="Declaring files to be backed up..." + #================================================= # STANDARD BACKUP STEPS #================================================= # BACKUP THE APP MAIN DIR #================================================= -ynh_print_info --message="Backing up the main app directory..." ynh_backup --src_path="$final_path" ynh_backup --src_path="$final_www_path" @@ -58,7 +62,6 @@ ynh_backup --src_path="$final_www_path" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= -ynh_print_info --message="Backing up nginx web server configuration..." # BACKUP THE PHP-FPM CONFIGURATION ynh_backup --src_path "/etc/php/$phpversion/fpm/pool.d/$app.conf" @@ -72,14 +75,12 @@ fi #================================================= # BACKUP THE POSTGRESQL DATABASE #================================================= -ynh_print_info --message="Backing up the PostgreSQL database..." ynh_psql_dump_db --database="$synapse_db_name" > ${YNH_CWD}/dump.sql #================================================= # BACKUP FAIL2BAN CONFIGURATION #================================================= -ynh_print_info --message="Backing up fail2ban configuration" ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf" ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" @@ -89,14 +90,12 @@ ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" #================================================= # BACKUP SYNAPSE CONFIG #================================================= -ynh_print_info --message="Backing up synapse configuration..." ynh_backup --src_path="/etc/matrix-$app" #================================================= # BACKUP SYSTEMD #================================================= -ynh_print_info --message="Backing up systemd configuration..." ynh_backup --src_path="/etc/default/matrix-$app" ynh_backup --src_path="/etc/systemd/system/matrix-$app.service" @@ -106,21 +105,18 @@ ynh_backup --src_path="/etc/systemd/system/coturn-$app.service" #================================================= # BACKUP SYNAPSE DATA #================================================= -ynh_print_info --message="Backing up synapse data..." ynh_backup --src_path="$data_path" --is_big=1 #================================================= # BACKUP SYNAPSE LOG #================================================= -ynh_print_info --message="Backing up synapse log..." ynh_backup --src_path="/var/log/matrix-$app" --is_big=1 #================================================= # BACKUP HOOKS #================================================= -ynh_print_info --message="Backing up synapse hook..." # Copy hook ynh_backup --src_path "/etc/yunohost/hooks.d/post_cert_update/50-$app" diff --git a/scripts/change_url b/scripts/change_url index ad84c40..8759e1e 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -67,7 +67,7 @@ ynh_systemd_action --service_name=matrix-$app.service --action=stop # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Updating nginx configuration..." +ynh_script_progression --message="Updating NGINX configuration..." # MODIFY URL IN NGINX CONF nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf @@ -89,7 +89,7 @@ fi # UPDATE SYNAPSE CONFIG #================================================= -ynh_script_progression --message="Updating synapse config..." --weight=2 +ynh_script_progression --message="Updating Synapse config..." --weight=2 # WARNING : theses command are used in INSTALL, UPGRADE, CONFIG, CHANGE-URL (4 times) # For any update do it in all files @@ -127,7 +127,7 @@ chmod u=rwX,g=rX,o= -R /etc/matrix-$app #================================================= # RELOAD SERVICES #================================================= -ynh_script_progression --message="Restarting synapse services..." --weight=5 +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 $synapse_tls_port" --log_path="/var/log/matrix-$app/homeserver.log" --timeout=300 diff --git a/scripts/install b/scripts/install index d31d760..f620003 100644 --- a/scripts/install +++ b/scripts/install @@ -197,7 +197,7 @@ chown $synapse_user:root -R $final_www_path # CREATE SYNAPSE CONFIG #================================================= -ynh_script_progression --message="Creating synapse config..." --weight=3 +ynh_script_progression --message="Creating Synapse config..." --weight=3 # Go in virtualenvironnement set +u; @@ -237,7 +237,7 @@ ynh_add_systemd_config --service=coturn-$app --template=coturn-synapse.service #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." --weight=2 +ynh_script_progression --message="Configuring NGINX web server..." --weight=2 # Create a dedicated php-fpm config ynh_script_progression --message="Configuring application..." @@ -255,7 +255,7 @@ ynh_add_nginx_config app #================================================= # SET SYNAPSE CONFIG #================================================= -ynh_script_progression --message="Configuring synapse..." --weight=2 +ynh_script_progression --message="Configuring Synapse..." --weight=2 # Find password for turnserver and database turnserver_pwd=$(ynh_string_random --length=30) @@ -283,7 +283,7 @@ ynh_add_config --template="log.yaml" --destination="/etc/matrix-$app/log.yaml" #================================================= # SET COTURN CONFIG #================================================= -ynh_script_progression --message="Configuring coturn..." --weight=1 +ynh_script_progression --message="Configuring Coturn..." --weight=1 # WARNING : theses command are used in INSTALL, UPGRADE # For any update do it in all files @@ -381,7 +381,7 @@ yunohost service add coturn-$app --needs_exposed_ports $turnserver_tls_port #================================================= # RELOAD SERVICES #================================================= -ynh_script_progression --message="Restarting synapse services..." --weight=11 +ynh_script_progression --message="Restarting Synapse services..." --weight=11 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 $synapse_tls_port" --log_path="/var/log/matrix-$app/homeserver.log" --timeout=300 @@ -389,7 +389,7 @@ ynh_systemd_action --service_name=matrix-$app --action=restart --line_match="Syn #================================================= # SETUP FAIL2BAN #================================================= -ynh_script_progression --message="Configuring fail2ban..." --weight=10 +ynh_script_progression --message="Configuring Fail2Ban..." --weight=10 # WARNING : theses command are used in INSTALL, UPGRADE # For any update do it in all files diff --git a/scripts/remove b/scripts/remove index 7452c0c..fa86c1a 100755 --- a/scripts/remove +++ b/scripts/remove @@ -93,7 +93,7 @@ ynh_secure_remove --file=/etc/nginx/conf.d/${server_name}.d/${app}_server_name.c #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing nginx web server configuration" --weight=2 +ynh_script_progression --message="Removing NGINX web server configuration" --weight=2 # Remove the dedicated nginx config ynh_remove_nginx_config @@ -129,7 +129,7 @@ closeport $turnserver_alt_tls_port #================================================= # REMOVE FAIL2BAN CONFIGURATION #================================================= -ynh_script_progression --message="Removing fail2ban configuration..." --weight=8 +ynh_script_progression --message="Removing Fail2Ban configuration..." --weight=8 # Remove the dedicated fail2ban config ynh_remove_fail2ban_config diff --git a/scripts/restore b/scripts/restore index 481c0bf..a393098 100644 --- a/scripts/restore +++ b/scripts/restore @@ -101,7 +101,7 @@ install_sources # RESTORE FAIL2BAN CONFIGURATION #================================================= -ynh_script_progression --message="Reload fail2ban..." --weight=6 +ynh_script_progression --message="Reload Fail2Ban..." --weight=6 ynh_systemd_action --action=restart --service_name=fail2ban #================================================= @@ -155,7 +155,7 @@ fi #================================================= # RECONFIGURE THE TURNSERVER #================================================= -ynh_script_progression --message="Reconfiguring coturn..." --weight=23 +ynh_script_progression --message="Reconfiguring Coturn..." --weight=23 # To be sure that at the restoration the IP address in coturn config is the same as the real address we remake the coturn config @@ -227,7 +227,7 @@ chown $synapse_user:root -R $final_www_path #================================================= # RELOAD NGINX, SYNAPSE AND COTURN #================================================= -ynh_script_progression --message="Restarting synapse services..." --weight=7 +ynh_script_progression --message="Restarting Synapse services..." --weight=7 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 $synapse_tls_port" --log_path="/var/log/matrix-$app/homeserver.log" --timeout=300 @@ -256,7 +256,7 @@ ynh_send_readme_to_admin --app_message="mail_to_send" --type="restore" #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=php$phpversion-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index ac2f4d6..e108011 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -318,7 +318,7 @@ fi #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=2 +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 # Create a dedicated php-fpm config ynh_script_progression --message="Configuring application..." @@ -330,7 +330,7 @@ then ynh_add_config --template="server_name.conf" --destination="/etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf" fi -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config app #================================================= @@ -338,7 +338,7 @@ ynh_add_nginx_config app #================================================= # UPDATE COTURN CONFIG #================================================= -ynh_script_progression --message="Updating coturn config..." --weight=1 +ynh_script_progression --message="Updating Coturn config..." --weight=1 # WARNING : theses command are used in INSTALL, UPGRADE # For any update do it in all files @@ -397,7 +397,7 @@ ynh_add_systemd_config --service=coturn-$app --template=coturn-synapse.service #================================================= # UPGRADE FAIL2BAN #================================================= -ynh_script_progression --message="Reconfiguring fail2ban..." --weight=8 +ynh_script_progression --message="Reconfiguring Fail2Ban..." --weight=8 # WARNING : theses command are used in INSTALL, UPGRADE # For any update do it in all files @@ -480,7 +480,7 @@ ynh_app_setting_set --app=$app --key=synapse_version --value=$upstream_version #================================================= # RELOAD SERVICES #================================================= -ynh_script_progression --message="Restarting synapse services..." --weight=5 +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 $synapse_tls_port" --log_path="/var/log/matrix-$app/homeserver.log" --timeout=300 From 00a4f094b68c56dcdb42d419065220ac58ea4cc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 28 Oct 2022 11:02:01 +0200 Subject: [PATCH 6/7] Cleaning --- conf/armv7_bullseye.src | 6 ------ conf/armv7_buster.src | 6 ------ conf/coturn-synapse.service | 2 +- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/conf/armv7_bullseye.src b/conf/armv7_bullseye.src index 649bb7f..6ed0526 100644 --- a/conf/armv7_bullseye.src +++ b/conf/armv7_bullseye.src @@ -1,11 +1,5 @@ SOURCE_URL=https://github.com/YunoHost-Apps/synapse_python_build/releases/download/v1.70.0/matrix-synapse_1.70.0-bullseye-bin1_armv7l.tar.gz SOURCE_SUM=be2c835e85aae7daa32ee0bc04b275e5ecdb14082e1c4d6f20494d02cf60406b -# (Optional) Program to check the integrity (sha256sum, md5sum...) -# default: sha256 SOURCE_SUM_PRG=sha256sum -# (Optional) Archive format -# default: tar.gz SOURCE_FORMAT=tar.gz -# (Optional) Put false if sources are directly in the archive root -# default: true SOURCE_IN_SUBDIR=true diff --git a/conf/armv7_buster.src b/conf/armv7_buster.src index 6a90e4b..eae3559 100644 --- a/conf/armv7_buster.src +++ b/conf/armv7_buster.src @@ -1,11 +1,5 @@ SOURCE_URL=https://github.com/YunoHost-Apps/synapse_python_build/releases/download/v1.70.0/matrix-synapse_1.70.0-buster-bin1_armv7l.tar.gz SOURCE_SUM=75e81a7098721230bdde707dcdd78f64c4d314580466eca735dc9d8a3f8bbc21 -# (Optional) Program to check the integrity (sha256sum, md5sum...) -# default: sha256 SOURCE_SUM_PRG=sha256sum -# (Optional) Archive format -# default: tar.gz SOURCE_FORMAT=tar.gz -# (Optional) Put false if sources are directly in the archive root -# default: true SOURCE_IN_SUBDIR=true diff --git a/conf/coturn-synapse.service b/conf/coturn-synapse.service index c4a13d3..f07a6bf 100644 --- a/conf/coturn-synapse.service +++ b/conf/coturn-synapse.service @@ -1,5 +1,5 @@ [Unit] -Description=coturn +Description=Coturn Documentation=man:coturn(1) man:turnadmin(1) man:turnserver(1) After=syslog.target network.target From 37b4f124e8c2a33c7eedb94d4b934986e058a796 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 10 Nov 2022 07:01:56 +0000 Subject: [PATCH 7/7] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ed76431..a4c2bb2 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Instant messaging server matrix network. Yunohost chatroom with matrix : [https://matrix.to/#/#yunohost:matrix.org](https://matrix.to/#/#yunohost:matrix.org) -**Shipped version:** 1.70.1~ynh1 +**Shipped version:** 1.71.0~ynh1 ## Disclaimers / important information ## Configuration diff --git a/README_fr.md b/README_fr.md index 2fc375d..4a09268 100644 --- a/README_fr.md +++ b/README_fr.md @@ -20,7 +20,7 @@ Instant messaging server matrix network. Yunohost chatroom with matrix : [https://matrix.to/#/#yunohost:matrix.org](https://matrix.to/#/#yunohost:matrix.org) -**Version incluse :** 1.70.1~ynh1 +**Version incluse :** 1.71.0~ynh1 ## Avertissements / informations importantes ## Configuration