From 9d8c970d1c60d8ef24fd931f97b0f0c4f7a3a67d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Thu, 30 Nov 2023 15:17:37 +0100 Subject: [PATCH 1/9] Set ldap and sso support to "not relevant" As synapse fully support SSO for me it's not true to say that this app don't support SSO as it work with synpase. But with some other matrix server it could be not implemented and in this case it's not supported and in this case it false to say that is not supported. So for me the better value is to set to 'not_relevant' and on server side we should define exactly what is the implementation of theses features. --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index b5f4ae1..43f305e 100644 --- a/manifest.toml +++ b/manifest.toml @@ -22,9 +22,9 @@ yunohost = ">= 11.2" architectures = "all" multi_instance = true -ldap = false +ldap = "not_relevant" -sso = false +sso = "not_relevant" disk = "50M" ram.build = "50M" From b11044de1a89d6c8fdb596bf43e89f6c8612f643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Thu, 30 Nov 2023 15:31:49 +0100 Subject: [PATCH 2/9] Rework config pannel to use template instead of config edit Edit config has limitation like changing the config file from upstream later and we lost user preferance in the yunohost app settings --- config_panel.toml | 3 --- scripts/_common.sh | 7 +++++++ scripts/install | 5 +---- scripts/upgrade | 7 ++----- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 13e7ae1..ae49309 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -15,8 +15,6 @@ name.fr = "Configuration d'Element" default = "matrix.org" help.en = "Define Matrix default home server address." help.fr = "Définir l'adresse du serveur par défaut de Matrix." - bind = "base_url:__INSTALL_DIR__/config.json" - [main.config.login_for_welcome] ask.en = "Display login as welcome page" @@ -26,4 +24,3 @@ name.fr = "Configuration d'Element" no = false help.en = "When true, the app will use the login form as a welcome page instead of the welcome page itself. This disables use of welcome_url and all welcome page functionality." help.fr = "Quand l'option est sélectionnée, l'application utilisera le formulaire de connexion comme page d'accueil au lieu de la page d'accueil elle-même. Cela désactive l'utilisation de welcome_url et de toutes les fonctionnalités de la page d'accueil." - bind = "login_for_welcome:__INSTALL_DIR__/config.json" diff --git a/scripts/_common.sh b/scripts/_common.sh index 944a65e..c71aa26 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -8,6 +8,13 @@ # PERSONAL HELPERS #================================================= +configure_element() +{ + ynh_add_config --template="config.json" --destination="$install_dir/config.json" + chmod -R u=rwX,g=rX,o= "$install_dir" + chown -R $app:www-data "$install_dir" +} + #================================================= # EXPERIMENTAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index 9edc574..18fc280 100644 --- a/scripts/install +++ b/scripts/install @@ -37,10 +37,7 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -ynh_add_config --template="../conf/config.json" --destination="$install_dir/config.json" - -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +configure_element #================================================= # END OF SCRIPT diff --git a/scripts/upgrade b/scripts/upgrade index dbb5105..8aa39e7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -52,12 +52,9 @@ chown -R $app:www-data "$install_dir" #================================================= # ADD A CONFIGURATION #================================================= -#ynh_script_progression --message="Adding a configuration file..." --weight=1 +ynh_script_progression --message="Adding a configuration file..." --weight=1 -#ynh_add_config --template="../conf/config.json" --destination="$install_dir/config.json" - -#chmod -R o-rwx "$install_dir" -#chown -R $app:www-data "$install_dir" +configure_element #================================================= # REAPPLY SYSTEM CONFIGURATIONS From bc8d9c5b514870f158567a071314bf9d09950ddf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Thu, 30 Nov 2023 15:59:43 +0100 Subject: [PATCH 3/9] Update config from upstream --- conf/config.json | 33 +++++++++++++++++++++++++++++---- config_panel.toml | 9 --------- scripts/config | 22 ++++++++++++++++++++++ scripts/install | 2 -- scripts/upgrade | 5 ----- 5 files changed, 51 insertions(+), 20 deletions(-) create mode 100644 scripts/config diff --git a/conf/config.json b/conf/config.json index 7001039..4fe2638 100644 --- a/conf/config.json +++ b/conf/config.json @@ -1,16 +1,32 @@ { "default_server_config": { "m.homeserver": { - "base_url": "https://__DEFAULT_HOME_SERVER__" + "base_url": "https://__DEFAULT_HOME_SERVER__", + "server_name": "matrix.org" }, "m.identity_server": { "base_url": "https://vector.im" } }, + "disable_custom_urls": false, + "disable_guests": false, + "disable_login_language_selector": false, + "disable_3pid_login": false, "brand": "Element", "integrations_ui_url": "https://scalar.vector.im/", "integrations_rest_url": "https://scalar.vector.im/api", + "integrations_widgets_urls": [ + "https://scalar.vector.im/_matrix/integrations/v1", + "https://scalar.vector.im/api", + "https://scalar-staging.vector.im/_matrix/integrations/v1", + "https://scalar-staging.vector.im/api", + "https://scalar-staging.riot.im/scalar/api" + ], + "default_country_code": "GB", "show_labs_settings": false, + "features": {}, + "default_federate": true, + "default_theme": "light", "room_directory": { "servers": ["matrix.org"] }, @@ -18,7 +34,16 @@ "https://matrix.org": false, "https://matrix-client.matrix.org": false }, - "embedded_pages": { - "login_for_welcome": __LOGIN_FOR_WELCOME__ - } + "setting_defaults": { + "breadcrumbs": true + }, + "jitsi": { + "preferred_domain": "meet.element.io" + }, + "element_call": { + "url": "https://call.element.io", + "participant_limit": 8, + "brand": "Element Call" + }, + "map_style_url": "https://api.maptiler.com/maps/streets/style.json?key=fU3vlMsMn4Jb6dnEIFsx" } diff --git a/config_panel.toml b/config_panel.toml index ae49309..f75c4e6 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -15,12 +15,3 @@ name.fr = "Configuration d'Element" default = "matrix.org" help.en = "Define Matrix default home server address." help.fr = "Définir l'adresse du serveur par défaut de Matrix." - - [main.config.login_for_welcome] - ask.en = "Display login as welcome page" - ask.fr = "Afficher la connexion comme page d'accueil" - type = "boolean" - yes = true - no = false - help.en = "When true, the app will use the login form as a welcome page instead of the welcome page itself. This disables use of welcome_url and all welcome page functionality." - help.fr = "Quand l'option est sélectionnée, l'application utilisera le formulaire de connexion comme page d'accueil au lieu de la page d'accueil elle-même. Cela désactive l'utilisation de welcome_url et de toutes les fonctionnalités de la page d'accueil." diff --git a/scripts/config b/scripts/config new file mode 100644 index 0000000..3c2c734 --- /dev/null +++ b/scripts/config @@ -0,0 +1,22 @@ +#!/bin/bash + +#================================================= +# GENERIC START +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + +source ./_common.sh +source /usr/share/yunohost/helpers + +ynh_app_config_apply() { + _ynh_app_config_apply + configure_element +} + +#================================================= +# GENERIC FINALIZATION +#================================================= +# SELECT THE ACTION FOLLOWING THE GIVEN ARGUMENT +#================================================= +ynh_app_config_run $1 diff --git a/scripts/install b/scripts/install index 18fc280..06b633b 100644 --- a/scripts/install +++ b/scripts/install @@ -13,8 +13,6 @@ source /usr/share/yunohost/helpers # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -login_for_welcome=true -ynh_app_setting_set --app=$app --key=login_for_welcome --value=$login_for_welcome #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE diff --git a/scripts/upgrade b/scripts/upgrade index 8aa39e7..07b0b0b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -26,11 +26,6 @@ if [ -z "${default_home_server:-}" ]; then ynh_app_setting_set --app=$app --key=default_home_server --value=$default_home_server fi -if [ -z "${login_for_welcome:-}" ]; then - login_for_welcome=true - ynh_app_setting_set --app=$app --key=login_for_welcome --value=$login_for_welcome -fi - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= From 9171a703cc310b1ec35b0f233189ac0d72857ae3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Mon, 18 Dec 2023 19:23:48 +0100 Subject: [PATCH 4/9] fix permission texts --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index c74ef08..88bb60e 100644 --- a/manifest.toml +++ b/manifest.toml @@ -46,8 +46,8 @@ ram.runtime = "50M" default = "matrix.org" [install.init_main_permission] - help.en = "'visitors' permission means that anyone can access the Matrix server." - help.fr = "Autoriser les 'Visiteurs' signifie que n'importe qui peut accéder au server Matrix." + help.en = "'visitors' permission means that anyone can access the Element application." + help.fr = "Autoriser les 'Visiteurs' signifie que n'importe qui peut accéder l'application Element." type = "group" default = "visitors" From 5558a0b5cbbba129d516b1fd3d542f92f9d083c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Mon, 18 Dec 2023 19:27:04 +0100 Subject: [PATCH 5/9] Update tests config --- tests.toml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests.toml b/tests.toml index bcd32f2..0545023 100644 --- a/tests.toml +++ b/tests.toml @@ -5,7 +5,7 @@ test_format = 1.0 # ------------------------------- # Default args to use for install # ------------------------------- - + args.default_home_server = "matrix.org" # ------------------------------- @@ -13,5 +13,3 @@ test_format = 1.0 # ------------------------------- test_upgrade_from.26a68cb850f5886aa78671e241a897f48910f314.name = "Upgrade from 1.11.37" - test_upgrade_from.26a68cb850f5886aa78671e241a897f48910f314.args.domain = "domain.tld" - test_upgrade_from.26a68cb850f5886aa78671e241a897f48910f314.args.is_public = true From b911051c25c2940126f82cc41d31a9caf746b0b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Tue, 19 Dec 2023 10:13:52 +0100 Subject: [PATCH 6/9] Add more feature on control panel --- conf/config.json | 16 +++++++------- config_panel.toml | 56 +++++++++++++++++++++++++++++++++++++++++++++++ scripts/install | 17 ++++++++++++++ scripts/upgrade | 47 +++++++++++++++++++++++++++++++++++---- 4 files changed, 124 insertions(+), 12 deletions(-) diff --git a/conf/config.json b/conf/config.json index 4fe2638..f1e631e 100644 --- a/conf/config.json +++ b/conf/config.json @@ -8,11 +8,11 @@ "base_url": "https://vector.im" } }, - "disable_custom_urls": false, - "disable_guests": false, + "disable_custom_urls": __DISABLE_CUSTOM_URLS__, + "disable_guests": __DISABLE_GUESTS__, "disable_login_language_selector": false, - "disable_3pid_login": false, - "brand": "Element", + "disable_3pid_login": __DISABLE_3PID_LOGIN__, + "brand": "__BRAND_TEXT__", "integrations_ui_url": "https://scalar.vector.im/", "integrations_rest_url": "https://scalar.vector.im/api", "integrations_widgets_urls": [ @@ -22,11 +22,11 @@ "https://scalar-staging.vector.im/api", "https://scalar-staging.riot.im/scalar/api" ], - "default_country_code": "GB", - "show_labs_settings": false, + "default_country_code": "__DEFAULT_COUNTRY_CODE__", + "show_labs_settings": __SHOW_LABS_SETTINGS__, "features": {}, - "default_federate": true, - "default_theme": "light", + "default_federate": __DEFAULT_FEDERATE__, + "default_theme": "__DEFAULT_THEME__", "room_directory": { "servers": ["matrix.org"] }, diff --git a/config_panel.toml b/config_panel.toml index f75c4e6..d7f6022 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -15,3 +15,59 @@ name.fr = "Configuration d'Element" default = "matrix.org" help.en = "Define Matrix default home server address." help.fr = "Définir l'adresse du serveur par défaut de Matrix." + + [main.config.disable_custom_urls] + ask.en = "Disable custom URL field on login page" + ask.fr = "Déactiver le champ URL personnalisé sur la page login" + type = "boolean" + yes = 'true' + no = 'false' + + [main.config.disable_3pid_login] + ask.en = "Disable possibility to login with email or phone number" + ask.fr = "Déactiver la possibilité de s'authentifier avec un email ou no de téléphone" + type = "boolean" + yes = 'true' + no = 'false' + + [main.config.disable_guests] + ask.en = "Disable guest on login page" + ask.fr = "Déactiver le login en tant qu'invité" + type = "boolean" + yes = 'true' + no = 'false' + + [main.config.default_country_code] + ask.en = "Default country code" + ask.fr = "Code du pay par défaut" + type = "string" + example = "GB" + help.en = "By example 'FR' for France. You can refer to this page to find your favourite country code: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements" + help.fr = "Par example 'FR' pour la France. Vous pouvez vous référer à la page suivante afin de trouver votre pays favori: https://fr.wikipedia.org/wiki/ISO_3166-1#Table_de_codage" + pattern.regexp = "^[A-Z]{2}$" + + [main.config.brand_text] + ask.en = "Branding text for the application" + ask.fr = "Texte de marque pour l'application" + type = "string" + + [main.config.default_federate] + ask.en = "Enable fedration features by default" + ask.fr = "Activer les fonctionnalités de fédération par défaut" + type = "boolean" + yes = 'true' + no = 'false' + + + [main.config.default_theme] + ask.en = "Disable custom URL field on login page" + ask.fr = "Déactiver le champ URL personnalisé sur la page login" + type = "select" + choices = [ "light", "dark" ] + + [main.config.show_labs_settings] + ask.en = "Show the experimental feature menu" + ask.fr = "Afficher le menu d'activation des fonctionnalités expérimentales" + type = "boolean" + yes = 'true' + no = 'false' diff --git a/scripts/install b/scripts/install index 06b633b..940db4a 100644 --- a/scripts/install +++ b/scripts/install @@ -13,6 +13,23 @@ source /usr/share/yunohost/helpers # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= +disable_custom_urls=false +disable_guests=false +disable_3pid_login=false +default_country_code=GB +brand_text=Element +default_federate=true +default_theme=light +show_labs_settings=false + +ynh_app_setting_set --app=$app --key=disable_custom_urls --value=$disable_custom_urls +ynh_app_setting_set --app=$app --key=disable_guests --value=$disable_guests +ynh_app_setting_set --app=$app --key=disable_3pid_login --value=$disable_3pid_login +ynh_app_setting_set --app=$app --key=default_country_code --value=$default_country_code +ynh_app_setting_set --app=$app --key=brand_text --value=$brand_text +ynh_app_setting_set --app=$app --key=default_federate --value=$default_federate +ynh_app_setting_set --app=$app --key=default_theme --value=$default_theme +ynh_app_setting_set --app=$app --key=show_labs_settings --value=$show_labs_settings #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE diff --git a/scripts/upgrade b/scripts/upgrade index 07b0b0b..f845b4f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,12 +18,51 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 +ynh_script_progression --message='Ensuring downward compatibility...' --weight=1 -# If default_home_server doesn't exist, create it if [ -z "${default_home_server:-}" ]; then - default_home_server="matrix.org" - ynh_app_setting_set --app=$app --key=default_home_server --value=$default_home_server + default_home_server='matrix.org' + ynh_app_setting_set --app=$app --key=default_home_server --value=$default_home_server +fi + +if [ -z "${disable_custom_urls:-}" ]; then + disable_custom_urls=false + ynh_app_setting_set --app=$app --key=disable_custom_urls --value=$disable_custom_urls +fi + +if [ -z "${disable_guests:-}" ]; then + disable_guests=false + ynh_app_setting_set --app=$app --key=disable_guests --value=$disable_guests +fi + +if [ -z "${disable_3pid_login:-}" ]; then + disable_3pid_login=false + ynh_app_setting_set --app=$app --key=disable_3pid_login --value=$disable_3pid_login +fi + +if [ -z "${default_country_code:-}" ]; then + default_country_code=false + ynh_app_setting_set --app=$app --key=default_country_code --value=$default_country_code +fi + +if [ -z "${brand_text:-}" ]; then + brand_text=Element + ynh_app_setting_set --app=$app --key=brand_text --value=$brand_text +fi + +if [ -z "${default_federate:-}" ]; then + default_federate=true + ynh_app_setting_set --app=$app --key=default_federate --value=$default_federate +fi + +if [ -z "${default_theme:-}" ]; then + default_theme=light + ynh_app_setting_set --app=$app --key=default_theme --value=$default_theme +fi + +if [ -z "${show_labs_settings:-}" ]; then + show_labs_settings=false + ynh_app_setting_set --app=$app --key=show_labs_settings --value=$show_labs_settings fi #================================================= From c9ae1a254c94b7487b97c4e35b945404eb76d189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Tue, 19 Dec 2023 10:44:07 +0100 Subject: [PATCH 7/9] Fix ram and disk storage --- manifest.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index 88bb60e..b650f33 100644 --- a/manifest.toml +++ b/manifest.toml @@ -26,9 +26,9 @@ ldap = "not_relevant" sso = "not_relevant" -disk = "50M" -ram.build = "50M" -ram.runtime = "50M" +disk = "70M" +ram.build = "0M" +ram.runtime = "0M" [install] [install.domain] From c4990ca06564c858147b0b581ed65ea78b73315f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 19 Dec 2023 18:37:41 +0100 Subject: [PATCH 8/9] Update manifest.toml --- manifest.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index adeb769..507af4e 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Element" description.en = "Web client for Matrix" description.fr = "Client web pour Matrix" -version = "1.11.51~ynh1" +version = "1.11.52~ynh1" maintainers = ["Josué Tille"] @@ -56,8 +56,8 @@ ram.runtime = "50M" [resources.sources] [resources.sources.main] - url = "https://github.com/vector-im/element-web/releases/download/v1.11.51/element-v1.11.51.tar.gz" - sha256 = "8566c53b22e6a63a2876d76d52a1cd6e3f121ce1404e0d187b54c09656226128" + url = "https://github.com/vector-im/element-web/releases/download/v1.11.52/element-v1.11.52.tar.gz" + sha256 = "1f309d7863f583fef7294aa34ae19413991fd82aebd4c5d8bc3ac72eab04f71a" autoupdate.strategy = "latest_github_tag" [resources.system_user] From efef7381a030b473eb5f764c680cb6ffeb9a0021 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 19 Dec 2023 17:37:46 +0000 Subject: [PATCH 9/9] 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 ed1c7f9..1caee60 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Element is a new type of messaging app. You choose where your messages are stored, putting you in control of your data. It gives you access to the Matrix open network, so you can talk to anyone. Element provides a new level of security, adding cross-signed device verification to default end-to-end encryption. -**Shipped version:** 1.11.51~ynh1 +**Shipped version:** 1.11.52~ynh1 **Demo:** https://app.element.io/ diff --git a/README_fr.md b/README_fr.md index 497e95b..7743cb3 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Element est un nouveau type d'application de messagerie. Vous choisissez où vos messages sont stockés, ce qui vous donne le contrôle de vos données. Il vous donne accès au réseau ouvert Matrix, vous pouvez donc parler à n'importe qui. Element offre un nouveau niveau de sécurité, en ajoutant la vérification des appareils par signature croisée au chiffrement de bout en bout par défaut. -**Version incluse :** 1.11.51~ynh1 +**Version incluse :** 1.11.52~ynh1 **Démo :** https://app.element.io/