From cbebfa9557b4a4db1028102d2835e5a195d53075 Mon Sep 17 00:00:00 2001 From: Gredin 67 Date: Fri, 6 Jan 2023 14:38:14 +0100 Subject: [PATCH 01/95] imrove config panel --- conf/homeserver.yaml | 32 +++---- config_panel.toml | 185 ++++++++++++++++++++++++++++++++++++++ config_panel.toml.example | 54 ----------- scripts/install | 40 ++++++++- scripts/upgrade | 95 +++++++++++++++++++- 5 files changed, 332 insertions(+), 74 deletions(-) create mode 100644 config_panel.toml delete mode 100644 config_panel.toml.example diff --git a/conf/homeserver.yaml b/conf/homeserver.yaml index f68cc246..39fd1b77 100644 --- a/conf/homeserver.yaml +++ b/conf/homeserver.yaml @@ -50,7 +50,7 @@ pid_file: /run/matrix-__APP__/homeserver.pid # The absolute URL to the web client which / will redirect to. # -#web_client_location: https://riot.example.com/ +web_client_location: __ELEMENT_YNH_URL__ # The public-facing base URL that clients use to access this Homeserver (not # including _matrix/...). This is the same URL a user might enter into the @@ -122,12 +122,12 @@ presence: # public rooms directory through the client API, meaning that anyone can # query the room directory. Defaults to 'false'. # -allow_public_rooms_without_auth: __ALLOW_PUBLIC_ROOMS__ +allow_public_rooms_without_auth: __ALLOW_PUBLIC_ROOMS_WITHOUT_AUTH__ # If set to 'true', allows any other homeserver to fetch the server's public # rooms directory via federation. Defaults to 'false'. # -allow_public_rooms_over_federation: __ALLOW_PUBLIC_ROOMS__ +allow_public_rooms_over_federation: __ALLOW_PUBLIC_ROOMS_OVER_FEDERATION__ # The default room version for newly created rooms. # @@ -1278,12 +1278,12 @@ registrations_require_3pid: # Explicitly disable asking for MSISDNs from the registration # flow (overrides registrations_require_3pid if MSISDNs are set as required) # -#disable_msisdn_registration: true +disable_msisdn_registration: __DISABLE_MSISDN_REGISTRATION__ # Mandate that users are only allowed to associate certain formats of # 3PIDs with accounts on this server. # -#allowed_local_3pids: +allowed_local_3pids: # - medium: email # pattern: '^[^@]+@matrix\.org$' # - medium: email @@ -1327,7 +1327,7 @@ registration_shared_secret: "__REGISTRATION_SHARED_SECRET__" # participate in rooms hosted on this server which have been made # accessible to anonymous users. # -#allow_guest_access: false +allow_guest_access: __ALLOW_GUEST_ACCESS__ # The identity server which we suggest that clients should use when users log # in on this server. @@ -1335,7 +1335,7 @@ registration_shared_secret: "__REGISTRATION_SHARED_SECRET__" # (By default, no suggestion is made, so it is left up to the client. # This setting is ignored unless public_baseurl is also explicitly set.) # -#default_identity_server: https://matrix.org +default_identity_server: __DEFAULT_IDENTITY_SERVER__ # Handle threepid (email/phone etc) registration and password resets through a set of # *trusted* identity servers. Note that this allows the configured identity server to @@ -1394,7 +1394,7 @@ account_threepid_delegates: # If the room already exists, make certain it is a publicly joinable # room. The join rule of the room must be set to 'public'. # -#auto_join_rooms: +auto_join_rooms: # - "#example:example.com" # Where auto_join_rooms are specified, setting this flag ensures that the @@ -1462,7 +1462,7 @@ account_threepid_delegates: # # Defaults to true. # -#auto_join_rooms_for_guests: false +auto_join_rooms_for_guests: __AUTO_JOIN_ROOMS_FOR_GUESTS__ # Whether to inhibit errors raised when registering a new account if the user ID # already exists. If turned on, that requests to /register/available will always @@ -2167,7 +2167,7 @@ __DOMAIN_WHITELIST_CLIENT__ password_config: # Uncomment to disable password login # - #enabled: false + enabled: __PASSWORD_ENABLED__ # Uncomment to disable authentication against the local password # database. This is ignored if `enabled` is false, and is only useful @@ -2307,12 +2307,12 @@ email: # Uncomment the following to enable sending emails for messages that the user # has missed. Disabled by default. # - enable_notifs: true + enable_notifs: __ENABLE_NOTIFS__ # Uncomment the following to disable automatic subscription to email # notifications for new users. Enabled by default. # - #notif_for_new_users: false + notif_for_new_users: __NOTIF_FOR_NEW_USERS__ # Custom URL for client links within the email notifications. By default # links will be based on "https://matrix.to". @@ -2320,7 +2320,7 @@ email: # (This setting used to be called riot_base_url; the old name is still # supported for backwards-compatibility but is now deprecated.) # - #client_base_url: "http://localhost/riot" + client_base_url: __ELEMENT_YNH_URL__ # Configure the time that a validation email will expire after sending. # Defaults to 1h. @@ -2331,7 +2331,7 @@ email: # to the identity server as the org.matrix.web_client_location key. Defaults # to unset, giving no guidance to the identity server. # - #invite_client_location: https://app.element.io + invite_client_location: __ELEMENT_YNH_URL__ # Subjects to use when sending emails from Synapse. # @@ -2450,12 +2450,12 @@ push: # Note that this option will only affect rooms created after it is set. It # will also not affect rooms created by other servers. # -#encryption_enabled_by_default_for_room_type: invite +encryption_enabled_by_default_for_room_type: __E2E_ENABLED_BY_DEFAULT__ # Uncomment to allow non-server-admin users to create groups on this server # -enable_group_creation: true +enable_group_creation: __ENABLE_GROUP_CREATION__ # If enabled, non server admins can only create groups with local parts # starting with this prefix diff --git a/config_panel.toml b/config_panel.toml new file mode 100644 index 00000000..a811b6ce --- /dev/null +++ b/config_panel.toml @@ -0,0 +1,185 @@ +version = "1.0" + +[homeserver] +name = "Synapse Homeserver" +services = ["__APP__"] + + [homeserver.config] + name = "Configuration Options" + + [homeserver.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." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + + [homeserver.registration] + name = "Homeserver Registration" + + [homeserver.registration.turn_allow_guests] + ask = "Should guests be allowed to use the TURN server?" + type = "boolean" + yes = true + no = false + help = "This defaults to True, otherwise VoIP will be unreliable for guests. However, it does introduce a slight security risk as it allows users to connect to arbitrary endpoints without having first signed up for a valid account (e.g. by passing a CAPTCHA)." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + + [homeserver.registration.enable_registration] + ask = "Enable Registration for new users." + type = "boolean" + yes = true + no = false + help = "Defaults to 'false'. If 'true', it is highly recommended to use either captcha, email, or token-based verification to avoid SPAM." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + + [homeserver.registration.registrations_require_3pid] + ask = "Register only with all below types of 3PID." + type = "string" + help = "Defaults to: '- email'. Phone number: '- msisdn'" + bind = ":/etc/matrix-__APP__/homeserver.yaml" + + [homeserver.registration.disable_msisdn_registration] + ask = "Disable asking Phone Number in Registration flow." + type = "boolean" + yes = true + no = false + help = "Overrides above setting if MSISDNs are set as required." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + + [homeserver.registration.allowed_local_3pids] + ask = "Register only with given formats of 3PIDs." + type = "string" + help = ''' + allowed_local_3pids: + - medium: email - medium: email + pattern: '^[^@]+@matrix\.org$' + - medium: msisdn + pattern: '\+33' + ''' + + [homeserver.registration.registration_shared_secret] + ask = "Shared Secret for Registration." + type = "string" + help = "Allows registration of standard or admin accounts, even if Registration disabled." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + + [homeserver.registration.allow_guest_access] + ask = "Allow Users to Register as Guests?" + type = "boolean" + yes = true + no = false + help = "Guests can participate on this server in rooms with guest access enabled, without a password/email/etc." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + + [homeserver.privacy] + name = "Data Privacy" + + [homeserver.privacy.default_identity_server] + ask = "Identity server suggested to clients." + type = "string" + help = "By default, no suggestion is made, so it is left up to the client." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + + [homeserver.privacy.allow_public_rooms_without_auth] + 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." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + + [homeserver.privacy.allow_public_rooms_over_federation] + 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." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + +[client] +name = "Matrix Client" +services = ["__APP__"] + + [client.welcome] + name = "Welcome User Experience" + + [client.welcome.auto_join_rooms] + ask = "Auto Join new Users in following Rooms." + type = "string" + default = '#example:example.com' + help = "Room should be public. If not existing, will be created as public and federated by default. Can be customised with the settings autocreate_auto_join_rooms." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + + [client.welcome.auto_join_rooms_for_guests] + ask = "Enable Auto Join Room for Guests?" + type = "boolean" + yes = true + no = false + help = "Defaults to 'true'." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + + [client.welcome.password_enabled] + ask = "Enable Password Login?" + type = "boolean" + yes = true + no = false + help = "Defaults to 'true'." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + + [client.welcome.enable_notifs] + ask = "Enable sending emails for messages the user missed?" + type = "boolean" + yes = true + no = false + help = "Defaults to 'false'." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + + [client.welcome.notif_for_new_users] + ask = "Enable email notifications for new users?" + type = "boolean" + yes = true + no = false + help = "Defaults to 'true'." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + + [client.experience] + name = "User Experience" + + [client.experience.element_ynh_url] + ask = "URL of the Default Element Instance." + type = "string" + default = '#example:example.com' + help = "URL for web client links within the email notifications (client_base_url) AND to direct users to during an invite (invite_client_location) AND to which / will redirect to (web_client_location)" + bind = ":/etc/matrix-__APP__/homeserver.yaml" + + [client.experience.enable_group_creation] + ask = "Allow non-server-admin Users to create Spaces?" + type = "boolean" + yes = true + no = false + help = "Defaults to 'false'." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + + [client.experience.e2e_enabled_by_default] + ask = "End-to-End Encryption by default for locally-created Rooms" + type = "select" + choices = ["all", "invite", "off"] + help = ''' + * "all": any locally-created room + * "invite": any room created with the "private_chat" or "trusted_private_chat" room creation presets + * "off": this option will take no effect + ''' + bind = ":/etc/matrix-__APP__/homeserver.yaml" + + [client.package_config] + name = "Package configuration" + + [client.package_config.backup_before_upgrade] + ask = "Backup before upgrade" + type = "boolean" + yes = true + no = false + help = "Set to 'true' to back up before each upgrade." + bind = ":/etc/matrix-__APP__/homeserver.yaml" diff --git a/config_panel.toml.example b/config_panel.toml.example deleted file mode 100644 index d2da7f93..00000000 --- a/config_panel.toml.example +++ /dev/null @@ -1,54 +0,0 @@ -version = "1.0" - -[main] -name = "Synapse configuration" - - [main.config] - name = "Configuration Options" - - [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." - - [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." - - [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." - - [main.client_config] - name = "Matrix client configuration" - - [main.client_config.jitsi_server] - ask = "Jitsi server address" - type = "string" - default = 'jitsi.riot.im' - 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." - - [main.client_config.e2e_enabled_by_default] - ask = "End to end encryption by default for direct messages" - type = "boolean" - 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." - - [main.package_config] - name = "Package configuration" - - [main.package_config.backup_before_upgrade] - ask = "Backup before upgrade" - type = "boolean" - yes = true - no = false - help = "Set to 'true' to back up before each upgrade." diff --git a/scripts/install b/scripts/install index f6200035..1c907b08 100644 --- a/scripts/install +++ b/scripts/install @@ -33,7 +33,6 @@ synapse_db_user="matrix_$app" synapse_db_name="matrix_$app" upstream_version=$(ynh_app_upstream_version) report_stats="false" -allow_public_rooms="false" e2e_enabled_by_default="true" default_domain_value="Same than the domain" domain_whitelist_client=$(get_domain_list) @@ -45,7 +44,6 @@ domain_whitelist_client=$(get_domain_list) domain=$YNH_APP_ARG_DOMAIN server_name=$YNH_APP_ARG_SERVER_NAME is_free_registration=$YNH_APP_ARG_IS_FREE_REGISTRATION -jitsi_server=$YNH_APP_ARG_JITSI_SERVER path_url="/_matrix" final_path="/opt/yunohost/matrix-$app" final_www_path="/var/www/$app" @@ -56,6 +54,11 @@ if [[ "$server_name" == "$default_domain_value" ]]; then server_name=$domain fi +# Get app name of first Element Instance (can be changed later in Config Panel) +element_instance="element" +element_domain=$(ynh_app_setting_get --app $element_instance --key domain) +element_path=$(ynh_app_setting_get --app $element_instance --key path) + #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= @@ -80,7 +83,6 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=no_sso --value true ynh_app_setting_set --app=$app --key=server_name --value=$server_name -ynh_app_setting_set --app=$app --key=jitsi_server --value=$jitsi_server ynh_app_setting_set --app=$app --key=final_path --value=$final_path ynh_app_setting_set --app=$app --key=synapse_version --value=$upstream_version ynh_app_setting_set --app=$app --key=is_free_registration --value=$is_free_registration @@ -89,6 +91,38 @@ ynh_app_setting_set --app=$app --key=allow_public_rooms --value=$allow_public_ro ynh_app_setting_set --app=$app --key=e2e_enabled_by_default --value=$e2e_enabled_by_default ynh_app_setting_set --app=$app --key=synapse_user_app_pwd --value=$synapse_user_app_pwd +#================================================= +## SET STANDARD SETTINGS FROM DEFAULT CONFIG +#================================================= + +element_ynh_url=element_domain+element_path +allow_public_rooms_without_auth="false" +allow_public_rooms_over_federation="false" +disable_msisdn_registration="true" +allowed_local_3pids="" +allow_guest_access="false" +default_identity_server="https://matrix.org" +auto_join_rooms="" +auto_join_rooms_for_guests="true" +password_enabled="true" +enable_notifs="true" +notif_for_new_users="true" +enable_group_creation="true" + +ynh_app_setting_set --app=$app --key=element_ynh_url --value=$element_ynh_url +ynh_app_setting_set --app=$app --key=allow_public_rooms_without_auth --value=$allow_public_rooms_without_auth +ynh_app_setting_set --app=$app --key=allow_public_rooms_over_federation --value=$allow_public_rooms_over_federation +ynh_app_setting_set --app=$app --key=disable_msisdn_registration --value=$disable_msisdn_registration +ynh_app_setting_set --app=$app --key=allowed_local_3pids --value=$allowed_local_3pids +ynh_app_setting_set --app=$app --key=allow_guest_access --value=$allow_guest_access +ynh_app_setting_set --app=$app --key=default_identity_server --value=$default_identity_server +ynh_app_setting_set --app=$app --key=auto_join_rooms --value=$auto_join_rooms +ynh_app_setting_set --app=$app --key=auto_join_rooms_for_guests --value=$auto_join_rooms_for_guests +ynh_app_setting_set --app=$app --key=password_enabled --value=$password_enabled +ynh_app_setting_set --app=$app --key=enable_notifs --value=$enable_notifs +ynh_app_setting_set --app=$app --key=notif_for_new_users --value=$notif_for_new_users +ynh_app_setting_set --app=$app --key=enable_group_creation --value=$enable_group_creation + #================================================= # STANDARD MODIFICATIONS #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index e108011c..2cabc861 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -33,7 +33,6 @@ turnserver_tls_port=$(ynh_app_setting_get --app=$app --key=turnserver_tls_port) turnserver_alt_tls_port=$(ynh_app_setting_get --app=$app --key=turnserver_alt_tls_port) cli_port=$(ynh_app_setting_get --app=$app --key=cli_port) report_stats=$(ynh_app_setting_get --app=$app --key=report_stats) -allow_public_rooms=$(ynh_app_setting_get --app=$app --key=allow_public_rooms) e2e_enabled_by_default=$(ynh_app_setting_get --app=$app --key=e2e_enabled_by_default) synapse_db_pwd=$(ynh_app_setting_get --app=$app --key=synapse_db_pwd) turnserver_pwd=$(ynh_app_setting_get --app=$app --key=turnserver_pwd) @@ -58,6 +57,23 @@ upgrade_type=$(ynh_check_app_version_changed) final_www_path="/var/www/$app" data_path="/home/yunohost.app/matrix-$app" +#================================================= +# GET CONFIG PANEL SETTINGS +#================================================= +element_ynh_url=$(ynh_app_setting_get --app=$app --key=element_ynh_url) +allow_public_rooms_without_auth=$(ynh_app_setting_get --app=$app --key=allow_public_rooms_without_auth) +allow_public_rooms_over_federation=$(ynh_app_setting_get --app=$app --key=allow_public_rooms_over_federation) +disable_msisdn_registration=$(ynh_app_setting_get --app=$app --key=disable_msisdn_registration) +allowed_local_3pids=$(ynh_app_setting_get --app=$app --key=allowed_local_3pids) +allow_guest_access=$(ynh_app_setting_get --app=$app --key=allow_guest_access) +default_identity_server=$(ynh_app_setting_get --app=$app --key=default_identity_server) +auto_join_rooms=$(ynh_app_setting_get --app=$app --key=auto_join_rooms) +auto_join_rooms_for_guests=$(ynh_app_setting_get --app=$app --key=auto_join_rooms_for_guests) +password_enabled=$(ynh_app_setting_get --app=$app --key=password_enabled) +enable_notifs=$(ynh_app_setting_get --app=$app --key=enable_notifs) +notif_for_new_users=$(ynh_app_setting_get --app=$app --key=notif_for_new_users) +enable_group_creation=$(ynh_app_setting_get --app=$app --key=enable_group_creation) + #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= @@ -162,6 +178,83 @@ if ! grep -q "$final_path" /etc/passwd; then sed --in-place -r "s@matrix-$app\:x\:([[:digit:]]+\:[[:digit:]]+)\:\:/.*/matrix-$app\:/usr/sbin/nologin@matrix-$app\:x\:\1\:\:$final_path\:/usr/sbin/nologin@g" /etc/passwd fi +# MIGRATION 7 : Working config panel v1 +#================================================= + +allow_public_rooms=$(ynh_app_setting_get --app=$app --key=allow_public_rooms) +# Get app name of first Element Instance +element_instance="element" +element_domain=$(ynh_app_setting_get --app $element_instance --key domain) +element_path=$(ynh_app_setting_get --app $element_instance --key path) + +# SET STANDARD SETTINGS FROM DEFAULT CONFIG + +if [ -z "$element_ynh_url" ] +then + element_ynh_url=element_domain+element_path + ynh_app_setting_set --app=$app --key=element_ynh_url --value=$element_ynh_url +fi +if [ -z "$allow_public_rooms_without_auth" ] +then + allow_public_rooms_without_auth=allow_public_rooms + ynh_app_setting_set --app=$app --key=allow_public_rooms_without_auth --value=$allow_public_rooms_without_auth +fi +if [ -z "$allow_public_rooms_over_federation" ] +then + allow_public_rooms_over_federation=allow_public_rooms + ynh_app_setting_set --app=$app --key=allow_public_rooms_over_federation --value=$allow_public_rooms_over_federation +fi +if [ -z "$disable_msisdn_registration" ] +then + disable_msisdn_registration="true" + ynh_app_setting_set --app=$app --key=disable_msisdn_registration --value=$disable_msisdn_registration +fi +if [ -z "$allowed_local_3pids" ] +then + allowed_local_3pids="" + ynh_app_setting_set --app=$app --key=allowed_local_3pids --value=$allowed_local_3pids +fi +if [ -z "$allow_guest_access" ] +then + allow_guest_access="false" + ynh_app_setting_set --app=$app --key=allow_guest_access --value=$allow_guest_access +fi +if [ -z "$default_identity_server" ] +then + default_identity_server="https://matrix.org" + ynh_app_setting_set --app=$app --key=default_identity_server --value=$default_identity_server +fi +if [ -z "$auto_join_rooms" ] +then + auto_join_rooms="" + ynh_app_setting_set --app=$app --key=auto_join_rooms --value=$auto_join_rooms +fi +if [ -z "$auto_join_rooms_for_guests" ] +then + auto_join_rooms_for_guests="true" + ynh_app_setting_set --app=$app --key=auto_join_rooms_for_guests --value=$auto_join_rooms_for_guests +fi +if [ -z "$password_enabled" ] +then + password_enabled="true" + ynh_app_setting_set --app=$app --key=password_enabled --value=$password_enabled +fi +if [ -z "$enable_notifs" ] +then + enable_notifs="true" + ynh_app_setting_set --app=$app --key=enable_notifs --value=$enable_notifs +fi +if [ -z "$notif_for_new_users" ] +then + notif_for_new_users="true" + ynh_app_setting_set --app=$app --key=notif_for_new_users --value=$notif_for_new_users +fi +if [ -z "$enable_group_creation" ] +then + enable_group_creation="true" + ynh_app_setting_set --app=$app --key=enable_group_creation --value=$enable_group_creation +fi + #================================================= # INSTALL DEPENDENCIES #================================================= From d0efc856deed6623e9363a9072dbbb25b12f0a87 Mon Sep 17 00:00:00 2001 From: Gredin 67 Date: Fri, 6 Jan 2023 14:48:08 +0100 Subject: [PATCH 02/95] https element url --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 1c907b08..e1268e0c 100644 --- a/scripts/install +++ b/scripts/install @@ -95,7 +95,7 @@ ynh_app_setting_set --app=$app --key=synapse_user_app_pwd --value=$synapse_user_ ## SET STANDARD SETTINGS FROM DEFAULT CONFIG #================================================= -element_ynh_url=element_domain+element_path +element_ynh_url="https://"+element_domain+element_path allow_public_rooms_without_auth="false" allow_public_rooms_over_federation="false" disable_msisdn_registration="true" diff --git a/scripts/upgrade b/scripts/upgrade index 2cabc861..fc6a8123 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -191,7 +191,7 @@ element_path=$(ynh_app_setting_get --app $element_instance --key path) if [ -z "$element_ynh_url" ] then - element_ynh_url=element_domain+element_path + element_ynh_url="https://"+element_domain+element_path ynh_app_setting_set --app=$app --key=element_ynh_url --value=$element_ynh_url fi if [ -z "$allow_public_rooms_without_auth" ] From 2b3cf8c331247eb4f0dcf294638209afeb5278ec Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Fri, 6 Jan 2023 17:34:41 +0100 Subject: [PATCH 03/95] revert remove jitsi setting --- scripts/install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index e1268e0c..d2cc5422 100644 --- a/scripts/install +++ b/scripts/install @@ -44,6 +44,7 @@ domain_whitelist_client=$(get_domain_list) domain=$YNH_APP_ARG_DOMAIN server_name=$YNH_APP_ARG_SERVER_NAME is_free_registration=$YNH_APP_ARG_IS_FREE_REGISTRATION +jitsi_server=$YNH_APP_ARG_JITSI_SERVER path_url="/_matrix" final_path="/opt/yunohost/matrix-$app" final_www_path="/var/www/$app" @@ -83,6 +84,7 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=no_sso --value true ynh_app_setting_set --app=$app --key=server_name --value=$server_name +ynh_app_setting_set --app=$app --key=jitsi_server --value=$jitsi_server ynh_app_setting_set --app=$app --key=final_path --value=$final_path ynh_app_setting_set --app=$app --key=synapse_version --value=$upstream_version ynh_app_setting_set --app=$app --key=is_free_registration --value=$is_free_registration From 4d0a7b9ff5229027cea94b6e1ea693831f20a4e9 Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Mon, 9 Jan 2023 11:40:53 +0100 Subject: [PATCH 04/95] correct bind --- config_panel.toml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index a811b6ce..29286ad9 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -13,7 +13,7 @@ services = ["__APP__"] yes = true no = false help = "Set to 'true' to send anonymous statistics to Synapse to improve performance." - bind = ":/etc/matrix-__APP__/homeserver.yaml" + bind = "report_stats:/etc/matrix-__APP__/homeserver.yaml" [homeserver.registration] name = "Homeserver Registration" @@ -126,7 +126,7 @@ services = ["__APP__"] yes = true no = false help = "Defaults to 'true'." - bind = ":/etc/matrix-__APP__/homeserver.yaml" + bind = "password_config>enabled:/etc/matrix-__APP__/homeserver.yaml" [client.welcome.enable_notifs] ask = "Enable sending emails for messages the user missed?" @@ -152,7 +152,9 @@ services = ["__APP__"] type = "string" default = '#example:example.com' help = "URL for web client links within the email notifications (client_base_url) AND to direct users to during an invite (invite_client_location) AND to which / will redirect to (web_client_location)" - bind = ":/etc/matrix-__APP__/homeserver.yaml" + bind = "client_base_url:/etc/matrix-__APP__/homeserver.yaml" + bind = "invite_client_location:/etc/matrix-__APP__/homeserver.yaml" + bind = "web_client_location:/etc/matrix-__APP__/homeserver.yaml" [client.experience.enable_group_creation] ask = "Allow non-server-admin Users to create Spaces?" @@ -171,7 +173,7 @@ services = ["__APP__"] * "invite": any room created with the "private_chat" or "trusted_private_chat" room creation presets * "off": this option will take no effect ''' - bind = ":/etc/matrix-__APP__/homeserver.yaml" + bind = "encryption_enabled_by_default_for_room_type:/etc/matrix-__APP__/homeserver.yaml" [client.package_config] name = "Package configuration" @@ -182,4 +184,3 @@ services = ["__APP__"] yes = true no = false help = "Set to 'true' to back up before each upgrade." - bind = ":/etc/matrix-__APP__/homeserver.yaml" From c7208ce2725ed4da50f7baceefc9811873b54165 Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Mon, 9 Jan 2023 12:02:56 +0100 Subject: [PATCH 05/95] Update install --- scripts/install | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/install b/scripts/install index d2cc5422..564443da 100644 --- a/scripts/install +++ b/scripts/install @@ -89,7 +89,6 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path ynh_app_setting_set --app=$app --key=synapse_version --value=$upstream_version ynh_app_setting_set --app=$app --key=is_free_registration --value=$is_free_registration 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=e2e_enabled_by_default --value=$e2e_enabled_by_default ynh_app_setting_set --app=$app --key=synapse_user_app_pwd --value=$synapse_user_app_pwd From 8e153d4fd6df1cdab70cd2cd397a36d3fb52f7e3 Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Mon, 9 Jan 2023 12:03:14 +0100 Subject: [PATCH 06/95] Update upgrade --- scripts/upgrade | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index fc6a8123..5e1e31bb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -144,11 +144,6 @@ if [ -z $report_stats ]; then 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 - if [ -z $is_free_registration ]; then is_free_registration=$(ynh_app_setting_get --app=$app --key=is_""public) ynh_app_setting_set --app=$app --key=is_free_registration --value=$is_free_registration @@ -182,6 +177,10 @@ fi #================================================= allow_public_rooms=$(ynh_app_setting_get --app=$app --key=allow_public_rooms) +if [ -z $allow_public_rooms ]; then + allow_public_rooms="false" +fi + # Get app name of first Element Instance element_instance="element" element_domain=$(ynh_app_setting_get --app $element_instance --key domain) From 24044b0ecd590111c2baebcc6713a4ccac826b33 Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Mon, 9 Jan 2023 23:26:39 +0100 Subject: [PATCH 07/95] default to matrix.to --- scripts/install | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index 564443da..4d14b132 100644 --- a/scripts/install +++ b/scripts/install @@ -55,11 +55,6 @@ if [[ "$server_name" == "$default_domain_value" ]]; then server_name=$domain fi -# Get app name of first Element Instance (can be changed later in Config Panel) -element_instance="element" -element_domain=$(ynh_app_setting_get --app $element_instance --key domain) -element_path=$(ynh_app_setting_get --app $element_instance --key path) - #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= @@ -96,7 +91,15 @@ ynh_app_setting_set --app=$app --key=synapse_user_app_pwd --value=$synapse_user_ ## SET STANDARD SETTINGS FROM DEFAULT CONFIG #================================================= +# Get app name of first Element Instance (can be changed later in Config Panel) +element_instance="element" +element_domain=$(ynh_app_setting_get --app $element_instance --key domain) +element_path=$(ynh_app_setting_get --app $element_instance --key path) element_ynh_url="https://"+element_domain+element_path +if [ -z "$element_domain" ]; then + element_ynh_url="https://matrix.to/" +fi + allow_public_rooms_without_auth="false" allow_public_rooms_over_federation="false" disable_msisdn_registration="true" From 5dbf9f89dd76bfac1825db7fcb404869f96cb355 Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Tue, 10 Jan 2023 00:20:52 +0100 Subject: [PATCH 08/95] matrix.to --- scripts/upgrade | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 5e1e31bb..9fb34878 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -173,6 +173,7 @@ if ! grep -q "$final_path" /etc/passwd; then sed --in-place -r "s@matrix-$app\:x\:([[:digit:]]+\:[[:digit:]]+)\:\:/.*/matrix-$app\:/usr/sbin/nologin@matrix-$app\:x\:\1\:\:$final_path\:/usr/sbin/nologin@g" /etc/passwd fi +#================================================= # MIGRATION 7 : Working config panel v1 #================================================= @@ -181,18 +182,23 @@ if [ -z $allow_public_rooms ]; then allow_public_rooms="false" fi -# Get app name of first Element Instance -element_instance="element" -element_domain=$(ynh_app_setting_get --app $element_instance --key domain) -element_path=$(ynh_app_setting_get --app $element_instance --key path) - # SET STANDARD SETTINGS FROM DEFAULT CONFIG +# Get app name of first Element Instance + if [ -z "$element_ynh_url" ] then - element_ynh_url="https://"+element_domain+element_path - ynh_app_setting_set --app=$app --key=element_ynh_url --value=$element_ynh_url + element_instance="element" + element_domain=$(ynh_app_setting_get --app $element_instance --key domain) + element_path=$(ynh_app_setting_get --app $element_instance --key path) + if [ -z "$element_domain" ]; then + element_ynh_url="https://matrix.to/" + else + element_ynh_url="https://"+element_domain+element_path + fi fi +ynh_app_setting_set --app=$app --key=element_ynh_url --value=$element_ynh_url + if [ -z "$allow_public_rooms_without_auth" ] then allow_public_rooms_without_auth=allow_public_rooms From 45f272140fc0a750896b5c89edd550db68fb0529 Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Tue, 10 Jan 2023 02:05:30 +0100 Subject: [PATCH 09/95] Update install --- scripts/install | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 4d14b132..e65ebdcb 100644 --- a/scripts/install +++ b/scripts/install @@ -91,13 +91,15 @@ ynh_app_setting_set --app=$app --key=synapse_user_app_pwd --value=$synapse_user_ ## SET STANDARD SETTINGS FROM DEFAULT CONFIG #================================================= +element_ynh_url="https://matrix.to/" # Get app name of first Element Instance (can be changed later in Config Panel) element_instance="element" +if yunohost --output-as plain app list | grep -q "^$element_instance$"; then element_domain=$(ynh_app_setting_get --app $element_instance --key domain) element_path=$(ynh_app_setting_get --app $element_instance --key path) element_ynh_url="https://"+element_domain+element_path -if [ -z "$element_domain" ]; then - element_ynh_url="https://matrix.to/" +#if [ -z "$element_domain" ]; then +# element_ynh_url="https://matrix.to/" fi allow_public_rooms_without_auth="false" From 6678d886ce893ccabe027a2b403140ab50e77860 Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Tue, 10 Jan 2023 02:07:48 +0100 Subject: [PATCH 10/95] Update upgrade --- scripts/upgrade | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 9fb34878..d58f902a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -188,12 +188,13 @@ fi if [ -z "$element_ynh_url" ] then + element_ynh_url="https://matrix.to/" element_instance="element" - element_domain=$(ynh_app_setting_get --app $element_instance --key domain) - element_path=$(ynh_app_setting_get --app $element_instance --key path) - if [ -z "$element_domain" ]; then - element_ynh_url="https://matrix.to/" - else + if yunohost --output-as plain app list | grep -q "^$element_instance$"; then + element_domain=$(ynh_app_setting_get --app $element_instance --key domain) + element_path=$(ynh_app_setting_get --app $element_instance --key path) + #if [ -z "$element_domain" ]; then + #else element_ynh_url="https://"+element_domain+element_path fi fi From 04a27604235fb7973ac293cb09aaeaf857339bd0 Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Tue, 10 Jan 2023 04:14:11 +0100 Subject: [PATCH 11/95] give auto_join_rooms default --- conf/homeserver.yaml | 4 +++- config_panel.toml | 11 +++++++++-- scripts/install | 6 +++++- scripts/upgrade | 8 +++++++- 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/conf/homeserver.yaml b/conf/homeserver.yaml index 39fd1b77..e92387b9 100644 --- a/conf/homeserver.yaml +++ b/conf/homeserver.yaml @@ -1284,6 +1284,7 @@ disable_msisdn_registration: __DISABLE_MSISDN_REGISTRATION__ # 3PIDs with accounts on this server. # allowed_local_3pids: +__ALLOWED_LOCAL_3PIDS__ # - medium: email # pattern: '^[^@]+@matrix\.org$' # - medium: email @@ -1395,6 +1396,7 @@ account_threepid_delegates: # room. The join rule of the room must be set to 'public'. # auto_join_rooms: +__AUTO_JOIN_ROOMS__ # - "#example:example.com" # Where auto_join_rooms are specified, setting this flag ensures that the @@ -1411,7 +1413,7 @@ auto_join_rooms: # Defaults to true. Uncomment the following line to disable automatically # creating auto-join rooms. # -#autocreate_auto_join_rooms: false +autocreate_auto_join_rooms: __AUTOCREATE_AUTO_JOIN_ROOMS__ # Whether the auto_join_rooms that are auto-created are available via # federation. Only has an effect if autocreate_auto_join_rooms is true. diff --git a/config_panel.toml b/config_panel.toml index 29286ad9..f8172438 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -108,8 +108,15 @@ services = ["__APP__"] [client.welcome.auto_join_rooms] ask = "Auto Join new Users in following Rooms." type = "string" - default = '#example:example.com' - help = "Room should be public. If not existing, will be created as public and federated by default. Can be customised with the settings autocreate_auto_join_rooms." + help = "Room should be public. If not existing, will be created as public and federated by default." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + + [client.welcome.autocreate_auto_join_rooms] + ask = "Create room for Auto Join if not existing." + type = "boolean" + yes = true + no = false + help = "Will be created as public and federated by default. Can be customised with the settings auto_join_*." bind = ":/etc/matrix-__APP__/homeserver.yaml" [client.welcome.auto_join_rooms_for_guests] diff --git a/scripts/install b/scripts/install index e65ebdcb..9655eefd 100644 --- a/scripts/install +++ b/scripts/install @@ -106,9 +106,12 @@ allow_public_rooms_without_auth="false" allow_public_rooms_over_federation="false" disable_msisdn_registration="true" allowed_local_3pids="" +# - medium: email +# pattern: '^[^@]+@matrix\.org$' allow_guest_access="false" default_identity_server="https://matrix.org" -auto_join_rooms="" +auto_join_rooms=' - "#auto_join_room:'+$server_name+'"' +autocreate_auto_join_rooms="false" auto_join_rooms_for_guests="true" password_enabled="true" enable_notifs="true" @@ -123,6 +126,7 @@ ynh_app_setting_set --app=$app --key=allowed_local_3pids --value=$allowed_local_ ynh_app_setting_set --app=$app --key=allow_guest_access --value=$allow_guest_access ynh_app_setting_set --app=$app --key=default_identity_server --value=$default_identity_server ynh_app_setting_set --app=$app --key=auto_join_rooms --value=$auto_join_rooms +ynh_app_setting_set --app=$app --key=autocreate_auto_join_rooms --value=$autocreate_auto_join_rooms ynh_app_setting_set --app=$app --key=auto_join_rooms_for_guests --value=$auto_join_rooms_for_guests ynh_app_setting_set --app=$app --key=password_enabled --value=$password_enabled ynh_app_setting_set --app=$app --key=enable_notifs --value=$enable_notifs diff --git a/scripts/upgrade b/scripts/upgrade index d58f902a..8333d150 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -68,6 +68,7 @@ allowed_local_3pids=$(ynh_app_setting_get --app=$app --key=allowed_local_3pids) allow_guest_access=$(ynh_app_setting_get --app=$app --key=allow_guest_access) default_identity_server=$(ynh_app_setting_get --app=$app --key=default_identity_server) auto_join_rooms=$(ynh_app_setting_get --app=$app --key=auto_join_rooms) +autocreate_auto_join_rooms=$(ynh_app_setting_get --app=$app --key=autocreate_auto_join_rooms) auto_join_rooms_for_guests=$(ynh_app_setting_get --app=$app --key=auto_join_rooms_for_guests) password_enabled=$(ynh_app_setting_get --app=$app --key=password_enabled) enable_notifs=$(ynh_app_setting_get --app=$app --key=enable_notifs) @@ -232,9 +233,14 @@ then fi if [ -z "$auto_join_rooms" ] then - auto_join_rooms="" + auto_join_rooms=' - "#auto_join_room:'+$server_name+'"' ynh_app_setting_set --app=$app --key=auto_join_rooms --value=$auto_join_rooms fi +if [ -z "$autocreate_auto_join_rooms" ] +then + autocreate_auto_join_rooms="false" + ynh_app_setting_set --app=$app --key=autocreate_auto_join_rooms --value=$autocreate_auto_join_rooms +fi if [ -z "$auto_join_rooms_for_guests" ] then auto_join_rooms_for_guests="true" From 2915167b7cc3c95287e9a7ef62803ef2e422c605 Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Tue, 10 Jan 2023 12:37:02 +0100 Subject: [PATCH 12/95] correct __FOOBAR__ init --- conf/homeserver.yaml | 10 ++++------ scripts/install | 9 +++++---- scripts/upgrade | 10 ++++++++-- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/conf/homeserver.yaml b/conf/homeserver.yaml index e92387b9..bcbff093 100644 --- a/conf/homeserver.yaml +++ b/conf/homeserver.yaml @@ -1272,7 +1272,7 @@ enable_registration: __ALLOWED_ACCESS__ # The user must provide all of the below types of 3PID when registering. # registrations_require_3pid: - - email + - __REGISTRATIONS_REQUIRE_3PID__ # - msisdn # Explicitly disable asking for MSISDNs from the registration @@ -1284,9 +1284,8 @@ disable_msisdn_registration: __DISABLE_MSISDN_REGISTRATION__ # 3PIDs with accounts on this server. # allowed_local_3pids: -__ALLOWED_LOCAL_3PIDS__ -# - medium: email -# pattern: '^[^@]+@matrix\.org$' + - medium: __REGISTRATIONS_REQUIRE_3PID__ + pattern: __ALLOWED_LOCAL_3PIDS__ # - medium: email # pattern: '^[^@]+@vector\.im$' # - medium: msisdn @@ -1396,8 +1395,7 @@ account_threepid_delegates: # room. The join rule of the room must be set to 'public'. # auto_join_rooms: -__AUTO_JOIN_ROOMS__ -# - "#example:example.com" + - "__AUTO_JOIN_ROOMS__" # Where auto_join_rooms are specified, setting this flag ensures that the # the rooms exist by creating them when the first user on the diff --git a/scripts/install b/scripts/install index 9655eefd..c751e2de 100644 --- a/scripts/install +++ b/scripts/install @@ -105,12 +105,12 @@ fi allow_public_rooms_without_auth="false" allow_public_rooms_over_federation="false" disable_msisdn_registration="true" -allowed_local_3pids="" -# - medium: email -# pattern: '^[^@]+@matrix\.org$' +registrations_require_3pid="email" +# here we need sed magic to transform $server_name +allowed_local_3pids="'^[^@]+@""matrix""\.org$'" allow_guest_access="false" default_identity_server="https://matrix.org" -auto_join_rooms=' - "#auto_join_room:'+$server_name+'"' +auto_join_rooms="#auto_join_room:""$server_name" autocreate_auto_join_rooms="false" auto_join_rooms_for_guests="true" password_enabled="true" @@ -122,6 +122,7 @@ ynh_app_setting_set --app=$app --key=element_ynh_url --value=$element_ynh_url ynh_app_setting_set --app=$app --key=allow_public_rooms_without_auth --value=$allow_public_rooms_without_auth ynh_app_setting_set --app=$app --key=allow_public_rooms_over_federation --value=$allow_public_rooms_over_federation ynh_app_setting_set --app=$app --key=disable_msisdn_registration --value=$disable_msisdn_registration +ynh_app_setting_set --app=$app --key=registrations_require_3pid --value=$registrations_require_3pid ynh_app_setting_set --app=$app --key=allowed_local_3pids --value=$allowed_local_3pids ynh_app_setting_set --app=$app --key=allow_guest_access --value=$allow_guest_access ynh_app_setting_set --app=$app --key=default_identity_server --value=$default_identity_server diff --git a/scripts/upgrade b/scripts/upgrade index 8333d150..f22085eb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -64,6 +64,7 @@ element_ynh_url=$(ynh_app_setting_get --app=$app --key=element_ynh_url) allow_public_rooms_without_auth=$(ynh_app_setting_get --app=$app --key=allow_public_rooms_without_auth) allow_public_rooms_over_federation=$(ynh_app_setting_get --app=$app --key=allow_public_rooms_over_federation) disable_msisdn_registration=$(ynh_app_setting_get --app=$app --key=disable_msisdn_registration) +registrations_require_3pid=$(ynh_app_setting_get --app=$app --key=registrations_require_3pid) allowed_local_3pids=$(ynh_app_setting_get --app=$app --key=allowed_local_3pids) allow_guest_access=$(ynh_app_setting_get --app=$app --key=allow_guest_access) default_identity_server=$(ynh_app_setting_get --app=$app --key=default_identity_server) @@ -216,9 +217,14 @@ then disable_msisdn_registration="true" ynh_app_setting_set --app=$app --key=disable_msisdn_registration --value=$disable_msisdn_registration fi +if [ -z "$registrations_require_3pid" ] +then + registrations_require_3pid="email" + ynh_app_setting_set --app=$app --key=registrations_require_3pid --value=$registrations_require_3pid +fi if [ -z "$allowed_local_3pids" ] then - allowed_local_3pids="" + allowed_local_3pids="'^[^@]+@""matrix""\.org$'" ynh_app_setting_set --app=$app --key=allowed_local_3pids --value=$allowed_local_3pids fi if [ -z "$allow_guest_access" ] @@ -233,7 +239,7 @@ then fi if [ -z "$auto_join_rooms" ] then - auto_join_rooms=' - "#auto_join_room:'+$server_name+'"' + auto_join_rooms="#auto_join_room:""$server_name" ynh_app_setting_set --app=$app --key=auto_join_rooms --value=$auto_join_rooms fi if [ -z "$autocreate_auto_join_rooms" ] From eb51ba4e8b3f3634ec0107d3c11b6f47cd1b1ab8 Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Tue, 10 Jan 2023 15:26:29 +0100 Subject: [PATCH 13/95] correct init e2e_default --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index c751e2de..b2bce6fd 100644 --- a/scripts/install +++ b/scripts/install @@ -33,7 +33,7 @@ synapse_db_user="matrix_$app" synapse_db_name="matrix_$app" upstream_version=$(ynh_app_upstream_version) report_stats="false" -e2e_enabled_by_default="true" +e2e_enabled_by_default="off" default_domain_value="Same than the domain" domain_whitelist_client=$(get_domain_list) diff --git a/scripts/upgrade b/scripts/upgrade index f22085eb..7adbc2c4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -137,7 +137,7 @@ fi # Define $e2e_enabled_by_default if not already defined if [ -z $e2e_enabled_by_default ]; then - e2e_enabled_by_default='true' + e2e_enabled_by_default="off" ynh_app_setting_set --app=$app --key=e2e_enabled_by_default --value=$e2e_enabled_by_default fi From e8ddae15d85b3d023a08346b95d138380a6ec1bc Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Tue, 10 Jan 2023 16:36:46 +0100 Subject: [PATCH 14/95] e2e_enabled_by_default [all,invite,off] --- scripts/upgrade | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 7adbc2c4..677df5ce 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -136,7 +136,15 @@ if [ -z $jitsi_server ]; then fi # Define $e2e_enabled_by_default if not already defined -if [ -z $e2e_enabled_by_default ]; then +if [-z $e2e_enabled_by_default] ; then + e2e_enabled_by_default="invite" + ynh_app_setting_set --app=$app --key=e2e_enabled_by_default --value=$e2e_enabled_by_default +fi +if [$e2e_enabled_by_default=="true"] ; then + e2e_enabled_by_default="all" + ynh_app_setting_set --app=$app --key=e2e_enabled_by_default --value=$e2e_enabled_by_default +fi +if [$e2e_enabled_by_default=="false"]; then e2e_enabled_by_default="off" ynh_app_setting_set --app=$app --key=e2e_enabled_by_default --value=$e2e_enabled_by_default fi From 2462d89af16bf8ca78839ca927449b85f38decae Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Tue, 10 Jan 2023 18:22:38 +0100 Subject: [PATCH 15/95] disable password if registration disabled --- scripts/install | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index b2bce6fd..ba696274 100644 --- a/scripts/install +++ b/scripts/install @@ -77,12 +77,10 @@ ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url -ynh_app_setting_set --app=$app --key=no_sso --value true ynh_app_setting_set --app=$app --key=server_name --value=$server_name ynh_app_setting_set --app=$app --key=jitsi_server --value=$jitsi_server ynh_app_setting_set --app=$app --key=final_path --value=$final_path ynh_app_setting_set --app=$app --key=synapse_version --value=$upstream_version -ynh_app_setting_set --app=$app --key=is_free_registration --value=$is_free_registration ynh_app_setting_set --app=$app --key=report_stats --value=$report_stats ynh_app_setting_set --app=$app --key=e2e_enabled_by_default --value=$e2e_enabled_by_default ynh_app_setting_set --app=$app --key=synapse_user_app_pwd --value=$synapse_user_app_pwd @@ -315,13 +313,22 @@ macaroon_secret_key_param='macaroon_secret_key: "'$macaroon_secret_key'"' if [ $is_free_registration -eq 0 ] then - allowed_access=False + allow_registration=False + turn_allow_guests=False sso_enabled=True + password_enabled=False else - allowed_access=True + allow_registration=True + turn_allow_guests=True sso_enabled=False + password_enabled=True fi +ynh_app_setting_set --app=$app --key=allow_registration --value=$allow_registration +ynh_app_setting_set --app=$app --key=turn_allow_guests --value=$turn_allow_guests +ynh_app_setting_set --app=$app --key=sso_enabled --value=$sso_enabled +ynh_app_setting_set --app=$app --key=password_enabled --value=$password_enabled + ynh_add_config --template="homeserver.yaml" --destination="/etc/matrix-$app/homeserver.yaml" ynh_add_config --template="log.yaml" --destination="/etc/matrix-$app/log.yaml" From b28486fcd585352744a6b5dfe7af417bce7b5ae8 Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Wed, 11 Jan 2023 12:29:02 +0100 Subject: [PATCH 16/95] correst string compare syntax --- scripts/upgrade | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 677df5ce..c34c3bb9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -136,15 +136,17 @@ if [ -z $jitsi_server ]; then fi # Define $e2e_enabled_by_default if not already defined -if [-z $e2e_enabled_by_default] ; then +if [ -z $e2e_enabled_by_default ] ; then e2e_enabled_by_default="invite" ynh_app_setting_set --app=$app --key=e2e_enabled_by_default --value=$e2e_enabled_by_default fi -if [$e2e_enabled_by_default=="true"] ; then + +if [ "$e2e_enabled_by_default" = "true" ] ; then e2e_enabled_by_default="all" ynh_app_setting_set --app=$app --key=e2e_enabled_by_default --value=$e2e_enabled_by_default fi -if [$e2e_enabled_by_default=="false"]; then + +if [ "$e2e_enabled_by_default" = "false" ]; then e2e_enabled_by_default="off" ynh_app_setting_set --app=$app --key=e2e_enabled_by_default --value=$e2e_enabled_by_default fi From 56ad01bdb9a1af879cd03acb5c66e6aceae54730 Mon Sep 17 00:00:00 2001 From: gredin67 Date: Wed, 11 Jan 2023 14:03:52 +0100 Subject: [PATCH 17/95] client urls --- conf/homeserver.yaml | 6 +- config_panel.toml | 160 +++++++++++++++++++++++-------------------- scripts/install | 8 ++- scripts/upgrade | 13 +++- 4 files changed, 105 insertions(+), 82 deletions(-) diff --git a/conf/homeserver.yaml b/conf/homeserver.yaml index bcbff093..e5678ce0 100644 --- a/conf/homeserver.yaml +++ b/conf/homeserver.yaml @@ -50,7 +50,7 @@ pid_file: /run/matrix-__APP__/homeserver.pid # The absolute URL to the web client which / will redirect to. # -web_client_location: __ELEMENT_YNH_URL__ +web_client_location: __WEB_CLIENT_LOCATION__ # The public-facing base URL that clients use to access this Homeserver (not # including _matrix/...). This is the same URL a user might enter into the @@ -2320,7 +2320,7 @@ email: # (This setting used to be called riot_base_url; the old name is still # supported for backwards-compatibility but is now deprecated.) # - client_base_url: __ELEMENT_YNH_URL__ + client_base_url: __CLIENT_BASE_URL__ # Configure the time that a validation email will expire after sending. # Defaults to 1h. @@ -2331,7 +2331,7 @@ email: # to the identity server as the org.matrix.web_client_location key. Defaults # to unset, giving no guidance to the identity server. # - invite_client_location: __ELEMENT_YNH_URL__ + invite_client_location: __INVITE_CLIENT_LOCATION__ # Subjects to use when sending emails from Synapse. # diff --git a/config_panel.toml b/config_panel.toml index f8172438..1cee14be 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -1,12 +1,19 @@ version = "1.0" [homeserver] -name = "Synapse Homeserver" +name = "Homeserver Privacy" services = ["__APP__"] [homeserver.config] name = "Configuration Options" + [homeserver.config.backup_before_upgrade] + ask = "Backup before upgrade" + type = "boolean" + yes = true + no = false + help = "Set to 'true' to back up before each upgrade." + [homeserver.config.server_statistics] ask = "Server statistics" type = "boolean" @@ -15,10 +22,39 @@ services = ["__APP__"] help = "Set to 'true' to send anonymous statistics to Synapse to improve performance." bind = "report_stats:/etc/matrix-__APP__/homeserver.yaml" - [homeserver.registration] - name = "Homeserver Registration" + [homeserver.privacy] + name = "Data Privacy" + + [homeserver.privacy.default_identity_server] + ask = "Identity server suggested to clients." + type = "url" + help = "By default, no suggestion is made, so it is left up to the client." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + + [homeserver.privacy.allow_public_rooms_without_auth] + 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." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + + [homeserver.privacy.allow_public_rooms_over_federation] + 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." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + +[account] +name = "Registration" +services = ["__APP__"] - [homeserver.registration.turn_allow_guests] + [account.registration] + name = "Account Registration" + + [account.registration.turn_allow_guests] ask = "Should guests be allowed to use the TURN server?" type = "boolean" yes = true @@ -26,7 +62,7 @@ services = ["__APP__"] help = "This defaults to True, otherwise VoIP will be unreliable for guests. However, it does introduce a slight security risk as it allows users to connect to arbitrary endpoints without having first signed up for a valid account (e.g. by passing a CAPTCHA)." bind = ":/etc/matrix-__APP__/homeserver.yaml" - [homeserver.registration.enable_registration] + [account.registration.enable_registration] ask = "Enable Registration for new users." type = "boolean" yes = true @@ -34,13 +70,13 @@ services = ["__APP__"] help = "Defaults to 'false'. If 'true', it is highly recommended to use either captcha, email, or token-based verification to avoid SPAM." bind = ":/etc/matrix-__APP__/homeserver.yaml" - [homeserver.registration.registrations_require_3pid] + [account.registration.registrations_require_3pid] ask = "Register only with all below types of 3PID." type = "string" help = "Defaults to: '- email'. Phone number: '- msisdn'" bind = ":/etc/matrix-__APP__/homeserver.yaml" - [homeserver.registration.disable_msisdn_registration] + [account.registration.disable_msisdn_registration] ask = "Disable asking Phone Number in Registration flow." type = "boolean" yes = true @@ -48,7 +84,7 @@ services = ["__APP__"] help = "Overrides above setting if MSISDNs are set as required." bind = ":/etc/matrix-__APP__/homeserver.yaml" - [homeserver.registration.allowed_local_3pids] + [account.registration.allowed_local_3pids] ask = "Register only with given formats of 3PIDs." type = "string" help = ''' @@ -59,13 +95,13 @@ services = ["__APP__"] pattern: '\+33' ''' - [homeserver.registration.registration_shared_secret] + [account.registration.registration_shared_secret] ask = "Shared Secret for Registration." type = "string" help = "Allows registration of standard or admin accounts, even if Registration disabled." bind = ":/etc/matrix-__APP__/homeserver.yaml" - [homeserver.registration.allow_guest_access] + [account.registration.allow_guest_access] ask = "Allow Users to Register as Guests?" type = "boolean" yes = true @@ -73,34 +109,49 @@ services = ["__APP__"] help = "Guests can participate on this server in rooms with guest access enabled, without a password/email/etc." bind = ":/etc/matrix-__APP__/homeserver.yaml" - [homeserver.privacy] - name = "Data Privacy" +[client] +name = "Matrix Client" +services = ["__APP__"] - [homeserver.privacy.default_identity_server] - ask = "Identity server suggested to clients." - type = "string" - help = "By default, no suggestion is made, so it is left up to the client." - bind = ":/etc/matrix-__APP__/homeserver.yaml" + [client.experience] + name = "User Experience" - [homeserver.privacy.allow_public_rooms_without_auth] - 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." - bind = ":/etc/matrix-__APP__/homeserver.yaml" + [client.experience.web_client_location] + ask = "URL to the web client which / will redirect to." + type = "url" + help = "Basically Element instance the server should redirect to." + bind = "web_client_location:/etc/matrix-__APP__/homeserver.yaml" - [homeserver.privacy.allow_public_rooms_over_federation] - 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." - bind = ":/etc/matrix-__APP__/homeserver.yaml" + [client.experience.client_base_url] + ask = "URL for client links within the email notifications." + type = "url" + help = "Used to be called 'riot_base_url', still supported" + bind = "client_base_url:/etc/matrix-__APP__/homeserver.yaml" -[client] -name = "Matrix Client" -services = ["__APP__"] + [client.experience.invite_client_location] + ask = "Web client location to direct users to during an invite." + type = "url" + help = "This is passed to the identity server as the org.matrix.web_client_location key. Defaults to unset, giving no guidance to the identity server." + bind = "invite_client_location:/etc/matrix-__APP__/homeserver.yaml" + + [client.experience.enable_group_creation] + ask = "Allow non-server-admin Users to create Spaces?" + type = "boolean" + yes = true + no = false + help = "Defaults to 'false'." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + + [client.experience.e2e_enabled_by_default] + ask = "End-to-End Encryption by default for locally-created Rooms" + type = "select" + choices = ["all", "invite", "off"] + help = ''' + * "all": any locally-created room + * "invite": any room created with the "private_chat" or "trusted_private_chat" room creation presets + * "off": this option will take no effect + ''' + bind = "encryption_enabled_by_default_for_room_type:/etc/matrix-__APP__/homeserver.yaml" [client.welcome] name = "Welcome User Experience" @@ -150,44 +201,3 @@ services = ["__APP__"] no = false help = "Defaults to 'true'." bind = ":/etc/matrix-__APP__/homeserver.yaml" - - [client.experience] - name = "User Experience" - - [client.experience.element_ynh_url] - ask = "URL of the Default Element Instance." - type = "string" - default = '#example:example.com' - help = "URL for web client links within the email notifications (client_base_url) AND to direct users to during an invite (invite_client_location) AND to which / will redirect to (web_client_location)" - bind = "client_base_url:/etc/matrix-__APP__/homeserver.yaml" - bind = "invite_client_location:/etc/matrix-__APP__/homeserver.yaml" - bind = "web_client_location:/etc/matrix-__APP__/homeserver.yaml" - - [client.experience.enable_group_creation] - ask = "Allow non-server-admin Users to create Spaces?" - type = "boolean" - yes = true - no = false - help = "Defaults to 'false'." - bind = ":/etc/matrix-__APP__/homeserver.yaml" - - [client.experience.e2e_enabled_by_default] - ask = "End-to-End Encryption by default for locally-created Rooms" - type = "select" - choices = ["all", "invite", "off"] - help = ''' - * "all": any locally-created room - * "invite": any room created with the "private_chat" or "trusted_private_chat" room creation presets - * "off": this option will take no effect - ''' - bind = "encryption_enabled_by_default_for_room_type:/etc/matrix-__APP__/homeserver.yaml" - - [client.package_config] - name = "Package configuration" - - [client.package_config.backup_before_upgrade] - ask = "Backup before upgrade" - type = "boolean" - yes = true - no = false - help = "Set to 'true' to back up before each upgrade." diff --git a/scripts/install b/scripts/install index ba696274..298c78b8 100644 --- a/scripts/install +++ b/scripts/install @@ -100,6 +100,10 @@ element_ynh_url="https://"+element_domain+element_path # element_ynh_url="https://matrix.to/" fi +web_client_location=$element_ynh_url +client_base_url=$element_ynh_url +invite_client_location=$element_ynh_url + allow_public_rooms_without_auth="false" allow_public_rooms_over_federation="false" disable_msisdn_registration="true" @@ -116,7 +120,9 @@ enable_notifs="true" notif_for_new_users="true" enable_group_creation="true" -ynh_app_setting_set --app=$app --key=element_ynh_url --value=$element_ynh_url +ynh_app_setting_set --app=$app --key=web_client_location --value=$web_client_location +ynh_app_setting_set --app=$app --key=client_base_url --value=$client_base_url +ynh_app_setting_set --app=$app --key=invite_client_location --value=$invite_client_location ynh_app_setting_set --app=$app --key=allow_public_rooms_without_auth --value=$allow_public_rooms_without_auth ynh_app_setting_set --app=$app --key=allow_public_rooms_over_federation --value=$allow_public_rooms_over_federation ynh_app_setting_set --app=$app --key=disable_msisdn_registration --value=$disable_msisdn_registration diff --git a/scripts/upgrade b/scripts/upgrade index c34c3bb9..a956306d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -60,7 +60,9 @@ data_path="/home/yunohost.app/matrix-$app" #================================================= # GET CONFIG PANEL SETTINGS #================================================= -element_ynh_url=$(ynh_app_setting_get --app=$app --key=element_ynh_url) +web_client_location=$(ynh_app_setting_get --app=$app --key=web_client_location) +client_base_url=$(ynh_app_setting_get --app=$app --key=client_base_url) +invite_client_location=$(ynh_app_setting_get --app=$app --key=invite_client_location) allow_public_rooms_without_auth=$(ynh_app_setting_get --app=$app --key=allow_public_rooms_without_auth) allow_public_rooms_over_federation=$(ynh_app_setting_get --app=$app --key=allow_public_rooms_over_federation) disable_msisdn_registration=$(ynh_app_setting_get --app=$app --key=disable_msisdn_registration) @@ -198,7 +200,7 @@ fi # Get app name of first Element Instance -if [ -z "$element_ynh_url" ] +if [ -z "$web_client_location" ] then element_ynh_url="https://matrix.to/" element_instance="element" @@ -209,8 +211,13 @@ then #else element_ynh_url="https://"+element_domain+element_path fi + web_client_location=$element_ynh_url + client_base_url=$element_ynh_url + invite_client_location=$element_ynh_url fi -ynh_app_setting_set --app=$app --key=element_ynh_url --value=$element_ynh_url +ynh_app_setting_set --app=$app --key=web_client_location --value=$web_client_location +ynh_app_setting_set --app=$app --key=client_base_url --value=$client_base_url +ynh_app_setting_set --app=$app --key=invite_client_location --value=$invite_client_location if [ -z "$allow_public_rooms_without_auth" ] then From 7ada89775130debfd33fdcbb8400e682689b2f64 Mon Sep 17 00:00:00 2001 From: gredin67 Date: Wed, 11 Jan 2023 14:53:53 +0100 Subject: [PATCH 18/95] init allow_regis at upgrade --- scripts/upgrade | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index a956306d..231adad2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -78,6 +78,11 @@ enable_notifs=$(ynh_app_setting_get --app=$app --key=enable_notifs) notif_for_new_users=$(ynh_app_setting_get --app=$app --key=notif_for_new_users) enable_group_creation=$(ynh_app_setting_get --app=$app --key=enable_group_creation) +allow_registration=$(ynh_app_setting_get --app=$app --key=allow_registration) +turn_allow_guests=$(ynh_app_setting_get --app=$app --key=turn_allow_guests) +sso_enabled=$(ynh_app_setting_get --app=$app --key=sso_enabled) +password_enabled=$(ynh_app_setting_get --app=$app --key=password_enabled) + #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= @@ -160,7 +165,6 @@ fi if [ -z $is_free_registration ]; then is_free_registration=$(ynh_app_setting_get --app=$app --key=is_""public) - ynh_app_setting_set --app=$app --key=is_free_registration --value=$is_free_registration fi if [ -z $synapse_user_app_pwd ]; then @@ -290,6 +294,25 @@ then ynh_app_setting_set --app=$app --key=enable_group_creation --value=$enable_group_creation fi +if [ -z "$allow_registration" ] ; then + if [ $is_free_registration -eq 0 ] + then + allow_registration=False + turn_allow_guests=False + sso_enabled=True + password_enabled=False + else + allow_registration=True + turn_allow_guests=True + sso_enabled=False + password_enabled=True + fi + ynh_app_setting_set --app=$app --key=allow_registration --value=$allow_registration + ynh_app_setting_set --app=$app --key=turn_allow_guests --value=$turn_allow_guests + ynh_app_setting_set --app=$app --key=sso_enabled --value=$sso_enabled + ynh_app_setting_set --app=$app --key=password_enabled --value=$password_enabled +fi + #================================================= # INSTALL DEPENDENCIES #================================================= From 2cabc7037839fe682b854b596364f15c30387ad7 Mon Sep 17 00:00:00 2001 From: gredin67 Date: Wed, 11 Jan 2023 15:02:48 +0100 Subject: [PATCH 19/95] erase custom config panel --- scripts/config | 145 +------------------------------------------------ 1 file changed, 1 insertion(+), 144 deletions(-) diff --git a/scripts/config b/scripts/config index ec3f6469..d244e21e 100644 --- a/scripts/config +++ b/scripts/config @@ -11,153 +11,10 @@ source /usr/share/yunohost/helpers # Stop script if errors ynh_abort_if_errors -# Import common fonctions -source ./experimental_helper.sh -source ./_common.sh - -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -app=$YNH_APP_INSTANCE_NAME -report_stats=$(ynh_app_setting_get --app $app --key report_stats) -allow_public_rooms=$(ynh_app_setting_get --app=$app --key=allow_public_rooms) -disable_backup_before_upgrade=$(ynh_app_setting_get --app $app --key disable_backup_before_upgrade) -is_free_registration=$(ynh_app_setting_get --app $app --key is_free_registration) -jitsi_server=$(ynh_app_setting_get --app=$app --key=jitsi_server) -e2e_enabled_by_default=$(ynh_app_setting_get --app=$app --key=e2e_enabled_by_default) -synapse_user_app_pwd=$(ynh_app_setting_get --app=$app --key=synapse_user_app_pwd) -domain_whitelist_client=$(get_domain_list) -main_domain=$(yunohost domain list --output-as json | jq -r .main) - -#================================================= -# SHOW_CONFIG FUNCTION FOR 'SHOW' COMMAND -#================================================= - -show_config() { - # here you are supposed to read some config file/database/other then print the values - # ynh_return "YNH_CONFIG_${PANEL_ID}_${SECTION_ID}_${OPTION_ID}=value" - ynh_return "YNH_CONFIG_SYNAPSE_CONFIG_SERVER_CONFIG_SERVER_STATISTICS=$report_stats" - ynh_return "YNH_CONFIG_SYNAPSE_CONFIG_SERVER_CONFIG_ALLOW_PUBLIC_ROOMS=$allow_public_rooms" - ynh_return "YNH_CONFIG_SYNAPSE_CONFIG_CLIENT_CONFIG_JITSI_SERVER=$jitsi_server" - ynh_return "YNH_CONFIG_SYNAPSE_CONFIG_SERVER_CONFIG_IS_FREE_REGISTRATION=${is_free_registration}" - ynh_return "YNH_CONFIG_SYNAPSE_CONFIG_CLIENT_CONFIG_E2E_ENABLED_BY_DEFAULT=${e2e_enabled_by_default}" - - if [[ ${disable_backup_before_upgrade:-0} -eq 1 ]] - then - ynh_return "YNH_CONFIG_PACKAGE_CONFIG_PACKAGE_CONFIG_BACKUP_BEFORE_UPGRADE=0" - else - ynh_return "YNH_CONFIG_PACKAGE_CONFIG_PACKAGE_CONFIG_BACKUP_BEFORE_UPGRADE=1" - fi -} - -#================================================= -# MODIFY THE CONFIGURATION -#================================================= - -apply_config() { - report_stats=${YNH_CONFIG_SYNAPSE_CONFIG_SERVER_CONFIG_SERVER_STATISTICS:-$report_stats} - allow_public_rooms=${YNH_CONFIG_SYNAPSE_CONFIG_SERVER_CONFIG_ALLOW_PUBLIC_ROOMS:-$allow_public_rooms} - do_backup_before_upgrade=${YNH_CONFIG_PACKAGE_CONFIG_PACKAGE_CONFIG_BACKUP_BEFORE_UPGRADE:-} - is_free_registration=${YNH_CONFIG_SYNAPSE_CONFIG_SERVER_CONFIG_IS_FREE_REGISTRATION:-$is_free_registration} - jitsi_server=${YNH_CONFIG_SYNAPSE_CONFIG_CLIENT_CONFIG_JITSI_SERVER:-$jitsi_server} - e2e_enabled_by_default=${YNH_CONFIG_SYNAPSE_CONFIG_CLIENT_CONFIG_E2E_ENABLED_BY_DEFAULT:-$e2e_enabled_by_default} - - 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 - if [ $e2e_enabled_by_default == 1 ]; then - e2e_enabled_by_default=true - fi - if [ $e2e_enabled_by_default == 0 ]; then - e2e_enabled_by_default=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_free_registration --value $is_free_registration - ynh_app_setting_set --app $app --key jitsi_server --value $jitsi_server - ynh_app_setting_set --app=$app --key=e2e_enabled_by_default --value=$e2e_enabled_by_default - - if [[ -n $do_backup_before_upgrade ]]; then - if [ $do_backup_before_upgrade -eq 1 ]; then - ynh_app_setting_set --app $app --key disable_backup_before_upgrade --value 0 - else - ynh_app_setting_set --app $app --key disable_backup_before_upgrade --value 1 - fi - fi - - domain=$(ynh_app_setting_get --app $app --key domain) - server_name=$(ynh_app_setting_get --app $app --key server_name) - synapse_db_pwd=$(ynh_app_setting_get --app $app --key synapse_db_pwd) - is_free_registration=$(ynh_app_setting_get --app $app --key is_free_registration) - port=$(ynh_app_setting_get --app $app --key synapse_port) - synapse_tls_port=$(ynh_app_setting_get --app $app --key synapse_tls_port) - turnserver_tls_port=$(ynh_app_setting_get --app $app --key turnserver_tls_port) - turnserver_pwd=$(ynh_app_setting_get --app $app --key turnserver_pwd) - registration_shared_secret=$(ynh_app_setting_get --app $app --key registration_shared_secret) - form_secret=$(ynh_app_setting_get --app $app --key form_secret) - macaroon_secret_key=$(ynh_app_setting_get --app=$app --key=macaroon_secret_key) - - synapse_user="matrix-$app" - synapse_db_name="matrix_$app" - synapse_db_user="matrix_$app" - - # Configure Synapse - - # WARNING : theses command are used in INSTALL, UPGRADE, CONFIG, CHANGE-URL (4 times) - # For any update do it in all files - - if [ -z $macaroon_secret_key ]; then - # Well, in this package this value was not managed because it was not needed, synapse is able to generate this with some other secret in the config file but after some vulnerability was found with this practice. - # For more detail about this issue you can see : https://matrix.org/blog/2019/01/15/further-details-on-critical-security-update-in-synapse-affecting-all-versions-prior-to-0-34-1-cve-2019-5885/ - # The problem is that we can't just say generate a new value if the package has not already defined a value. The reason is that changing this value logout all user. And in case of a user has enabled the encryption, the user might lost all conversation !! - # So for the old install we just leave this as it is. And for the new install we use a real macaroon. - macaroon_secret_key_param='# macaroon_secret_key: ""' - else - macaroon_secret_key_param='macaroon_secret_key: "'$macaroon_secret_key'"' - fi - - if [ $is_free_registration -eq 0 ] - then - allowed_access=False - sso_enabled=True - else - allowed_access=True - sso_enabled=False - fi - - ynh_add_config --template="homeserver.yaml" --destination="/etc/matrix-$app/homeserver.yaml" - ynh_add_config --template="log.yaml" --destination="/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 - ynh_add_config --template="server_name.conf" --destination="/etc/nginx/conf.d/${server_name}.d/${app}_server_name.conf" - fi - - ynh_store_file_checksum --file "$homeserver_config_path" - setfacl -R -m user:turnserver:rX /etc/matrix-$app - - systemctl restart matrix-$app - systemctl reload nginx -} #================================================= # GENERIC FINALIZATION #================================================= # SELECT THE ACTION FOLLOWING THE GIVEN ARGUMENT #================================================= -case $1 in - show) show_config;; - apply) apply_config;; -esac +ynh_app_config_run $1 From 3ced5e2a7cea1fb63533638052e5bfb2509babf1 Mon Sep 17 00:00:00 2001 From: gredin67 Date: Wed, 11 Jan 2023 17:11:43 +0100 Subject: [PATCH 20/95] clean config init --- conf/homeserver.yaml | 4 ++-- config_panel.toml | 2 +- doc/DISCLAIMER.md | 6 ++--- scripts/install | 40 +++++++++++++++++--------------- scripts/upgrade | 55 ++++++++++++++++++++++---------------------- 5 files changed, 56 insertions(+), 51 deletions(-) diff --git a/conf/homeserver.yaml b/conf/homeserver.yaml index e5678ce0..6043900d 100644 --- a/conf/homeserver.yaml +++ b/conf/homeserver.yaml @@ -1200,7 +1200,7 @@ turn_user_lifetime: 1h # connect to arbitrary endpoints without having first signed up for a # valid account (e.g. by passing a CAPTCHA). # -turn_allow_guests: __ALLOWED_ACCESS__ +turn_allow_guests: __TURN_ALLOW_GUESTS__ ## Registration ## @@ -1212,7 +1212,7 @@ turn_allow_guests: __ALLOWED_ACCESS__ # you use either captcha, email, or token-based verification to verify that new users are not bots. In order to enable registration # without any verification, you must also set `enable_registration_without_verification`, found below. # -enable_registration: __ALLOWED_ACCESS__ +enable_registration: __ENABLE_REGISTRATION__ # Enable registration without email or captcha verification. Note: this option is *not* recommended, # as registration without verification is a known vector for spam and abuse. Defaults to false. Has no effect diff --git a/config_panel.toml b/config_panel.toml index 1cee14be..f3e724ff 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -12,7 +12,7 @@ services = ["__APP__"] type = "boolean" yes = true no = false - help = "Set to 'true' to back up before each upgrade." + help = "Set to 'true' to backup the Synapse YunoHost App before each upgrade." [homeserver.config.server_statistics] ask = "Server statistics" diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index 62381c90..b4129f07 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -134,11 +134,11 @@ Then, to log in the API with your credentials, you need to set your user as admi ### Upgrade -By default a backup is made before the upgrade. To avoid this you have theses following possibilites: +By default a backup is made before the upgrade. If for some reason you want to upgrade without backup: - Call the command with the `-b` flag: `yunohost app upgrade synapse -b` -- Set the settings `disable_backup_before_upgrade` to `1`. You can set this with this command: +- Disable the setting `Backup before upgrade` in the Config Panel. Or with command line: -`yunohost app setting synapse disable_backup_before_upgrade -v 1` +`yunohost app setting synapse backup_before_upgrade -v 0` After this settings will be applied for **all** next upgrade. diff --git a/scripts/install b/scripts/install index 298c78b8..b224b16b 100644 --- a/scripts/install +++ b/scripts/install @@ -85,6 +85,24 @@ ynh_app_setting_set --app=$app --key=report_stats --value=$report_stats ynh_app_setting_set --app=$app --key=e2e_enabled_by_default --value=$e2e_enabled_by_default ynh_app_setting_set --app=$app --key=synapse_user_app_pwd --value=$synapse_user_app_pwd +if [ $is_free_registration -eq 0 ] +then + enable_registration="false" + turn_allow_guests="false" + sso_enabled="true" + password_enabled="false" +else + enable_registration="true" + turn_allow_guests="true" + sso_enabled="false" + password_enabled="true" +fi + +ynh_app_setting_set --app=$app --key=enable_registration --value=$enable_registration +ynh_app_setting_set --app=$app --key=turn_allow_guests --value=$turn_allow_guests +ynh_app_setting_set --app=$app --key=sso_enabled --value=$sso_enabled +ynh_app_setting_set --app=$app --key=password_enabled --value=$password_enabled + #================================================= ## SET STANDARD SETTINGS FROM DEFAULT CONFIG #================================================= @@ -104,6 +122,8 @@ web_client_location=$element_ynh_url client_base_url=$element_ynh_url invite_client_location=$element_ynh_url +backup_before_upgrade="true" +server_statistics="false" allow_public_rooms_without_auth="false" allow_public_rooms_over_federation="false" disable_msisdn_registration="true" @@ -120,6 +140,8 @@ enable_notifs="true" notif_for_new_users="true" enable_group_creation="true" +ynh_app_setting_set --app=$app --key=backup_before_upgrade --value=$backup_before_upgrade +ynh_app_setting_set --app=$app --key=server_statistics --value=$server_statistics ynh_app_setting_set --app=$app --key=web_client_location --value=$web_client_location ynh_app_setting_set --app=$app --key=client_base_url --value=$client_base_url ynh_app_setting_set --app=$app --key=invite_client_location --value=$invite_client_location @@ -317,24 +339,6 @@ ynh_app_setting_set --app=$app --key=turnserver_pwd --value=$turnserver_pwd macaroon_secret_key_param='macaroon_secret_key: "'$macaroon_secret_key'"' -if [ $is_free_registration -eq 0 ] -then - allow_registration=False - turn_allow_guests=False - sso_enabled=True - password_enabled=False -else - allow_registration=True - turn_allow_guests=True - sso_enabled=False - password_enabled=True -fi - -ynh_app_setting_set --app=$app --key=allow_registration --value=$allow_registration -ynh_app_setting_set --app=$app --key=turn_allow_guests --value=$turn_allow_guests -ynh_app_setting_set --app=$app --key=sso_enabled --value=$sso_enabled -ynh_app_setting_set --app=$app --key=password_enabled --value=$password_enabled - ynh_add_config --template="homeserver.yaml" --destination="/etc/matrix-$app/homeserver.yaml" ynh_add_config --template="log.yaml" --destination="/etc/matrix-$app/log.yaml" diff --git a/scripts/upgrade b/scripts/upgrade index 231adad2..2bca6ccc 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -60,6 +60,8 @@ data_path="/home/yunohost.app/matrix-$app" #================================================= # GET CONFIG PANEL SETTINGS #================================================= + +server_statistics=$(ynh_app_setting_get --app=$app --key=server_statistics) web_client_location=$(ynh_app_setting_get --app=$app --key=web_client_location) client_base_url=$(ynh_app_setting_get --app=$app --key=client_base_url) invite_client_location=$(ynh_app_setting_get --app=$app --key=invite_client_location) @@ -73,12 +75,11 @@ default_identity_server=$(ynh_app_setting_get --app=$app --key=default_identity_ auto_join_rooms=$(ynh_app_setting_get --app=$app --key=auto_join_rooms) autocreate_auto_join_rooms=$(ynh_app_setting_get --app=$app --key=autocreate_auto_join_rooms) auto_join_rooms_for_guests=$(ynh_app_setting_get --app=$app --key=auto_join_rooms_for_guests) -password_enabled=$(ynh_app_setting_get --app=$app --key=password_enabled) enable_notifs=$(ynh_app_setting_get --app=$app --key=enable_notifs) notif_for_new_users=$(ynh_app_setting_get --app=$app --key=notif_for_new_users) enable_group_creation=$(ynh_app_setting_get --app=$app --key=enable_group_creation) -allow_registration=$(ynh_app_setting_get --app=$app --key=allow_registration) +enable_registration=$(ynh_app_setting_get --app=$app --key=enable_registration) turn_allow_guests=$(ynh_app_setting_get --app=$app --key=turn_allow_guests) sso_enabled=$(ynh_app_setting_get --app=$app --key=sso_enabled) password_enabled=$(ynh_app_setting_get --app=$app --key=password_enabled) @@ -94,6 +95,15 @@ then ynh_die --message="Update from this synapse version is not available. You need to remove this package and reinstall the new package version." fi +#================================================= +# MIGRATION 7 : Working config panel v1 +#================================================= +backup_before_upgrade=$(ynh_app_setting_get --app=$app --key=backup_before_upgrade) +if [ -z "$backup_before_upgrade" ] ; then + if [ $(ynh_app_setting_get --app=$app --key=disable_backup_before_upgrade) ] ; then + backup_before_upgrade="false" +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -103,7 +113,7 @@ ynh_script_progression --message="Backing up the app before upgrading (may take ynh_systemd_action --service_name=matrix-$app.service --action=stop # Backup the current version of the app -if [ "0$(ynh_app_setting_get --app=$app --key=disable_backup_before_upgrade)" -ne 1 ] +if [ backup_before_upgrade ] then ynh_backup_before_upgrade ynh_clean_setup () { @@ -223,6 +233,11 @@ ynh_app_setting_set --app=$app --key=web_client_location --value=$web_client_loc ynh_app_setting_set --app=$app --key=client_base_url --value=$client_base_url ynh_app_setting_set --app=$app --key=invite_client_location --value=$invite_client_location +if [ -z "$server_statistics" ] +then + server_statistics="false" + ynh_app_setting_set --app=$app --key=server_statistics --value=$server_statistics +fi if [ -z "$allow_public_rooms_without_auth" ] then allow_public_rooms_without_auth=allow_public_rooms @@ -273,11 +288,6 @@ then auto_join_rooms_for_guests="true" ynh_app_setting_set --app=$app --key=auto_join_rooms_for_guests --value=$auto_join_rooms_for_guests fi -if [ -z "$password_enabled" ] -then - password_enabled="true" - ynh_app_setting_set --app=$app --key=password_enabled --value=$password_enabled -fi if [ -z "$enable_notifs" ] then enable_notifs="true" @@ -294,20 +304,20 @@ then ynh_app_setting_set --app=$app --key=enable_group_creation --value=$enable_group_creation fi -if [ -z "$allow_registration" ] ; then +if [ -z "$enable_registration" ] ; then if [ $is_free_registration -eq 0 ] then - allow_registration=False - turn_allow_guests=False - sso_enabled=True - password_enabled=False + enable_registration="false" + turn_allow_guests="false" + sso_enabled="true" + password_enabled="false" else - allow_registration=True - turn_allow_guests=True - sso_enabled=False - password_enabled=True + enable_registration="true" + turn_allow_guests="true" + sso_enabled="false" + password_enabled="true" fi - ynh_app_setting_set --app=$app --key=allow_registration --value=$allow_registration + ynh_app_setting_set --app=$app --key=enable_registration --value=$enable_registration ynh_app_setting_set --app=$app --key=turn_allow_guests --value=$turn_allow_guests ynh_app_setting_set --app=$app --key=sso_enabled --value=$sso_enabled ynh_app_setting_set --app=$app --key=password_enabled --value=$password_enabled @@ -391,15 +401,6 @@ else macaroon_secret_key_param='macaroon_secret_key: "'$macaroon_secret_key'"' fi -if [ $is_free_registration -eq 0 ] -then - allowed_access=False - sso_enabled=True -else - allowed_access=True - sso_enabled=False -fi - ynh_add_config --template="homeserver.yaml" --destination="/etc/matrix-$app/homeserver.yaml" ynh_add_config --template="log.yaml" --destination="/etc/matrix-$app/log.yaml" From e6a6fffef1aa6c7f21544ecc17e70cc977ac6f39 Mon Sep 17 00:00:00 2001 From: gredin67 Date: Wed, 11 Jan 2023 17:21:45 +0100 Subject: [PATCH 21/95] typo --- scripts/upgrade | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 2bca6ccc..6caeb709 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -100,7 +100,7 @@ fi #================================================= backup_before_upgrade=$(ynh_app_setting_get --app=$app --key=backup_before_upgrade) if [ -z "$backup_before_upgrade" ] ; then - if [ $(ynh_app_setting_get --app=$app --key=disable_backup_before_upgrade) ] ; then + if $(ynh_app_setting_get --app=$app --key=disable_backup_before_upgrade) ; then backup_before_upgrade="false" fi @@ -113,8 +113,7 @@ ynh_script_progression --message="Backing up the app before upgrading (may take ynh_systemd_action --service_name=matrix-$app.service --action=stop # Backup the current version of the app -if [ backup_before_upgrade ] -then +if $backup_before_upgrade ; then ynh_backup_before_upgrade ynh_clean_setup () { # Clean installation remainings that are not handled by the remove script. From fa02d4e9c06e9ea0183eb41febf6d83840e4b34f Mon Sep 17 00:00:00 2001 From: gredin67 Date: Wed, 11 Jan 2023 17:36:28 +0100 Subject: [PATCH 22/95] typo --- scripts/install | 10 +++++----- scripts/upgrade | 13 +++++++------ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/scripts/install b/scripts/install index b224b16b..ae183a76 100644 --- a/scripts/install +++ b/scripts/install @@ -111,11 +111,11 @@ element_ynh_url="https://matrix.to/" # Get app name of first Element Instance (can be changed later in Config Panel) element_instance="element" if yunohost --output-as plain app list | grep -q "^$element_instance$"; then -element_domain=$(ynh_app_setting_get --app $element_instance --key domain) -element_path=$(ynh_app_setting_get --app $element_instance --key path) -element_ynh_url="https://"+element_domain+element_path -#if [ -z "$element_domain" ]; then -# element_ynh_url="https://matrix.to/" + element_domain=$(ynh_app_setting_get --app $element_instance --key domain) + element_path=$(ynh_app_setting_get --app $element_instance --key path) + element_ynh_url="https://""$element_domain""$element_path" + #if [ -z "$element_domain" ]; then + # element_ynh_url="https://matrix.to/" fi web_client_location=$element_ynh_url diff --git a/scripts/upgrade b/scripts/upgrade index 6caeb709..bde9cc0d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -100,7 +100,7 @@ fi #================================================= backup_before_upgrade=$(ynh_app_setting_get --app=$app --key=backup_before_upgrade) if [ -z "$backup_before_upgrade" ] ; then - if $(ynh_app_setting_get --app=$app --key=disable_backup_before_upgrade) ; then + if [ $(ynh_app_setting_get --app=$app --key=disable_backup_before_upgrade) ] ; then backup_before_upgrade="false" fi @@ -113,7 +113,7 @@ ynh_script_progression --message="Backing up the app before upgrading (may take ynh_systemd_action --service_name=matrix-$app.service --action=stop # Backup the current version of the app -if $backup_before_upgrade ; then +if [ $backup_before_upgrade ] ; then ynh_backup_before_upgrade ynh_clean_setup () { # Clean installation remainings that are not handled by the remove script. @@ -212,17 +212,17 @@ fi # SET STANDARD SETTINGS FROM DEFAULT CONFIG # Get app name of first Element Instance - +yunohost --output-as plain domain list | grep -q "^$server_name"'$' if [ -z "$web_client_location" ] then element_ynh_url="https://matrix.to/" element_instance="element" - if yunohost --output-as plain app list | grep -q "^$element_instance$"; then + if yunohost --output-as plain app list | grep -q "^$element_instance"'$'; then element_domain=$(ynh_app_setting_get --app $element_instance --key domain) element_path=$(ynh_app_setting_get --app $element_instance --key path) #if [ -z "$element_domain" ]; then #else - element_ynh_url="https://"+element_domain+element_path + element_ynh_url="https://""$element_domain""$element_path" fi web_client_location=$element_ynh_url client_base_url=$element_ynh_url @@ -303,7 +303,8 @@ then ynh_app_setting_set --app=$app --key=enable_group_creation --value=$enable_group_creation fi -if [ -z "$enable_registration" ] ; then +if [ -z "$enable_registration" ] +then if [ $is_free_registration -eq 0 ] then enable_registration="false" From 5ee7ed4f22f646ec6eb62913d5e5f3271cd6d83b Mon Sep 17 00:00:00 2001 From: gredin67 Date: Wed, 11 Jan 2023 17:42:10 +0100 Subject: [PATCH 23/95] typo --- scripts/upgrade | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index bde9cc0d..bb64e10e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -100,8 +100,9 @@ fi #================================================= backup_before_upgrade=$(ynh_app_setting_get --app=$app --key=backup_before_upgrade) if [ -z "$backup_before_upgrade" ] ; then - if [ $(ynh_app_setting_get --app=$app --key=disable_backup_before_upgrade) ] ; then - backup_before_upgrade="false" + disable_backup_before_upgrade=$(ynh_app_setting_get --app=$app --key=disable_backup_before_upgrade) + if [ $disable_backup_before_upgrade ] ; then + backup_before_upgrade="false" fi #================================================= From 36df9074909321c904b066637da613e8f61d1b7f Mon Sep 17 00:00:00 2001 From: gredin67 Date: Wed, 11 Jan 2023 17:52:30 +0100 Subject: [PATCH 24/95] tyyyyyyyyyyyyyy --- scripts/upgrade | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index bb64e10e..cf912cfb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -100,9 +100,9 @@ fi #================================================= backup_before_upgrade=$(ynh_app_setting_get --app=$app --key=backup_before_upgrade) if [ -z "$backup_before_upgrade" ] ; then - disable_backup_before_upgrade=$(ynh_app_setting_get --app=$app --key=disable_backup_before_upgrade) - if [ $disable_backup_before_upgrade ] ; then - backup_before_upgrade="false" + #disable_backup_before_upgrade=$(ynh_app_setting_get --app=$app --key=disable_backup_before_upgrade) + #if [ [ ] [ $disable_backup_before_upgrade ] ] ; then + backup_before_upgrade="false" fi #================================================= From 3af6cc79e90f32481103692d23d605a164791de6 Mon Sep 17 00:00:00 2001 From: gredin67 Date: Wed, 11 Jan 2023 18:13:23 +0100 Subject: [PATCH 25/95] typotypo --- scripts/upgrade | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index cf912cfb..4287efec 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -99,11 +99,13 @@ fi # MIGRATION 7 : Working config panel v1 #================================================= backup_before_upgrade=$(ynh_app_setting_get --app=$app --key=backup_before_upgrade) -if [ -z "$backup_before_upgrade" ] ; then - #disable_backup_before_upgrade=$(ynh_app_setting_get --app=$app --key=disable_backup_before_upgrade) - #if [ [ ] [ $disable_backup_before_upgrade ] ] ; then +if [ -z $backup_before_upgrade ] ; then + backup_before_upgrade="true" + disable_backup_before_upgrade=$(ynh_app_setting_get --app=$app --key=disable_backup_before_upgrade) + if $disable_backup_before_upgrade ; then backup_before_upgrade="false" fi +fi #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP From 5e939bada89785de4a5901cc9bb36441d88841b9 Mon Sep 17 00:00:00 2001 From: gredin67 Date: Wed, 11 Jan 2023 18:31:49 +0100 Subject: [PATCH 26/95] yeepy! --- scripts/upgrade | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 4287efec..3a8fde78 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -102,27 +102,30 @@ backup_before_upgrade=$(ynh_app_setting_get --app=$app --key=backup_before_upgra if [ -z $backup_before_upgrade ] ; then backup_before_upgrade="true" disable_backup_before_upgrade=$(ynh_app_setting_get --app=$app --key=disable_backup_before_upgrade) - if $disable_backup_before_upgrade ; then - backup_before_upgrade="false" -fi + if [ $disable_backup_before_upgrade ] ; then + backup_before_upgrade="false" + fi + ynh_app_setting_set --app=$app --key=backup_before_upgrade --value=$backup_before_upgrade fi #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=30 # We stop the service before to set ynh_clean_setup ynh_systemd_action --service_name=matrix-$app.service --action=stop # Backup the current version of the app if [ $backup_before_upgrade ] ; then + ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=30 ynh_backup_before_upgrade ynh_clean_setup () { # Clean installation remainings that are not handled by the remove script. ynh_clean_check_starting ynh_restore_upgradebackup } +else + ynh_script_progression --message="NOT Backing up the app before upgrading..." --weight=1 fi #================================================= From 84eb157391d1fcb1a2936bd4682f154ed5b465ef Mon Sep 17 00:00:00 2001 From: gredin67 Date: Fri, 13 Jan 2023 12:38:30 +0100 Subject: [PATCH 27/95] config max_upload_size --- conf/homeserver.yaml | 2 +- config_panel.toml | 12 +++++++++--- scripts/install | 2 ++ scripts/upgrade | 7 ++++++- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/conf/homeserver.yaml b/conf/homeserver.yaml index 6043900d..e146d787 100644 --- a/conf/homeserver.yaml +++ b/conf/homeserver.yaml @@ -978,7 +978,7 @@ media_storage_providers: # your reverse proxy's config. Notably Nginx has a small max body size by default. # See https://matrix-org.github.io/synapse/latest/reverse_proxy.html. # -max_upload_size: 100M +max_upload_size: __MAX_UPLOAD_SIZE__ # Maximum number of pixels that will be thumbnailed # diff --git a/config_panel.toml b/config_panel.toml index f3e724ff..2f110299 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -116,23 +116,29 @@ services = ["__APP__"] [client.experience] name = "User Experience" + [client.experience.max_upload_size] + ask = "Largest allowed media upload size in bytes." + type = "url" + help = "Defaults to: '10M' . If you are using a reverse proxy you may also need to set this value in your reverse proxy's config. Notably Nginx has a small max body size by default. See https://matrix-org.github.io/synapse/latest/reverse_proxy.html." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + [client.experience.web_client_location] ask = "URL to the web client which / will redirect to." type = "url" help = "Basically Element instance the server should redirect to." - bind = "web_client_location:/etc/matrix-__APP__/homeserver.yaml" + bind = ":/etc/matrix-__APP__/homeserver.yaml" [client.experience.client_base_url] ask = "URL for client links within the email notifications." type = "url" help = "Used to be called 'riot_base_url', still supported" - bind = "client_base_url:/etc/matrix-__APP__/homeserver.yaml" + bind = ":/etc/matrix-__APP__/homeserver.yaml" [client.experience.invite_client_location] ask = "Web client location to direct users to during an invite." type = "url" help = "This is passed to the identity server as the org.matrix.web_client_location key. Defaults to unset, giving no guidance to the identity server." - bind = "invite_client_location:/etc/matrix-__APP__/homeserver.yaml" + bind = ":/etc/matrix-__APP__/homeserver.yaml" [client.experience.enable_group_creation] ask = "Allow non-server-admin Users to create Spaces?" diff --git a/scripts/install b/scripts/install index ae183a76..cbb77daf 100644 --- a/scripts/install +++ b/scripts/install @@ -126,6 +126,7 @@ backup_before_upgrade="true" server_statistics="false" allow_public_rooms_without_auth="false" allow_public_rooms_over_federation="false" +max_upload_size="10M" disable_msisdn_registration="true" registrations_require_3pid="email" # here we need sed magic to transform $server_name @@ -147,6 +148,7 @@ ynh_app_setting_set --app=$app --key=client_base_url --value=$client_base_url ynh_app_setting_set --app=$app --key=invite_client_location --value=$invite_client_location ynh_app_setting_set --app=$app --key=allow_public_rooms_without_auth --value=$allow_public_rooms_without_auth ynh_app_setting_set --app=$app --key=allow_public_rooms_over_federation --value=$allow_public_rooms_over_federation +ynh_app_setting_set --app=$app --key=max_upload_size --value=$max_upload_size ynh_app_setting_set --app=$app --key=disable_msisdn_registration --value=$disable_msisdn_registration ynh_app_setting_set --app=$app --key=registrations_require_3pid --value=$registrations_require_3pid ynh_app_setting_set --app=$app --key=allowed_local_3pids --value=$allowed_local_3pids diff --git a/scripts/upgrade b/scripts/upgrade index 3a8fde78..5c52c2f3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -67,6 +67,7 @@ client_base_url=$(ynh_app_setting_get --app=$app --key=client_base_url) invite_client_location=$(ynh_app_setting_get --app=$app --key=invite_client_location) allow_public_rooms_without_auth=$(ynh_app_setting_get --app=$app --key=allow_public_rooms_without_auth) allow_public_rooms_over_federation=$(ynh_app_setting_get --app=$app --key=allow_public_rooms_over_federation) +max_upload_size=$(ynh_app_setting_get --app=$app --key=max_upload_size) disable_msisdn_registration=$(ynh_app_setting_get --app=$app --key=disable_msisdn_registration) registrations_require_3pid=$(ynh_app_setting_get --app=$app --key=registrations_require_3pid) allowed_local_3pids=$(ynh_app_setting_get --app=$app --key=allowed_local_3pids) @@ -218,7 +219,6 @@ fi # SET STANDARD SETTINGS FROM DEFAULT CONFIG # Get app name of first Element Instance -yunohost --output-as plain domain list | grep -q "^$server_name"'$' if [ -z "$web_client_location" ] then element_ynh_url="https://matrix.to/" @@ -253,6 +253,11 @@ then allow_public_rooms_over_federation=allow_public_rooms ynh_app_setting_set --app=$app --key=allow_public_rooms_over_federation --value=$allow_public_rooms_over_federation fi +if [ -z "$max_upload_size" ] +then + max_upload_size="10M" + ynh_app_setting_set --app=$app --key=max_upload_size --value=$max_upload_size +fi if [ -z "$disable_msisdn_registration" ] then disable_msisdn_registration="true" From 5d6efa05b71f6d0eb09f4f34a87813c73d459e3c Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Wed, 18 Jan 2023 15:20:11 +0100 Subject: [PATCH 28/95] Apply suggestions from code review Co-authored-by: Josue-T --- scripts/upgrade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index e8dc4af4..693a710c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -103,7 +103,7 @@ backup_before_upgrade=$(ynh_app_setting_get --app=$app --key=backup_before_upgra if [ -z $backup_before_upgrade ] ; then backup_before_upgrade="true" disable_backup_before_upgrade=$(ynh_app_setting_get --app=$app --key=disable_backup_before_upgrade) - if [ $disable_backup_before_upgrade ] ; then + if [ "0$disable_backup_before_upgrade" -ne 1 ]; then backup_before_upgrade="false" fi ynh_app_setting_set --app=$app --key=backup_before_upgrade --value=$backup_before_upgrade @@ -117,7 +117,7 @@ fi ynh_systemd_action --service_name=matrix-$app.service --action=stop # Backup the current version of the app -if [ $backup_before_upgrade ] ; then +if $backup_before_upgrade ; then ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=30 ynh_backup_before_upgrade ynh_clean_setup () { From dbee6ce94caad3d45251934763b442ff47d162fe Mon Sep 17 00:00:00 2001 From: gredin67 Date: Wed, 18 Jan 2023 17:46:24 +0100 Subject: [PATCH 29/95] refactor config panel structure --- config_panel.toml | 350 +++++++++++++++++++++++++--------------------- 1 file changed, 190 insertions(+), 160 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 2f110299..c2e92177 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -1,182 +1,202 @@ version = "1.0" -[homeserver] -name = "Homeserver Privacy" -services = ["__APP__"] +[main] +name = "Main Settings" +services = ["matrix-__APP__"] - [homeserver.config] - name = "Configuration Options" + [main.welcome] + name = "Experience for new Users" - [homeserver.config.backup_before_upgrade] - ask = "Backup before upgrade" - type = "boolean" - yes = true - no = false - help = "Set to 'true' to backup the Synapse YunoHost App before each upgrade." - - [homeserver.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." - bind = "report_stats:/etc/matrix-__APP__/homeserver.yaml" - - [homeserver.privacy] - name = "Data Privacy" - - [homeserver.privacy.default_identity_server] - ask = "Identity server suggested to clients." - type = "url" - help = "By default, no suggestion is made, so it is left up to the client." - bind = ":/etc/matrix-__APP__/homeserver.yaml" - - [homeserver.privacy.allow_public_rooms_without_auth] - 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." - bind = ":/etc/matrix-__APP__/homeserver.yaml" - - [homeserver.privacy.allow_public_rooms_over_federation] - 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." - bind = ":/etc/matrix-__APP__/homeserver.yaml" + [main.welcome.password_enabled] + ask = "Enable Password Login?" + type = "boolean" + yes = true + no = false + help = "If disabled, Login with Non-YunoHost Users impossible. But it simplies Login process if your Matrix server only has YunoHost SSO Users." + bind = "password_config>enabled:/etc/matrix-__APP__/homeserver.yaml" -[account] -name = "Registration" -services = ["__APP__"] + [main.welcome.enable_registration] + ask = "Enable Registration for new users." + type = "boolean" + yes = true + no = false + help = "Defaults to 'false'. If 'true', it is highly recommended to use either captcha, email, or token-based verification to avoid SPAM." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + visible = password_enabled - [account.registration] - name = "Account Registration" + [main.welcome.registrations_require_3pid] + ask = "Register only with all following types of 3PID." + type = "select" + choices = ["false","email", "msidn", "email&msisdn"] + help = "Defaults to: 'email'. Phone number: 'msisdn'" + visible = enable_registration - [account.registration.turn_allow_guests] - ask = "Should guests be allowed to use the TURN server?" - type = "boolean" - yes = true - no = false - help = "This defaults to True, otherwise VoIP will be unreliable for guests. However, it does introduce a slight security risk as it allows users to connect to arbitrary endpoints without having first signed up for a valid account (e.g. by passing a CAPTCHA)." - bind = ":/etc/matrix-__APP__/homeserver.yaml" + [main.welcome.allowed_local_3pids] + ask = "Register only with given formats of 3PIDs." + type = "string" + help = ''' + allowed_local_3pids: + - medium: email + pattern: '^[^@]+@matrix\.org$' + - medium: msisdn + pattern: '\+33' + ''' + visible = "registrations_require_3pid != 'false'" - [account.registration.enable_registration] - ask = "Enable Registration for new users." - type = "boolean" - yes = true - no = false - help = "Defaults to 'false'. If 'true', it is highly recommended to use either captcha, email, or token-based verification to avoid SPAM." - bind = ":/etc/matrix-__APP__/homeserver.yaml" + [main.welcome.auto_join_rooms] + ask = "Auto Join new Users in following Rooms:" + type = "string" + help = "Users who register on this homeserver will automatically be joined to these rooms. If the room already exists, the join rule must be set to 'public'. See also next setting." + bind = ":/etc/matrix-__APP__/homeserver.yaml" - [account.registration.registrations_require_3pid] - ask = "Register only with all below types of 3PID." - type = "string" - help = "Defaults to: '- email'. Phone number: '- msisdn'" - bind = ":/etc/matrix-__APP__/homeserver.yaml" + [main.welcome.autocreate_auto_join_rooms] + ask = "Auto-Create room for Auto Join if not existing?" + type = "boolean" + yes = true + no = false + help = "Setting to false means that if the rooms are not manually created, users cannot be auto-joined. Auto-created rooms will be public and federated by default, this can be customised in CLI with the settings auto_join_*." + bind = ":/etc/matrix-__APP__/homeserver.yaml" - [account.registration.disable_msisdn_registration] - ask = "Disable asking Phone Number in Registration flow." - type = "boolean" - yes = true - no = false - help = "Overrides above setting if MSISDNs are set as required." - bind = ":/etc/matrix-__APP__/homeserver.yaml" + [main.welcome.notif_for_new_users] + ask = "Enable email notifications for new users?" + type = "boolean" + yes = true + no = false + help = "Defaults to 'true'." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + visible = enable_notifs - [account.registration.allowed_local_3pids] - ask = "Register only with given formats of 3PIDs." - type = "string" - help = ''' - allowed_local_3pids: - - medium: email - medium: email - pattern: '^[^@]+@matrix\.org$' - - medium: msisdn - pattern: '\+33' - ''' - - [account.registration.registration_shared_secret] - ask = "Shared Secret for Registration." - type = "string" - help = "Allows registration of standard or admin accounts, even if Registration disabled." - bind = ":/etc/matrix-__APP__/homeserver.yaml" + [main.privacy] + name = "Data Privacy" + + [main.privacy.text] + ask = ''' + * "all": any locally-created room + * "invite": any room created with the "private_chat" or "trusted_private_chat" room creation presets + * "off": No encryption by default + ''' + type = "markdown" - [account.registration.allow_guest_access] - ask = "Allow Users to Register as Guests?" - type = "boolean" - yes = true - no = false - help = "Guests can participate on this server in rooms with guest access enabled, without a password/email/etc." - bind = ":/etc/matrix-__APP__/homeserver.yaml" + [main.privacy.e2e_enabled_by_default] + ask = "End-to-End Encryption by default for locally-created Rooms" + type = "select" + choices = ["all", "invite", "off"] + help = "Note that encryption can always be turned on manually, even after creation." + bind = "encryption_enabled_by_default_for_room_type:/etc/matrix-__APP__/homeserver.yaml" + + [main.privacy.allow_public_rooms_over_federation] + ask = "Access Public Rooms Directory over Federation?" + type = "boolean" + yes = true + no = false + help = "Disabled by default. If disabled, users on other homeserver will not be able to look for a public room on your homeserver. They will have to type the ID of the room to join." + bind = ":/etc/matrix-__APP__/homeserver.yaml" -[client] -name = "Matrix Client" -services = ["__APP__"] + [main.privacy.disable_msisdn_registration] + ask = "Disable asking Phone Number in Registration flow." + type = "boolean" + yes = true + no = false + help = "Overrides 3PID settings if MSISDNs are set as required." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + visible = enable_registration - [client.experience] + [main.experience] name = "User Experience" - [client.experience.max_upload_size] - ask = "Largest allowed media upload size in bytes." - type = "url" - help = "Defaults to: '10M' . If you are using a reverse proxy you may also need to set this value in your reverse proxy's config. Notably Nginx has a small max body size by default. See https://matrix-org.github.io/synapse/latest/reverse_proxy.html." - bind = ":/etc/matrix-__APP__/homeserver.yaml" - - [client.experience.web_client_location] + [main.experience.web_client_location] ask = "URL to the web client which / will redirect to." type = "url" help = "Basically Element instance the server should redirect to." bind = ":/etc/matrix-__APP__/homeserver.yaml" - [client.experience.client_base_url] + [main.experience.enable_group_creation] + ask = "Allow non-server-admin Users to create Spaces?" + type = "boolean" + yes = true + no = false + help = "Defaults to 'false'." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + + [main.experience.enable_notifs] + ask = "Enable sending emails for messages the user missed?" + type = "boolean" + yes = true + no = false + help = "Defaults to 'false'." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + + [main.experience.client_base_url] ask = "URL for client links within the email notifications." type = "url" help = "Used to be called 'riot_base_url', still supported" bind = ":/etc/matrix-__APP__/homeserver.yaml" - [client.experience.invite_client_location] - ask = "Web client location to direct users to during an invite." +[resources] +name = "Resource Usage" +services = ["matrix-__APP__", "nginx"] + + [resources.media] + name = "Manage Synapse Media growth and clean-up" + + [resources.media.max_upload_size] + ask = "Largest allowed media upload size in bytes." type = "url" - help = "This is passed to the identity server as the org.matrix.web_client_location key. Defaults to unset, giving no guidance to the identity server." + help = "Defaults to: '10M' ." bind = ":/etc/matrix-__APP__/homeserver.yaml" - [client.experience.enable_group_creation] - ask = "Allow non-server-admin Users to create Spaces?" - type = "boolean" - yes = true - no = false - help = "Defaults to 'false'." - bind = ":/etc/matrix-__APP__/homeserver.yaml" + [resources.database] + name = "Manage Synapse DataBase growth and clean-up" - [client.experience.e2e_enabled_by_default] - ask = "End-to-End Encryption by default for locally-created Rooms" - type = "select" - choices = ["all", "invite", "off"] - help = ''' - * "all": any locally-created room - * "invite": any room created with the "private_chat" or "trusted_private_chat" room creation presets - * "off": this option will take no effect +[advanced] +name = "Advanced Settings" +services = ["matrix-__APP__"] + + [advanced.help] + name = "ONLY CHANGE THIS IF YOU'RE AN EXPERT IN SERVER ADMINISTRATION" + + [advanced.help.text] + ask = ''' + There are security and privacy risks if you change these settings without knowing what you do! ''' - bind = "encryption_enabled_by_default_for_room_type:/etc/matrix-__APP__/homeserver.yaml" + type = "markdown" - [client.welcome] - name = "Welcome User Experience" + [advanced.others] + name = "Others" - [client.welcome.auto_join_rooms] - ask = "Auto Join new Users in following Rooms." - type = "string" - help = "Room should be public. If not existing, will be created as public and federated by default." + [advanced.others.backup_before_upgrade] + ask = "Backup before upgrade?" + type = "boolean" + yes = true + no = false + help = "!!If disabled, do a manual backup before upgrade!! Enable if your Synapse instance is huge and you prefer to disable the backup that is normally automatically done before each upgrade." + + [advanced.others.server_statistics] + ask = "Server statistics" + type = "boolean" + yes = true + no = false + help = "Enable to send anonymous statistics to Synapse Developers to improve performance." + bind = "report_stats:/etc/matrix-__APP__/homeserver.yaml" + + [advanced.guests] + name = "Experience for Guests / Anonymous" + + [advanced.guests.invite_client_location] + ask = "Web client location to direct users to during an invite." + type = "url" + help = "This is passed to the identity server as the org.matrix.web_client_location key. Defaults to unset, giving no guidance to the identity server." bind = ":/etc/matrix-__APP__/homeserver.yaml" - [client.welcome.autocreate_auto_join_rooms] - ask = "Create room for Auto Join if not existing." + [advanced.guests.allow_guest_access] + ask = "Allow Users to Register as Guests?" type = "boolean" yes = true no = false - help = "Will be created as public and federated by default. Can be customised with the settings auto_join_*." + help = "Guests can participate on this server in rooms with guest access enabled, without a password/email/etc." bind = ":/etc/matrix-__APP__/homeserver.yaml" - [client.welcome.auto_join_rooms_for_guests] + [advanced.guests.auto_join_rooms_for_guests] ask = "Enable Auto Join Room for Guests?" type = "boolean" yes = true @@ -184,26 +204,36 @@ services = ["__APP__"] help = "Defaults to 'true'." bind = ":/etc/matrix-__APP__/homeserver.yaml" - [client.welcome.password_enabled] - ask = "Enable Password Login?" - type = "boolean" - yes = true - no = false - help = "Defaults to 'true'." - bind = "password_config>enabled:/etc/matrix-__APP__/homeserver.yaml" + [advanced.privacy] + name = "Data Privacy" - [client.welcome.enable_notifs] - ask = "Enable sending emails for messages the user missed?" - type = "boolean" - yes = true - no = false - help = "Defaults to 'false'." - bind = ":/etc/matrix-__APP__/homeserver.yaml" + [advanced.privacy.default_identity_server] + ask = "Identity server suggested to clients?" + type = "url" + help = "By default, no suggestion is made, so it is left up to the client." + bind = ":/etc/matrix-__APP__/homeserver.yaml" - [client.welcome.notif_for_new_users] - ask = "Enable email notifications for new users?" - type = "boolean" - yes = true - no = false - help = "Defaults to 'true'." - bind = ":/etc/matrix-__APP__/homeserver.yaml" + [advanced.privacy.allow_public_rooms_without_auth] + ask = "Access Public Rooms Directory without authentification?" + type = "boolean" + yes = true + no = false + help = "Disabled by default. If enabled, anyone can query the Public Rooms Directory (access through the client API). This only makes sense if you want everyone to be able to scroll your public room to see what's interesting on your Homeserver" + bind = ":/etc/matrix-__APP__/homeserver.yaml" + + [advanced.registration] + name = "Account Registration" + + [advanced.registration.registration_shared_secret] + ask = "Shared Secret for Registration." + type = "string" + help = "Allows registration of standard or admin accounts, even if Registration disabled." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + + [advanced.registration.turn_allow_guests] + ask = "Should guests be allowed to use the TURN server?" + type = "boolean" + yes = true + no = false + help = "This defaults to True, otherwise VoIP will be unreliable for guests. However, it does introduce a slight security risk as it allows users to connect to arbitrary endpoints without having first signed up for a valid account (e.g. by passing a CAPTCHA)." + bind = ":/etc/matrix-__APP__/homeserver.yaml" From d5b8ec1ac95f743e0e39811c80995c12080c1d9d Mon Sep 17 00:00:00 2001 From: gredin67 Date: Wed, 18 Jan 2023 18:13:00 +0100 Subject: [PATCH 30/95] correct visible syntax --- config_panel.toml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index c2e92177..2376eebe 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -7,14 +7,6 @@ services = ["matrix-__APP__"] [main.welcome] name = "Experience for new Users" - [main.welcome.password_enabled] - ask = "Enable Password Login?" - type = "boolean" - yes = true - no = false - help = "If disabled, Login with Non-YunoHost Users impossible. But it simplies Login process if your Matrix server only has YunoHost SSO Users." - bind = "password_config>enabled:/etc/matrix-__APP__/homeserver.yaml" - [main.welcome.enable_registration] ask = "Enable Registration for new users." type = "boolean" @@ -22,7 +14,15 @@ services = ["matrix-__APP__"] no = false help = "Defaults to 'false'. If 'true', it is highly recommended to use either captcha, email, or token-based verification to avoid SPAM." bind = ":/etc/matrix-__APP__/homeserver.yaml" - visible = password_enabled + + [main.welcome.password_enabled] + ask = "Enable Password Login?" + type = "boolean" + yes = true + no = false + help = "If disabled, Login with Non-YunoHost Users impossible. But it simplies Login process if your Matrix server only has YunoHost SSO Users." + bind = "password_config>enabled:/etc/matrix-__APP__/homeserver.yaml" + visible = "! enable_registration" [main.welcome.registrations_require_3pid] ask = "Register only with all following types of 3PID." @@ -64,7 +64,7 @@ services = ["matrix-__APP__"] no = false help = "Defaults to 'true'." bind = ":/etc/matrix-__APP__/homeserver.yaml" - visible = enable_notifs + visible = "enable_notifs" [main.privacy] name = "Data Privacy" @@ -99,7 +99,7 @@ services = ["matrix-__APP__"] no = false help = "Overrides 3PID settings if MSISDNs are set as required." bind = ":/etc/matrix-__APP__/homeserver.yaml" - visible = enable_registration + visible = "enable_registration" [main.experience] name = "User Experience" From 7baee4b2b4e77d5c00fa35fdf1e6233763599823 Mon Sep 17 00:00:00 2001 From: gredin67 Date: Wed, 18 Jan 2023 18:22:56 +0100 Subject: [PATCH 31/95] typo --- config_panel.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_panel.toml b/config_panel.toml index 2376eebe..6e4f61b5 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -29,7 +29,7 @@ services = ["matrix-__APP__"] type = "select" choices = ["false","email", "msidn", "email&msisdn"] help = "Defaults to: 'email'. Phone number: 'msisdn'" - visible = enable_registration + visible = "enable_registration" [main.welcome.allowed_local_3pids] ask = "Register only with given formats of 3PIDs." From 2faeeb5b75e67b9a417a7c575a8e89f89ed996df Mon Sep 17 00:00:00 2001 From: gredin67 Date: Wed, 18 Jan 2023 18:48:51 +0100 Subject: [PATCH 32/95] make panel load --- config_panel.toml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 6e4f61b5..fa45bc44 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -137,17 +137,14 @@ name = "Resource Usage" services = ["matrix-__APP__", "nginx"] [resources.media] - name = "Manage Synapse Media growth and clean-up" + name = "Manage Media growth and clean-up" [resources.media.max_upload_size] ask = "Largest allowed media upload size in bytes." - type = "url" + type = "string" help = "Defaults to: '10M' ." bind = ":/etc/matrix-__APP__/homeserver.yaml" - [resources.database] - name = "Manage Synapse DataBase growth and clean-up" - [advanced] name = "Advanced Settings" services = ["matrix-__APP__"] @@ -157,7 +154,7 @@ services = ["matrix-__APP__"] [advanced.help.text] ask = ''' - There are security and privacy risks if you change these settings without knowing what you do! + **There are security and privacy risks if you change these settings without knowing what you do!** ''' type = "markdown" From 75349b38b752a3e9067d45bff83c77e83091a25e Mon Sep 17 00:00:00 2001 From: gredin67 Date: Thu, 19 Jan 2023 10:08:18 +0100 Subject: [PATCH 33/95] restructure allowed_local_3pids --- conf/homeserver.yaml | 6 ++---- config_panel.toml | 51 ++++++++++++++++++++++++++------------------ scripts/install | 9 ++++++-- scripts/upgrade | 18 ++++++++++++---- 4 files changed, 53 insertions(+), 31 deletions(-) diff --git a/conf/homeserver.yaml b/conf/homeserver.yaml index e146d787..f45de3cb 100644 --- a/conf/homeserver.yaml +++ b/conf/homeserver.yaml @@ -1283,9 +1283,7 @@ disable_msisdn_registration: __DISABLE_MSISDN_REGISTRATION__ # Mandate that users are only allowed to associate certain formats of # 3PIDs with accounts on this server. # -allowed_local_3pids: - - medium: __REGISTRATIONS_REQUIRE_3PID__ - pattern: __ALLOWED_LOCAL_3PIDS__ +#allowed_local_3pids: # - medium: email # pattern: '^[^@]+@vector\.im$' # - medium: msisdn @@ -1293,7 +1291,7 @@ allowed_local_3pids: # Enable 3PIDs lookup requests to identity servers from this server. # -#enable_3pid_lookup: true +enable_3pid_lookup: __ENABLE_3PID_LOOKUP__ # Require users to submit a token during registration. # Tokens can be managed using the admin API: diff --git a/config_panel.toml b/config_panel.toml index fa45bc44..b709ccac 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -25,27 +25,27 @@ services = ["matrix-__APP__"] visible = "! enable_registration" [main.welcome.registrations_require_3pid] - ask = "Register only with all following types of 3PID." + ask = "Registration requires all following 3PID personal identifier." type = "select" - choices = ["false","email", "msidn", "email&msisdn"] + choices = ["false","email", "msisdn", "email&msisdn"] help = "Defaults to: 'email'. Phone number: 'msisdn'" visible = "enable_registration" - [main.welcome.allowed_local_3pids] - ask = "Register only with given formats of 3PIDs." - type = "string" - help = ''' - allowed_local_3pids: - - medium: email - pattern: '^[^@]+@matrix\.org$' - - medium: msisdn - pattern: '\+33' - ''' - visible = "registrations_require_3pid != 'false'" + [main.welcome.allowed_local_3pids_email] + ask = "Register only with given email formats." + type = "tags" + help = "'^[^@]+@matrix\.org$'" + visible = 'enable_registration && (registrations_require_3pid == "email" || registrations_require_3pid == "email&msisdn")' + + [main.welcome.allowed_local_3pids_msisdn] + ask = "Register only with given phone number formats." + type = "tags" + help = "'\+33'" + visible = 'enable_registration && (registrations_require_3pid == "email&msisdn" || registrations_require_3pid == "msisdn")' [main.welcome.auto_join_rooms] ask = "Auto Join new Users in following Rooms:" - type = "string" + type = "tags" help = "Users who register on this homeserver will automatically be joined to these rooms. If the room already exists, the join rule must be set to 'public'. See also next setting." bind = ":/etc/matrix-__APP__/homeserver.yaml" @@ -105,9 +105,9 @@ services = ["matrix-__APP__"] name = "User Experience" [main.experience.web_client_location] - ask = "URL to the web client which / will redirect to." + ask = "Element instance your HomeServer should redirect to." type = "url" - help = "Basically Element instance the server should redirect to." + help = "URL to the web client which / will redirect to." bind = ":/etc/matrix-__APP__/homeserver.yaml" [main.experience.enable_group_creation] @@ -115,7 +115,7 @@ services = ["matrix-__APP__"] type = "boolean" yes = true no = false - help = "Defaults to 'false'." + help = "Disabled by default: only server admins can create Spaces" bind = ":/etc/matrix-__APP__/homeserver.yaml" [main.experience.enable_notifs] @@ -131,6 +131,7 @@ services = ["matrix-__APP__"] type = "url" help = "Used to be called 'riot_base_url', still supported" bind = ":/etc/matrix-__APP__/homeserver.yaml" + visible = "enable_notifs" [resources] name = "Resource Usage" @@ -150,11 +151,11 @@ name = "Advanced Settings" services = ["matrix-__APP__"] [advanced.help] - name = "ONLY CHANGE THIS IF YOU'RE AN EXPERT IN SERVER ADMINISTRATION" + name = "SETTINGS FOR EXPERTS IN SERVER ADMINISTRATION" [advanced.help.text] ask = ''' - **There are security and privacy risks if you change these settings without knowing what you do!** + !!There are security and privacy risks if you change these settings without knowing what you do!! ''' type = "markdown" @@ -166,7 +167,7 @@ services = ["matrix-__APP__"] type = "boolean" yes = true no = false - help = "!!If disabled, do a manual backup before upgrade!! Enable if your Synapse instance is huge and you prefer to disable the backup that is normally automatically done before each upgrade." + help = "!! If disabled, do a manual backup before upgrade !! Disable if your Synapse instance is huge and you prefer to disable the backup that is normally automatically done before each upgrade." [advanced.others.server_statistics] ask = "Server statistics" @@ -204,10 +205,18 @@ services = ["matrix-__APP__"] [advanced.privacy] name = "Data Privacy" + [advanced.privacy.enable_3pid_lookup] + ask = "Allow discovering friends with phone number or email?" + type = "boolean" + yes = true + no = false + help = "Enable 3PIDs lookup requests to identity servers from this server. See Settings->General->Discovery in Element." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + [advanced.privacy.default_identity_server] ask = "Identity server suggested to clients?" type = "url" - help = "By default, no suggestion is made, so it is left up to the client." + help = "Identity server allows to discover, be discovered and invite people you know with phone number or email. If not set, users will probably chose centralized vector.im. See Settings->General->Discovery in Element." bind = ":/etc/matrix-__APP__/homeserver.yaml" [advanced.privacy.allow_public_rooms_without_auth] diff --git a/scripts/install b/scripts/install index 15679d62..5557af4a 100644 --- a/scripts/install +++ b/scripts/install @@ -91,17 +91,20 @@ then turn_allow_guests="false" sso_enabled="true" password_enabled="false" + enable_3pid_lookup="false" else enable_registration="true" turn_allow_guests="true" sso_enabled="false" password_enabled="true" + enable_3pid_lookup="true" fi ynh_app_setting_set --app=$app --key=enable_registration --value=$enable_registration ynh_app_setting_set --app=$app --key=turn_allow_guests --value=$turn_allow_guests ynh_app_setting_set --app=$app --key=sso_enabled --value=$sso_enabled ynh_app_setting_set --app=$app --key=password_enabled --value=$password_enabled +ynh_app_setting_set --app=$app --key=enable_3pid_lookup --value=$enable_3pid_lookup #================================================= ## SET STANDARD SETTINGS FROM DEFAULT CONFIG @@ -130,7 +133,8 @@ max_upload_size="10M" disable_msisdn_registration="true" registrations_require_3pid="email" # here we need sed magic to transform $server_name -allowed_local_3pids="'^[^@]+@""matrix""\.org$'" +allowed_local_3pids_email="'^[^@]+@""matrix""\.org$'" +allowed_local_3pids_msisdn="'\+33'" allow_guest_access="false" default_identity_server="https://matrix.org" auto_join_rooms="#auto_join_room:""$server_name" @@ -151,7 +155,8 @@ ynh_app_setting_set --app=$app --key=allow_public_rooms_over_federation --value= ynh_app_setting_set --app=$app --key=max_upload_size --value=$max_upload_size ynh_app_setting_set --app=$app --key=disable_msisdn_registration --value=$disable_msisdn_registration ynh_app_setting_set --app=$app --key=registrations_require_3pid --value=$registrations_require_3pid -ynh_app_setting_set --app=$app --key=allowed_local_3pids --value=$allowed_local_3pids +ynh_app_setting_set --app=$app --key=allowed_local_3pids_email --value=$allowed_local_3pids_email +ynh_app_setting_set --app=$app --key=allowed_local_3pids_msisdn --value=$allowed_local_3pids_msisdn ynh_app_setting_set --app=$app --key=allow_guest_access --value=$allow_guest_access ynh_app_setting_set --app=$app --key=default_identity_server --value=$default_identity_server ynh_app_setting_set --app=$app --key=auto_join_rooms --value=$auto_join_rooms diff --git a/scripts/upgrade b/scripts/upgrade index 693a710c..6f382692 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -70,7 +70,8 @@ allow_public_rooms_over_federation=$(ynh_app_setting_get --app=$app --key=allow_ max_upload_size=$(ynh_app_setting_get --app=$app --key=max_upload_size) disable_msisdn_registration=$(ynh_app_setting_get --app=$app --key=disable_msisdn_registration) registrations_require_3pid=$(ynh_app_setting_get --app=$app --key=registrations_require_3pid) -allowed_local_3pids=$(ynh_app_setting_get --app=$app --key=allowed_local_3pids) +allowed_local_3pids_email=$(ynh_app_setting_get --app=$app --key=allowed_local_3pids_email) +allowed_local_3pids_msisdn=$(ynh_app_setting_get --app=$app --key=allowed_local_3pids_msisdn) allow_guest_access=$(ynh_app_setting_get --app=$app --key=allow_guest_access) default_identity_server=$(ynh_app_setting_get --app=$app --key=default_identity_server) auto_join_rooms=$(ynh_app_setting_get --app=$app --key=auto_join_rooms) @@ -84,6 +85,7 @@ enable_registration=$(ynh_app_setting_get --app=$app --key=enable_registration) turn_allow_guests=$(ynh_app_setting_get --app=$app --key=turn_allow_guests) sso_enabled=$(ynh_app_setting_get --app=$app --key=sso_enabled) password_enabled=$(ynh_app_setting_get --app=$app --key=password_enabled) +enable_3pid_lookup=$(ynh_app_setting_get --app=$app --key=enable_3pid_lookup) #================================================= # ENSURE DOWNWARD COMPATIBILITY @@ -274,10 +276,15 @@ then registrations_require_3pid="email" ynh_app_setting_set --app=$app --key=registrations_require_3pid --value=$registrations_require_3pid fi -if [ -z "$allowed_local_3pids" ] +if [ -z "$allowed_local_3pids_email" ] then - allowed_local_3pids="'^[^@]+@""matrix""\.org$'" - ynh_app_setting_set --app=$app --key=allowed_local_3pids --value=$allowed_local_3pids + allowed_local_3pids_email="'^[^@]+@""matrix""\.org$'" + ynh_app_setting_set --app=$app --key=allowed_local_3pids_email --value=$allowed_local_3pids_email +fi +if [ -z "$allowed_local_3pids_msisdn" ] +then + allowed_local_3pids_msisdn="'\+33'" + ynh_app_setting_set --app=$app --key=allowed_local_3pids_msisdn --value=$allowed_local_3pids_msisdn fi if [ -z "$allow_guest_access" ] then @@ -328,16 +335,19 @@ then turn_allow_guests="false" sso_enabled="true" password_enabled="false" + enable_3pid_lookup="false" else enable_registration="true" turn_allow_guests="true" sso_enabled="false" password_enabled="true" + enable_3pid_lookup="true" fi ynh_app_setting_set --app=$app --key=enable_registration --value=$enable_registration ynh_app_setting_set --app=$app --key=turn_allow_guests --value=$turn_allow_guests ynh_app_setting_set --app=$app --key=sso_enabled --value=$sso_enabled ynh_app_setting_set --app=$app --key=password_enabled --value=$password_enabled + ynh_app_setting_set --app=$app --key=enable_3pid_lookup --value=$enable_3pid_lookup fi #================================================= From 0588509c648e87a8f7c3399c81d31eb2e5298e1d Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Sat, 28 Jan 2023 19:29:09 +0000 Subject: [PATCH 34/95] add privacy on push notifications I think it's the only things to do with that. --- config_panel.toml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/config_panel.toml b/config_panel.toml index b709ccac..29f7b039 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -100,6 +100,15 @@ services = ["matrix-__APP__"] help = "Overrides 3PID settings if MSISDNs are set as required." bind = ":/etc/matrix-__APP__/homeserver.yaml" visible = "enable_registration" + + [main.privacy.disable_msisdn_registration] + ask = "Disable content sharing inside push notification." + type = "boolean" + yes = true + no = false + help = "Do not send content message and sender infromation in push notification increase privacy when GAFAM notification service is used (ie: when element client is downloaded thrue Gplay store)." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + visible = "include_content" [main.experience] name = "User Experience" From 86345a686e50959131afed7bac18ed22cf0aaea9 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Sat, 28 Jan 2023 20:10:23 +0000 Subject: [PATCH 35/95] Update config_panel.toml --- config_panel.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_panel.toml b/config_panel.toml index 29f7b039..3d3982b1 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -101,7 +101,7 @@ services = ["matrix-__APP__"] bind = ":/etc/matrix-__APP__/homeserver.yaml" visible = "enable_registration" - [main.privacy.disable_msisdn_registration] + [main.privacy.disable_push_incluse_content] ask = "Disable content sharing inside push notification." type = "boolean" yes = true From b886394e84033873f4a73a9009c03aabbca6d6a4 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Mon, 30 Jan 2023 16:33:42 +0000 Subject: [PATCH 36/95] Update homeserver.yaml --- conf/homeserver.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/homeserver.yaml b/conf/homeserver.yaml index f45de3cb..8ad7bf89 100644 --- a/conf/homeserver.yaml +++ b/conf/homeserver.yaml @@ -2418,7 +2418,7 @@ push: # The default value is "true" to include message details. Uncomment to only # include the event ID and room ID in push notification payloads. # - #include_content: false + include_content: __INCLUDE_CONTENT__ # When a push notification is received, an unread count is also sent. # This number can either be calculated as the number of unread messages From c2e1891f395f183520213c264748446e33a31d75 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Mon, 30 Jan 2023 16:50:32 +0000 Subject: [PATCH 37/95] Update config_panel.toml --- config_panel.toml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 3d3982b1..b22d83da 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -101,14 +101,13 @@ services = ["matrix-__APP__"] bind = ":/etc/matrix-__APP__/homeserver.yaml" visible = "enable_registration" - [main.privacy.disable_push_incluse_content] + [main.privacy.disable_push_content] ask = "Disable content sharing inside push notification." type = "boolean" yes = true no = false help = "Do not send content message and sender infromation in push notification increase privacy when GAFAM notification service is used (ie: when element client is downloaded thrue Gplay store)." - bind = ":/etc/matrix-__APP__/homeserver.yaml" - visible = "include_content" + bind = "push>include_content:/etc/matrix-__APP__/homeserver.yaml" [main.experience] name = "User Experience" From a01e0c19b1f56302df5ce851087373602c1d364c Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Mon, 30 Jan 2023 16:53:03 +0000 Subject: [PATCH 38/95] Update homeserver.yaml --- conf/homeserver.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/homeserver.yaml b/conf/homeserver.yaml index 8ad7bf89..0a220c33 100644 --- a/conf/homeserver.yaml +++ b/conf/homeserver.yaml @@ -2418,7 +2418,7 @@ push: # The default value is "true" to include message details. Uncomment to only # include the event ID and room ID in push notification payloads. # - include_content: __INCLUDE_CONTENT__ + include_content: __PUSH_INCLUDE_CONTENT__ # When a push notification is received, an unread count is also sent. # This number can either be calculated as the number of unread messages From 0eac5aad59a00267777c72542aea257b8fc4fc8f Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Mon, 30 Jan 2023 16:56:17 +0000 Subject: [PATCH 39/95] Update config_panel.toml --- config_panel.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index b22d83da..5cd81bb2 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -101,12 +101,12 @@ services = ["matrix-__APP__"] bind = ":/etc/matrix-__APP__/homeserver.yaml" visible = "enable_registration" - [main.privacy.disable_push_content] + [main.privacy.push_include_content] ask = "Disable content sharing inside push notification." type = "boolean" yes = true no = false - help = "Do not send content message and sender infromation in push notification increase privacy when GAFAM notification service is used (ie: when element client is downloaded thrue Gplay store)." + help = "Send content message and sender infromation in push notification. Set to false increase privacy when GAFAM notification service is used (ie: when element client is downloaded thrue Gplay store)." bind = "push>include_content:/etc/matrix-__APP__/homeserver.yaml" [main.experience] From d5869bdb3688fe72ae4d89f7fa1b72f24d9fc695 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Mon, 30 Jan 2023 17:00:49 +0000 Subject: [PATCH 40/95] Update install --- scripts/install | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/install b/scripts/install index 5557af4a..407f49a4 100644 --- a/scripts/install +++ b/scripts/install @@ -144,6 +144,7 @@ password_enabled="true" enable_notifs="true" notif_for_new_users="true" enable_group_creation="true" +push_include_content="true" ynh_app_setting_set --app=$app --key=backup_before_upgrade --value=$backup_before_upgrade ynh_app_setting_set --app=$app --key=server_statistics --value=$server_statistics @@ -166,6 +167,8 @@ ynh_app_setting_set --app=$app --key=password_enabled --value=$password_enabled ynh_app_setting_set --app=$app --key=enable_notifs --value=$enable_notifs ynh_app_setting_set --app=$app --key=notif_for_new_users --value=$notif_for_new_users ynh_app_setting_set --app=$app --key=enable_group_creation --value=$enable_group_creation +ynh_app_setting_set --app=$app --key=push_include_content --value=$push_include_content + #================================================= # STANDARD MODIFICATIONS From fcdd1d1f4f162c976af21a8d05a09c682b5cd4e2 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Mon, 30 Jan 2023 17:08:00 +0000 Subject: [PATCH 41/95] Update upgrade --- scripts/upgrade | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 6f382692..f22b6586 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -86,6 +86,7 @@ turn_allow_guests=$(ynh_app_setting_get --app=$app --key=turn_allow_guests) sso_enabled=$(ynh_app_setting_get --app=$app --key=sso_enabled) password_enabled=$(ynh_app_setting_get --app=$app --key=password_enabled) enable_3pid_lookup=$(ynh_app_setting_get --app=$app --key=enable_3pid_lookup) +push_include_content=$(ynh_app_setting_get --app=$app --key=push_include_content) #================================================= # ENSURE DOWNWARD COMPATIBILITY @@ -350,6 +351,12 @@ then ynh_app_setting_set --app=$app --key=enable_3pid_lookup --value=$enable_3pid_lookup fi +if [ -z "$push_include_content" ] +then + push_include_content="true" + ynh_app_setting_set --app=$app --key=push_include_content --value=$push_include_content +fi + #================================================= # INSTALL DEPENDENCIES #================================================= From ef46161638d1ad5031175a5f891a8f732202709f Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Tue, 18 Apr 2023 22:48:23 +0200 Subject: [PATCH 42/95] nginx max_upload_size --- scripts/config | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/config b/scripts/config index d244e21e..63fc1115 100644 --- a/scripts/config +++ b/scripts/config @@ -10,6 +10,18 @@ source /usr/share/yunohost/helpers # Stop script if errors ynh_abort_if_errors +final_path=$(ynh_app_setting_get --app=$app --key=final_path) + +get__max_upload_size() { + max_upload_size=$(ynh_app_setting_get --app $app --key max_upload_size) + echo "${max_upload_size}" +} + +set__max_upload_size() { + ynh_write_var_in_file --file=/etc/matrix-$app/homeserver.yaml --key=max_upload_size --value="${max_upload_size}" + sed -i -r "s|client_max_body_size\s+[[:digit:]]+M;|client_max_body_size ${max_upload_size}M;|g" "/etc/nginx/conf.d/$domain.d/$app.conf + ynh_add_nginx_conf +} #================================================= From b949352a454e27ef5f3bb70bda62f48c4978145d Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Thu, 29 Jun 2023 08:28:25 +0000 Subject: [PATCH 43/95] Update config_panel.toml --- config_panel.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_panel.toml b/config_panel.toml index 5cd81bb2..f5e8b7d4 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -151,7 +151,7 @@ services = ["matrix-__APP__", "nginx"] [resources.media.max_upload_size] ask = "Largest allowed media upload size in bytes." type = "string" - help = "Defaults to: '10M' ." + help = "Defaults to: '10M' . Format : <[GMK]?>" bind = ":/etc/matrix-__APP__/homeserver.yaml" [advanced] From 2609503f6d58407df873c4662f3a0e4590582253 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Thu, 29 Jun 2023 08:39:25 +0000 Subject: [PATCH 44/95] Update config --- scripts/config | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/config b/scripts/config index 63fc1115..5b6480f0 100644 --- a/scripts/config +++ b/scripts/config @@ -19,11 +19,10 @@ get__max_upload_size() { set__max_upload_size() { ynh_write_var_in_file --file=/etc/matrix-$app/homeserver.yaml --key=max_upload_size --value="${max_upload_size}" - sed -i -r "s|client_max_body_size\s+[[:digit:]]+M;|client_max_body_size ${max_upload_size}M;|g" "/etc/nginx/conf.d/$domain.d/$app.conf + sed -i -r "s|client_max_body_size\s[[:digit:]]*[GMK]?;|client_max_body_size ${max_upload_size};|g" "/etc/nginx/conf.d/$domain.d/$app.conf ynh_add_nginx_conf } - #================================================= # GENERIC FINALIZATION #================================================= From 1e51a9e66111a0b194963e7fa5d255bc1134a015 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Thu, 29 Jun 2023 14:09:16 +0000 Subject: [PATCH 45/95] WIP sorry i need more time --- scripts/config | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/scripts/config b/scripts/config index 5b6480f0..cbe796fc 100644 --- a/scripts/config +++ b/scripts/config @@ -23,6 +23,44 @@ set__max_upload_size() { ynh_add_nginx_conf } +get__registrations_require_3pid() { + max_upload_size=$(ynh_app_setting_get --app $app --key registrations_require_3pid) + echo "${registrations_require_3pid}" +} + +set__registrations_require_3pid() { + + case ${registrations_require_3pid} in + email) + sed -i -r -e "s|\#?[^\S\n]*registrations_require_3pid:\s(\#?[^\S\n]*- .*\s){0,2}|registrations_require_3pid:\n - email\n# - msisdn|g" "/etc/matrix-$app/homeserver.yaml" + ;; + msisdn) + sed -i -r -e "s|\#?[^\S\n]*registrations_require_3pid:\s(\#?[^\S\n]*- .*\s){0,2}|registrations_require_3pid:\n# - email\n - msisdn|g" "/etc/matrix-$app/homeserver.yaml" + ;; + email&msisdn) + sed -i -r -e "s|\#?[^\S\n]*registrations_require_3pid:\s(\#?[^\S\n]*- .*\s){0,2}|registrations_require_3pid:\n - email\n - msisdn|g" "/etc/matrix-$app/homeserver.yaml" + ;; + *) + sed -i -r -e "s|\#?[^\S\n]*registrations_require_3pid:\s(\#?[^\S\n]*- .*\s){0,2}|#registrations_require_3pid:\n# - email\n# - msisdn|g" "/etc/matrix-$app/homeserver.yaml" + ;; + esac + + ynh_app_setting_set --app=$app --key=registrations_require_3pid --value="${registrations_require_3pid}" +} + +get__allowed_local_3pids_email() { + max_upload_size=$(ynh_app_setting_get --app $app --key allowed_local_3pids_email) + echo "${allowed_local_3pids_email}" +} + +set__allowed_local_3pids_email() { + + sed -i -r -e "s|(\#?[^\S\n]*allowed_local_3pids:\s(\#?[^\S\n]*- medium:.*\s\#?[^\S\n]*pattern:.*\s)?\#?[^\S\n]*- medium: email\s\#?[^\S\n]*pattern: )(.*)(\s)|$1'${allowed_local_3pids_email}'$3\2|g" "/etc/matrix-$app/homeserver.yaml" + + ynh_app_setting_set --app=$app --key=fpm_footprint --value="${registrations_require_3pid}" +} + + #================================================= # GENERIC FINALIZATION #================================================= From da52218aeba749e8dd92d5c21dcd696d7c73fa18 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Sat, 1 Jul 2023 08:25:47 +0000 Subject: [PATCH 46/95] Update config registrations_require_3pid ok registrations_require_3pid should be ok keep allowed_local_3pid_(email|msisdn) autojoin_rooms autocreate_auto_join_rooms --- scripts/config | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/config b/scripts/config index cbe796fc..563d13aa 100644 --- a/scripts/config +++ b/scripts/config @@ -29,19 +29,20 @@ get__registrations_require_3pid() { } set__registrations_require_3pid() { - + # sed -z do the trick on this king of multline replacement case ${registrations_require_3pid} in email) - sed -i -r -e "s|\#?[^\S\n]*registrations_require_3pid:\s(\#?[^\S\n]*- .*\s){0,2}|registrations_require_3pid:\n - email\n# - msisdn|g" "/etc/matrix-$app/homeserver.yaml" + + sed -i -z -r "s|#?([^\S\n]*registrations_require_3pid:\n)#?([^\S\n]*-[^\S\n]*email\n)#?([^\S\n]*-[^\S\n]*msisdn)|\1\2#\3|" "/etc/matrix-$app/homeserver.yaml" ;; msisdn) - sed -i -r -e "s|\#?[^\S\n]*registrations_require_3pid:\s(\#?[^\S\n]*- .*\s){0,2}|registrations_require_3pid:\n# - email\n - msisdn|g" "/etc/matrix-$app/homeserver.yaml" + sed -i -z -r "s|#?([^\S\n]*registrations_require_3pid:\n)#?([^\S\n]*-[^\S\n]*email\n)#?([^\S\n]*-[^\S\n]*msisdn)|\1#\2\3|" "/etc/matrix-$app/homeserver.yaml" ;; email&msisdn) - sed -i -r -e "s|\#?[^\S\n]*registrations_require_3pid:\s(\#?[^\S\n]*- .*\s){0,2}|registrations_require_3pid:\n - email\n - msisdn|g" "/etc/matrix-$app/homeserver.yaml" + sed -i -z -r "s|#?([^\S\n]*registrations_require_3pid:\n)#?([^\S\n]*-[^\S\n]*email\n)#?([^\S\n]*-[^\S\n]*msisdn)|\1\2\3|" "/etc/matrix-$app/homeserver.yaml" ;; *) - sed -i -r -e "s|\#?[^\S\n]*registrations_require_3pid:\s(\#?[^\S\n]*- .*\s){0,2}|#registrations_require_3pid:\n# - email\n# - msisdn|g" "/etc/matrix-$app/homeserver.yaml" + sed -i -z -r "s|#?([^\S\n]*registrations_require_3pid:\n)#?([^\S\n]*-[^\S\n]*email\n)#?([^\S\n]*-[^\S\n]*msisdn)|#\1#\2#\3|" "/etc/matrix-$app/homeserver.yaml" ;; esac @@ -54,13 +55,13 @@ get__allowed_local_3pids_email() { } set__allowed_local_3pids_email() { - - sed -i -r -e "s|(\#?[^\S\n]*allowed_local_3pids:\s(\#?[^\S\n]*- medium:.*\s\#?[^\S\n]*pattern:.*\s)?\#?[^\S\n]*- medium: email\s\#?[^\S\n]*pattern: )(.*)(\s)|$1'${allowed_local_3pids_email}'$3\2|g" "/etc/matrix-$app/homeserver.yaml" + sed -i -z -r "s|(\#?[^\S\n]*allowed_local_3pids:\s(\#?[^\S\n]*- medium:.*\s\#?[^\S\n]*pattern:.*\s)?\#?[^\S\n]*- medium: email\s\#?[^\S\n]*pattern: )(.*)(\s)|$1'${allowed_local_3pids_email}'$3\2|g" "/etc/matrix-$app/homeserver.yaml" ynh_app_setting_set --app=$app --key=fpm_footprint --value="${registrations_require_3pid}" } + #================================================= # GENERIC FINALIZATION #================================================= From c9151251c552738a64ffae11fe4465b329f9abd7 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Sat, 1 Jul 2023 09:27:41 +0000 Subject: [PATCH 47/95] Update config allowed_local_3pids allowed_local_3pids should work its mandatory that config part is like that #allowed_local_3pids: # - medium: email # pattern: '' # - medium: msisdn # pattern: 'pattern' no more o duplicate medium with different pattern are allowed no separated lines should just vary the comented lines or not the line starting spaces --- scripts/config | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/scripts/config b/scripts/config index 563d13aa..585d62c0 100644 --- a/scripts/config +++ b/scripts/config @@ -55,9 +55,24 @@ get__allowed_local_3pids_email() { } set__allowed_local_3pids_email() { - sed -i -z -r "s|(\#?[^\S\n]*allowed_local_3pids:\s(\#?[^\S\n]*- medium:.*\s\#?[^\S\n]*pattern:.*\s)?\#?[^\S\n]*- medium: email\s\#?[^\S\n]*pattern: )(.*)(\s)|$1'${allowed_local_3pids_email}'$3\2|g" "/etc/matrix-$app/homeserver.yaml" + if [ -z ${registrations_require_3pid} ] ; then + sed -i -z -r "s|#?([^\S\n]*allowed_local_3pids:\n)#?([^\S\n]*-[^\S\n]*medium: email\n)#?([^\S\n]*pattern:[^\S\n]*')([^']*)('\n)#?([^\S\n]*-[^\S\n]*medium: msisdn\n)#?([^\S\n]*pattern: ')([^']*)('?)|#\1#\2#\3\4\5#\6#\7\8\9|" "/etc/matrix-$app/homeserver.yaml" + else + sed -i -z -r "s|#?([^\S\n]*allowed_local_3pids:\n)#?([^\S\n]*-[^\S\n]*medium: email\n)#?([^\S\n]*pattern:[^\S\n]*')([^']*)('\n)#?([^\S\n]*-[^\S\n]*medium: msisdn\n)#?([^\S\n]*pattern: ')([^']*)('?)|\1#\2#\3EMAIL\5#\6#\7\8\9|" "/etc/matrix-$app/homeserver.yaml" + ynh_app_setting_set --app=$app --key=allowed_local_3pids_email --value="${allowed_local_3pids_email}" +} + +get__allowed_local_3pids_msisdn() { + max_upload_size=$(ynh_app_setting_get --app $app --key allowed_local_3pids_msisdn) + echo "${allowed_local_3pids_msisdn}" +} - ynh_app_setting_set --app=$app --key=fpm_footprint --value="${registrations_require_3pid}" +set__allowed_local_3pids_msisdn() { + if [ -z ${registrations_require_3pid} ] ; then + sed -i -z -r "s|#?([^\S\n]*allowed_local_3pids:\n)#?([^\S\n]*-[^\S\n]*medium: email\n)#?([^\S\n]*pattern:[^\S\n]*')([^']*)('\n)#?([^\S\n]*-[^\S\n]*medium: msisdn\n)#?([^\S\n]*pattern: ')([^']*)('?)|#\1#\2#\3\4\5#\6#\7\8\9|" "/etc/matrix-$app/homeserver.yaml" + else + sed -i -z -r "s|#?([^\S\n]*allowed_local_3pids:\n)#?([^\S\n]*-[^\S\n]*medium: email\n)#?([^\S\n]*pattern:[^\S\n]*')([^']*)('\n)#?([^\S\n]*-[^\S\n]*medium: msisdn\n)#?([^\S\n]*pattern: ')([^']*)('?)|\1#\2#\3\4\5#\6#\7MSISDN\9|" "/etc/matrix-$app/homeserver.yaml" + ynh_app_setting_set --app=$app --key=allowed_local_3pids_msisdn --value="${allowed_local_3pids_msisdn}" } From 2005c1b1fb9f71dc7f30904f0331a71e49f92232 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Sat, 1 Jul 2023 14:07:50 +0000 Subject: [PATCH 48/95] Update config auto_join_rooms Auto join rooms config should be good. which more ?? --- scripts/config | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/scripts/config b/scripts/config index 585d62c0..39e8884e 100644 --- a/scripts/config +++ b/scripts/config @@ -75,7 +75,30 @@ set__allowed_local_3pids_msisdn() { ynh_app_setting_set --app=$app --key=allowed_local_3pids_msisdn --value="${allowed_local_3pids_msisdn}" } +get__auto_join_rooms() { + max_upload_size=$(ynh_app_setting_get --app $app --key auto_join_rooms) + echo "${auto_join_rooms}" +} + +set__auto_join_rooms() { + if [ -z ${auto_join_rooms} ] ; then + # remove all values comment header ans example value + sed -i -z -r "s|#?([^\S\n]*auto_join_rooms:\n)#?([^\S\n]*-[^\S\n]*"[^\"]*"\n)*|#\1# - "#example:example.com"\n\n|" "/etc/matrix-$app/homeserver.yaml" + else + + IFS=' ' read -r -a arrroom <<< "${auto_join_rooms}"; + + # print header then all space separated values + myregex='s|#?([^\S\n]*auto_join_rooms:)#?([^\S\n]*-[^\S\n]*"[^\"]*"\n)*|#\1'; + for room in "${arrroom[@]}"; do + myregex="${myregex}\n - ${room}"; + done; + myregex="${myregex}\n\n|"; + sed -i -z -r "${myregex}" "/etc/matrix-$app/homeserver.yaml" + fi + +} #================================================= # GENERIC FINALIZATION From b0eba01152c305b9d05bcf492e2638a2f6b9dc76 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Sat, 1 Jul 2023 14:11:40 +0000 Subject: [PATCH 49/95] Update config_panel.toml auto_join_rooms help modification --- config_panel.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_panel.toml b/config_panel.toml index f5e8b7d4..dde04ef7 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -46,7 +46,7 @@ services = ["matrix-__APP__"] [main.welcome.auto_join_rooms] ask = "Auto Join new Users in following Rooms:" type = "tags" - help = "Users who register on this homeserver will automatically be joined to these rooms. If the room already exists, the join rule must be set to 'public'. See also next setting." + help = "Use space separated values (e.g: #example:example.com #example2:example2.com ). Users who register on this homeserver will automatically be joined to these rooms. If the room already exists, the join rule must be set to 'public'. See also next setting." bind = ":/etc/matrix-__APP__/homeserver.yaml" [main.welcome.autocreate_auto_join_rooms] From 11eea48fae7f4511e26e3e4cc1fef8e8b3945ce9 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Sun, 2 Jul 2023 18:47:44 +0000 Subject: [PATCH 50/95] Update config bug corrected my bad --- scripts/config | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/config b/scripts/config index 39e8884e..51edbc64 100644 --- a/scripts/config +++ b/scripts/config @@ -59,7 +59,9 @@ set__allowed_local_3pids_email() { sed -i -z -r "s|#?([^\S\n]*allowed_local_3pids:\n)#?([^\S\n]*-[^\S\n]*medium: email\n)#?([^\S\n]*pattern:[^\S\n]*')([^']*)('\n)#?([^\S\n]*-[^\S\n]*medium: msisdn\n)#?([^\S\n]*pattern: ')([^']*)('?)|#\1#\2#\3\4\5#\6#\7\8\9|" "/etc/matrix-$app/homeserver.yaml" else sed -i -z -r "s|#?([^\S\n]*allowed_local_3pids:\n)#?([^\S\n]*-[^\S\n]*medium: email\n)#?([^\S\n]*pattern:[^\S\n]*')([^']*)('\n)#?([^\S\n]*-[^\S\n]*medium: msisdn\n)#?([^\S\n]*pattern: ')([^']*)('?)|\1#\2#\3EMAIL\5#\6#\7\8\9|" "/etc/matrix-$app/homeserver.yaml" - ynh_app_setting_set --app=$app --key=allowed_local_3pids_email --value="${allowed_local_3pids_email}" + fi + + ynh_app_setting_set --app=$app --key=allowed_local_3pids_email --value="${allowed_local_3pids_email}" } get__allowed_local_3pids_msisdn() { @@ -72,7 +74,8 @@ set__allowed_local_3pids_msisdn() { sed -i -z -r "s|#?([^\S\n]*allowed_local_3pids:\n)#?([^\S\n]*-[^\S\n]*medium: email\n)#?([^\S\n]*pattern:[^\S\n]*')([^']*)('\n)#?([^\S\n]*-[^\S\n]*medium: msisdn\n)#?([^\S\n]*pattern: ')([^']*)('?)|#\1#\2#\3\4\5#\6#\7\8\9|" "/etc/matrix-$app/homeserver.yaml" else sed -i -z -r "s|#?([^\S\n]*allowed_local_3pids:\n)#?([^\S\n]*-[^\S\n]*medium: email\n)#?([^\S\n]*pattern:[^\S\n]*')([^']*)('\n)#?([^\S\n]*-[^\S\n]*medium: msisdn\n)#?([^\S\n]*pattern: ')([^']*)('?)|\1#\2#\3\4\5#\6#\7MSISDN\9|" "/etc/matrix-$app/homeserver.yaml" - ynh_app_setting_set --app=$app --key=allowed_local_3pids_msisdn --value="${allowed_local_3pids_msisdn}" + fi + ynh_app_setting_set --app=$app --key=allowed_local_3pids_msisdn --value="${allowed_local_3pids_msisdn}" } get__auto_join_rooms() { @@ -97,7 +100,8 @@ set__auto_join_rooms() { myregex="${myregex}\n\n|"; sed -i -z -r "${myregex}" "/etc/matrix-$app/homeserver.yaml" fi - + + ynh_app_setting_set --app=$app --key=auto_join_rooms --value="${auto_join_rooms}" } #================================================= From 0438f8f21d85edd132e87a043d05212bf98ae5a5 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Sun, 2 Jul 2023 19:10:42 +0000 Subject: [PATCH 51/95] Update config damne i'm bad --- scripts/config | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/config b/scripts/config index 51edbc64..be7adb30 100644 --- a/scripts/config +++ b/scripts/config @@ -24,7 +24,7 @@ set__max_upload_size() { } get__registrations_require_3pid() { - max_upload_size=$(ynh_app_setting_get --app $app --key registrations_require_3pid) + registrations_require_3pid=$(ynh_app_setting_get --app $app --key registrations_require_3pid) echo "${registrations_require_3pid}" } @@ -50,7 +50,7 @@ set__registrations_require_3pid() { } get__allowed_local_3pids_email() { - max_upload_size=$(ynh_app_setting_get --app $app --key allowed_local_3pids_email) + allowed_local_3pids_email=$(ynh_app_setting_get --app $app --key allowed_local_3pids_email) echo "${allowed_local_3pids_email}" } @@ -65,7 +65,7 @@ set__allowed_local_3pids_email() { } get__allowed_local_3pids_msisdn() { - max_upload_size=$(ynh_app_setting_get --app $app --key allowed_local_3pids_msisdn) + allowed_local_3pids_msisdn=$(ynh_app_setting_get --app $app --key allowed_local_3pids_msisdn) echo "${allowed_local_3pids_msisdn}" } @@ -79,7 +79,7 @@ set__allowed_local_3pids_msisdn() { } get__auto_join_rooms() { - max_upload_size=$(ynh_app_setting_get --app $app --key auto_join_rooms) + auto_join_rooms=$(ynh_app_setting_get --app $app --key auto_join_rooms) echo "${auto_join_rooms}" } From 8e59218e9bdcae442f42e558d0d379618ee78aba Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Sun, 2 Jul 2023 19:12:53 +0000 Subject: [PATCH 52/95] Update config --- scripts/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/config b/scripts/config index be7adb30..77e444cc 100644 --- a/scripts/config +++ b/scripts/config @@ -19,7 +19,7 @@ get__max_upload_size() { set__max_upload_size() { ynh_write_var_in_file --file=/etc/matrix-$app/homeserver.yaml --key=max_upload_size --value="${max_upload_size}" - sed -i -r "s|client_max_body_size\s[[:digit:]]*[GMK]?;|client_max_body_size ${max_upload_size};|g" "/etc/nginx/conf.d/$domain.d/$app.conf + sed -i -r "s|client_max_body_size\s[[:digit:]]*[GMK]?;|client_max_body_size ${max_upload_size};|g" "/etc/nginx/conf.d/$domain.d/$app.conf" ynh_add_nginx_conf } From 4f7892a786f38e854dc50a8f4153997eb1327531 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Sun, 2 Jul 2023 21:07:56 +0000 Subject: [PATCH 53/95] Update config Done --- scripts/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/config b/scripts/config index 77e444cc..5d1e8df1 100644 --- a/scripts/config +++ b/scripts/config @@ -38,7 +38,7 @@ set__registrations_require_3pid() { msisdn) sed -i -z -r "s|#?([^\S\n]*registrations_require_3pid:\n)#?([^\S\n]*-[^\S\n]*email\n)#?([^\S\n]*-[^\S\n]*msisdn)|\1#\2\3|" "/etc/matrix-$app/homeserver.yaml" ;; - email&msisdn) + 'email&msisdn') sed -i -z -r "s|#?([^\S\n]*registrations_require_3pid:\n)#?([^\S\n]*-[^\S\n]*email\n)#?([^\S\n]*-[^\S\n]*msisdn)|\1\2\3|" "/etc/matrix-$app/homeserver.yaml" ;; *) From 94d49b7a6645a08a01dae621c14b0bbfbdbded39 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Sun, 2 Jul 2023 21:12:13 +0000 Subject: [PATCH 54/95] Update config_panel.toml Only work with ' --- config_panel.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index dde04ef7..d2fc6533 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -34,13 +34,13 @@ services = ["matrix-__APP__"] [main.welcome.allowed_local_3pids_email] ask = "Register only with given email formats." type = "tags" - help = "'^[^@]+@matrix\.org$'" + help = '^[^@]+@matrix\.org$' visible = 'enable_registration && (registrations_require_3pid == "email" || registrations_require_3pid == "email&msisdn")' [main.welcome.allowed_local_3pids_msisdn] ask = "Register only with given phone number formats." type = "tags" - help = "'\+33'" + help = '\+33' visible = 'enable_registration && (registrations_require_3pid == "email&msisdn" || registrations_require_3pid == "msisdn")' [main.welcome.auto_join_rooms] From c7d3eedcaad2869d0273ac88b9d13aa4c8349bf2 Mon Sep 17 00:00:00 2001 From: gredin67 Date: Mon, 3 Jul 2023 22:30:08 +0200 Subject: [PATCH 55/95] merge last commits from #374 --- config_panel.toml | 1 + scripts/install | 3 --- scripts/upgrade | 23 +++++++++++++---------- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index d2fc6533..530cf8e4 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -209,6 +209,7 @@ services = ["matrix-__APP__"] no = false help = "Defaults to 'true'." bind = ":/etc/matrix-__APP__/homeserver.yaml" + visible = "allow_guest_access" [advanced.privacy] name = "Data Privacy" diff --git a/scripts/install b/scripts/install index c8e0c6d6..c58a37a1 100644 --- a/scripts/install +++ b/scripts/install @@ -118,10 +118,7 @@ if yunohost --output-as plain app list | grep -q "^$element_instance$"; then element_domain=$(ynh_app_setting_get --app $element_instance --key domain) element_path=$(ynh_app_setting_get --app $element_instance --key path) element_ynh_url="https://""$element_domain""$element_path" - #if [ -z "$element_domain" ]; then - # element_ynh_url="https://matrix.to/" fi - web_client_location=$element_ynh_url client_base_url=$element_ynh_url invite_client_location=$element_ynh_url diff --git a/scripts/upgrade b/scripts/upgrade index e4cc8115..13f47238 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -107,7 +107,7 @@ backup_before_upgrade=$(ynh_app_setting_get --app=$app --key=backup_before_upgra if [ -z $backup_before_upgrade ] ; then backup_before_upgrade="true" disable_backup_before_upgrade=$(ynh_app_setting_get --app=$app --key=disable_backup_before_upgrade) - if [ "0$disable_backup_before_upgrade" -ne 1 ]; then + if [ "0$disable_backup_before_upgrade" -ne 0 ]; then backup_before_upgrade="false" fi ynh_app_setting_set --app=$app --key=backup_before_upgrade --value=$backup_before_upgrade @@ -229,24 +229,27 @@ fi # SET STANDARD SETTINGS FROM DEFAULT CONFIG # Get app name of first Element Instance +element_ynh_url="https://matrix.to/" +element_domain="" +element_path="" +web_client_location=$element_ynh_url +client_base_url=$element_ynh_url +invite_client_location=$element_ynh_url +element_instance="element" if [ -z "$web_client_location" ] then - element_ynh_url="https://matrix.to/" - element_instance="element" if yunohost --output-as plain app list | grep -q "^$element_instance"'$'; then element_domain=$(ynh_app_setting_get --app $element_instance --key domain) element_path=$(ynh_app_setting_get --app $element_instance --key path) - #if [ -z "$element_domain" ]; then - #else element_ynh_url="https://""$element_domain""$element_path" fi web_client_location=$element_ynh_url client_base_url=$element_ynh_url invite_client_location=$element_ynh_url + ynh_app_setting_set --app=$app --key=web_client_location --value=$web_client_location + ynh_app_setting_set --app=$app --key=client_base_url --value=$client_base_url + ynh_app_setting_set --app=$app --key=invite_client_location --value=$invite_client_location fi -ynh_app_setting_set --app=$app --key=web_client_location --value=$web_client_location -ynh_app_setting_set --app=$app --key=client_base_url --value=$client_base_url -ynh_app_setting_set --app=$app --key=invite_client_location --value=$invite_client_location if [ -z "$server_statistics" ] then @@ -255,12 +258,12 @@ then fi if [ -z "$allow_public_rooms_without_auth" ] then - allow_public_rooms_without_auth=allow_public_rooms + allow_public_rooms_without_auth=$allow_public_rooms ynh_app_setting_set --app=$app --key=allow_public_rooms_without_auth --value=$allow_public_rooms_without_auth fi if [ -z "$allow_public_rooms_over_federation" ] then - allow_public_rooms_over_federation=allow_public_rooms + allow_public_rooms_over_federation=$allow_public_rooms ynh_app_setting_set --app=$app --key=allow_public_rooms_over_federation --value=$allow_public_rooms_over_federation fi if [ -z "$max_upload_size" ] From 3b9218c93fdca0403365c6e772597c7ae3838c08 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Thu, 6 Jul 2023 06:53:43 +0000 Subject: [PATCH 56/95] Update config --- scripts/config | 142 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 100 insertions(+), 42 deletions(-) diff --git a/scripts/config b/scripts/config index 5d1e8df1..ee622dcf 100644 --- a/scripts/config +++ b/scripts/config @@ -28,77 +28,135 @@ get__registrations_require_3pid() { echo "${registrations_require_3pid}" } +# set__registrations_require_3pid() this function is setting datas for registrations_require_3pid field and allowed_local_3pids_(email/msisdn) +# it consist on comment or not "registrations_require_3pid:", " - email" and/or " - msisdn" +# then depending on the "registrations_require_3pid" value it comment or not "allowed_local_3pids:" lines +# and generate all it sub configuration : +# +# allowed_local_3pids: +# - medium: email +# pattern: * +# ... +# - medium: msisdn +# pattern: * +# +# sed -z and \n as new line carracter do the trick on this kind of multline replacement. + set__registrations_require_3pid() { - # sed -z do the trick on this king of multline replacement - case ${registrations_require_3pid} in - email) - - sed -i -z -r "s|#?([^\S\n]*registrations_require_3pid:\n)#?([^\S\n]*-[^\S\n]*email\n)#?([^\S\n]*-[^\S\n]*msisdn)|\1\2#\3|" "/etc/matrix-$app/homeserver.yaml" - ;; - msisdn) - sed -i -z -r "s|#?([^\S\n]*registrations_require_3pid:\n)#?([^\S\n]*-[^\S\n]*email\n)#?([^\S\n]*-[^\S\n]*msisdn)|\1#\2\3|" "/etc/matrix-$app/homeserver.yaml" - ;; - 'email&msisdn') - sed -i -z -r "s|#?([^\S\n]*registrations_require_3pid:\n)#?([^\S\n]*-[^\S\n]*email\n)#?([^\S\n]*-[^\S\n]*msisdn)|\1\2\3|" "/etc/matrix-$app/homeserver.yaml" - ;; - *) - sed -i -z -r "s|#?([^\S\n]*registrations_require_3pid:\n)#?([^\S\n]*-[^\S\n]*email\n)#?([^\S\n]*-[^\S\n]*msisdn)|#\1#\2#\3|" "/etc/matrix-$app/homeserver.yaml" - ;; - esac - - ynh_app_setting_set --app=$app --key=registrations_require_3pid --value="${registrations_require_3pid}" + + # search pattern to replace (it correspond to the complete section) + allowedLocal3pids="s;#?([^\S\n]*allowed_local_3pids:)\n(#?([^\S\n]*-[^\S\n]*medium:[^\S\n]*(email|msisdn)\n)#?([^\S\n]*pattern:[^\S\n]*[^\n]*\n))*;" + + case ${registrations_require_3pid} in + 'email') + # registrations_require_3pid: part + sed -i -z -r "s|#?([^\S\n]*registrations_require_3pid:\n)#?([^\S\n]*-[^\S\n]*email\n)#?([^\S\n]*-[^\S\n]*msisdn)|\1\2#\3|" "/etc/matrix-$app/homeserver.yaml" + + # allowed_local_3pids: part + allowedLocal3pids=${allowedLocal3pids}"\1" + + readarray -td, arr3pidemail < <(echo ${allowed_local_3pids_email}); + for pidemail in "${arr3pidemail[@]}"; do + # add it to regex substitution part + allowedLocal3pids=${allowedLocal3pids}"\n - medium: email"; + allowedLocal3pids=${allowedLocal3pids}"\n pattern: '$(echo ${pidemail})'"; + done; + ;; + + 'msisdn') + # registrations_require_3pid: part + sed -i -z -r "s|#?([^\S\n]*registrations_require_3pid:\n)#?([^\S\n]*-[^\S\n]*email\n)#?([^\S\n]*-[^\S\n]*msisdn)|\1#\2\3|" "/etc/matrix-$app/homeserver.yaml" + + # allowed_local_3pids: part + allowedLocal3pids="${allowedLocal3pids}\1" + + readarray -td, arr3pidmsisdn < <(echo ${allowed_local_3pids_msisdn}); + for pidmsisdn in "${arr3pidmsisdn[@]}"; do + # add it to regex substitution part + allowedLocal3pids=${allowedLocal3pids}"\n - medium: msisdn"; + allowedLocal3pids=${allowedLocal3pids}"\n pattern: '$(echo ${pidmsisdn})'"; + done; + ;; + + 'email&msisdn') + # registrations_require_3pid: part + sed -i -z -r "s|#?([^\S\n]*registrations_require_3pid:\n)#?([^\S\n]*-[^\S\n]*email\n)#?([^\S\n]*-[^\S\n]*msisdn)|\1\2\3|" "/etc/matrix-$app/homeserver.yaml" + + # allowed_local_3pids: part + allowedLocal3pids="$(echo ${allowedLocal3pids})\1" + + readarray -td, arr3pidemail < <(echo ${allowed_local_3pids_email}); + for pidemail in "${arr3pidemail[@]}"; do + # add it to regex substitution part + allowedLocal3pids="$(echo ${allowedLocal3pids})\n - medium: email"; + allowedLocal3pids="$(echo ${allowedLocal3pids})\n pattern: '$(echo ${pidemail})'"; + done; + + readarray -td, arr3pidmsisdn < <(echo ${allowed_local_3pids_msisdn}); + for pidmsisdn in "${arr3pidmsisdn[@]}"; do + # add it to regex substitution part + allowedLocal3pids="$(echo ${allowedLocal3pids})\n - medium: msisdn"; + allowedLocal3pids="$(echo ${allowedLocal3pids})\n pattern: '$(echo ${pidmsisdn})'"; + done; + ;; + + *) + sed -i -z -r "s|#?([^\S\n]*registrations_require_3pid:\n)#?([^\S\n]*-[^\S\n]*email\n)#?([^\S\n]*-[^\S\n]*msisdn)|#\1#\2#\3|" "/etc/matrix-$app/homeserver.yaml"; + + # empty fields and comment registration + allowedLocal3pids="$(echo ${allowedLocal3pids})#\1" + ;; + esac + + # finalize regex then apply sed command on the homeserver conf file + allowedLocal3pids="$(echo ${allowedLocal3pids})\n;"; + sed -i -z -r "${allowedLocal3pids}" "/etc/matrix-$app/homeserver.yaml" + + + ynh_app_setting_set --app=$app --key=registrations_require_3pid --value="${registrations_require_3pid}" } get__allowed_local_3pids_email() { - allowed_local_3pids_email=$(ynh_app_setting_get --app $app --key allowed_local_3pids_email) - echo "${allowed_local_3pids_email}" + allowed_local_3pids_email=$(ynh_app_setting_get --app $app --key allowed_local_3pids_email) + echo "${allowed_local_3pids_email}" } set__allowed_local_3pids_email() { - if [ -z ${registrations_require_3pid} ] ; then - sed -i -z -r "s|#?([^\S\n]*allowed_local_3pids:\n)#?([^\S\n]*-[^\S\n]*medium: email\n)#?([^\S\n]*pattern:[^\S\n]*')([^']*)('\n)#?([^\S\n]*-[^\S\n]*medium: msisdn\n)#?([^\S\n]*pattern: ')([^']*)('?)|#\1#\2#\3\4\5#\6#\7\8\9|" "/etc/matrix-$app/homeserver.yaml" - else - sed -i -z -r "s|#?([^\S\n]*allowed_local_3pids:\n)#?([^\S\n]*-[^\S\n]*medium: email\n)#?([^\S\n]*pattern:[^\S\n]*')([^']*)('\n)#?([^\S\n]*-[^\S\n]*medium: msisdn\n)#?([^\S\n]*pattern: ')([^']*)('?)|\1#\2#\3EMAIL\5#\6#\7\8\9|" "/etc/matrix-$app/homeserver.yaml" - fi - + set__registrations_require_3pid; ynh_app_setting_set --app=$app --key=allowed_local_3pids_email --value="${allowed_local_3pids_email}" } get__allowed_local_3pids_msisdn() { - allowed_local_3pids_msisdn=$(ynh_app_setting_get --app $app --key allowed_local_3pids_msisdn) - echo "${allowed_local_3pids_msisdn}" + allowed_local_3pids_msisdn=$(ynh_app_setting_get --app $app --key allowed_local_3pids_msisdn) + echo "${allowed_local_3pids_msisdn}" } set__allowed_local_3pids_msisdn() { - if [ -z ${registrations_require_3pid} ] ; then - sed -i -z -r "s|#?([^\S\n]*allowed_local_3pids:\n)#?([^\S\n]*-[^\S\n]*medium: email\n)#?([^\S\n]*pattern:[^\S\n]*')([^']*)('\n)#?([^\S\n]*-[^\S\n]*medium: msisdn\n)#?([^\S\n]*pattern: ')([^']*)('?)|#\1#\2#\3\4\5#\6#\7\8\9|" "/etc/matrix-$app/homeserver.yaml" - else - sed -i -z -r "s|#?([^\S\n]*allowed_local_3pids:\n)#?([^\S\n]*-[^\S\n]*medium: email\n)#?([^\S\n]*pattern:[^\S\n]*')([^']*)('\n)#?([^\S\n]*-[^\S\n]*medium: msisdn\n)#?([^\S\n]*pattern: ')([^']*)('?)|\1#\2#\3\4\5#\6#\7MSISDN\9|" "/etc/matrix-$app/homeserver.yaml" - fi + set__registrations_require_3pid; ynh_app_setting_set --app=$app --key=allowed_local_3pids_msisdn --value="${allowed_local_3pids_msisdn}" } get__auto_join_rooms() { - auto_join_rooms=$(ynh_app_setting_get --app $app --key auto_join_rooms) - echo "${auto_join_rooms}" + auto_join_rooms=$(ynh_app_setting_get --app $app --key auto_join_rooms) + echo "${auto_join_rooms}" } set__auto_join_rooms() { if [ -z ${auto_join_rooms} ] ; then - # remove all values comment header ans example value - sed -i -z -r "s|#?([^\S\n]*auto_join_rooms:\n)#?([^\S\n]*-[^\S\n]*"[^\"]*"\n)*|#\1# - "#example:example.com"\n\n|" "/etc/matrix-$app/homeserver.yaml" + # remove all values comment header and example value + sed -i -z -r "s|#?([^\S\n]*auto_join_rooms:\n)#?([^\S\n]*-[^\n]*\n)*|#\1# - \"#example:example.com\"\n|" "/etc/matrix-$app/homeserver.yaml" else - IFS=' ' read -r -a arrroom <<< "${auto_join_rooms}"; + readarray -td, arrroom < <(echo ${auto_join_rooms}); # print header then all space separated values - myregex='s|#?([^\S\n]*auto_join_rooms:)#?([^\S\n]*-[^\S\n]*"[^\"]*"\n)*|#\1'; + autoJoinRooms="s|#?([^\S\n]*auto_join_rooms:)\n(#?[^\S\n]*-[^\n]*\n)*|\1"; for room in "${arrroom[@]}"; do - myregex="${myregex}\n - ${room}"; + autoJoinRooms="${autoJoinRooms}\n - '$(echo ${room})'"; done; - myregex="${myregex}\n\n|"; - sed -i -z -r "${myregex}" "/etc/matrix-$app/homeserver.yaml" + autoJoinRooms="${autoJoinRooms}\n|"; + sed -i -z -r "${autoJoinRooms}" "/etc/matrix-$app/homeserver.yaml" fi ynh_app_setting_set --app=$app --key=auto_join_rooms --value="${auto_join_rooms}" From 3a42d18fe2b89644b9b612a44a0c9a5a73e8477c Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Thu, 6 Jul 2023 07:00:28 +0000 Subject: [PATCH 57/95] Update config_panel.toml reverse update after understanding what return tags fields --- config_panel.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 530cf8e4..003a0601 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -34,19 +34,19 @@ services = ["matrix-__APP__"] [main.welcome.allowed_local_3pids_email] ask = "Register only with given email formats." type = "tags" - help = '^[^@]+@matrix\.org$' + help = '( e.g. ^[^@]+@matrix\.org$ ) ' visible = 'enable_registration && (registrations_require_3pid == "email" || registrations_require_3pid == "email&msisdn")' [main.welcome.allowed_local_3pids_msisdn] ask = "Register only with given phone number formats." type = "tags" - help = '\+33' + help = '( e.g. \+33)' visible = 'enable_registration && (registrations_require_3pid == "email&msisdn" || registrations_require_3pid == "msisdn")' [main.welcome.auto_join_rooms] ask = "Auto Join new Users in following Rooms:" type = "tags" - help = "Use space separated values (e.g: #example:example.com #example2:example2.com ). Users who register on this homeserver will automatically be joined to these rooms. If the room already exists, the join rule must be set to 'public'. See also next setting." + help = "( e.g. #example:example.com ). Users who register on this homeserver will automatically be joined to these rooms. If the room already exists, the join rule must be set to 'public'. See also next setting." bind = ":/etc/matrix-__APP__/homeserver.yaml" [main.welcome.autocreate_auto_join_rooms] From 05b8749c1ee22be0642958cef4c9717c0b2e65da Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Sun, 9 Jul 2023 13:29:41 +0000 Subject: [PATCH 58/95] Update config Done --- scripts/config | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/scripts/config b/scripts/config index ee622dcf..60012e5e 100644 --- a/scripts/config +++ b/scripts/config @@ -50,7 +50,7 @@ set__registrations_require_3pid() { case ${registrations_require_3pid} in 'email') # registrations_require_3pid: part - sed -i -z -r "s|#?([^\S\n]*registrations_require_3pid:\n)#?([^\S\n]*-[^\S\n]*email\n)#?([^\S\n]*-[^\S\n]*msisdn)|\1\2#\3|" "/etc/matrix-$app/homeserver.yaml" + sed -i -z -r "s|#?[^\S\n]*registrations_require_3pid:\n#?[^\S\n]*-[^\S\n]*email\n#?[^\S\n]*-[^\S\n]*msisdn|registrations_require_3pid:\n - email\n# - msisdn|" "/etc/matrix-$app/homeserver.yaml" # allowed_local_3pids: part allowedLocal3pids=${allowedLocal3pids}"\1" @@ -59,57 +59,57 @@ set__registrations_require_3pid() { for pidemail in "${arr3pidemail[@]}"; do # add it to regex substitution part allowedLocal3pids=${allowedLocal3pids}"\n - medium: email"; - allowedLocal3pids=${allowedLocal3pids}"\n pattern: '$(echo ${pidemail})'"; + allowedLocal3pids=${allowedLocal3pids}"\n$(echo ' ')pattern: '$(echo ${pidemail})'"; done; ;; 'msisdn') # registrations_require_3pid: part - sed -i -z -r "s|#?([^\S\n]*registrations_require_3pid:\n)#?([^\S\n]*-[^\S\n]*email\n)#?([^\S\n]*-[^\S\n]*msisdn)|\1#\2\3|" "/etc/matrix-$app/homeserver.yaml" + sed -i -z -r "s|#?[^\S\n]*registrations_require_3pid:\n#?[^\S\n]*-[^\S\n]*email\n#?[^\S\n]*-[^\S\n]*msisdn|registrations_require_3pid:\n# - email\n - msisdn|" "/etc/matrix-$app/homeserver.yaml" # allowed_local_3pids: part - allowedLocal3pids="${allowedLocal3pids}\1" + allowedLocal3pids=${allowedLocal3pids}"\1" readarray -td, arr3pidmsisdn < <(echo ${allowed_local_3pids_msisdn}); for pidmsisdn in "${arr3pidmsisdn[@]}"; do # add it to regex substitution part allowedLocal3pids=${allowedLocal3pids}"\n - medium: msisdn"; - allowedLocal3pids=${allowedLocal3pids}"\n pattern: '$(echo ${pidmsisdn})'"; + allowedLocal3pids=${allowedLocal3pids}"\n$(echo ' ')pattern: '$(echo ${pidmsisdn})'"; done; ;; 'email&msisdn') # registrations_require_3pid: part - sed -i -z -r "s|#?([^\S\n]*registrations_require_3pid:\n)#?([^\S\n]*-[^\S\n]*email\n)#?([^\S\n]*-[^\S\n]*msisdn)|\1\2\3|" "/etc/matrix-$app/homeserver.yaml" + sed -i -z -r "s|#?[^\S\n]*registrations_require_3pid:\n#?[^\S\n]*-[^\S\n]*email\n#?[^\S\n]*-[^\S\n]*msisdn|registrations_require_3pid:\n - email\n - msisdn|" "/etc/matrix-$app/homeserver.yaml" # allowed_local_3pids: part - allowedLocal3pids="$(echo ${allowedLocal3pids})\1" + allowedLocal3pids=${allowedLocal3pids}"\1" readarray -td, arr3pidemail < <(echo ${allowed_local_3pids_email}); for pidemail in "${arr3pidemail[@]}"; do # add it to regex substitution part - allowedLocal3pids="$(echo ${allowedLocal3pids})\n - medium: email"; - allowedLocal3pids="$(echo ${allowedLocal3pids})\n pattern: '$(echo ${pidemail})'"; + allowedLocal3pids=${allowedLocal3pids}"\n - medium: email"; + allowedLocal3pids=${allowedLocal3pids}"\n$(echo ' ')pattern: '$(echo ${pidemail})'"; done; readarray -td, arr3pidmsisdn < <(echo ${allowed_local_3pids_msisdn}); for pidmsisdn in "${arr3pidmsisdn[@]}"; do # add it to regex substitution part - allowedLocal3pids="$(echo ${allowedLocal3pids})\n - medium: msisdn"; - allowedLocal3pids="$(echo ${allowedLocal3pids})\n pattern: '$(echo ${pidmsisdn})'"; + allowedLocal3pids=${allowedLocal3pids}"\n - medium: msisdn"; + allowedLocal3pids=${allowedLocal3pids}"\n$(echo ' ')pattern: '$(echo ${pidmsisdn})'"; done; ;; *) - sed -i -z -r "s|#?([^\S\n]*registrations_require_3pid:\n)#?([^\S\n]*-[^\S\n]*email\n)#?([^\S\n]*-[^\S\n]*msisdn)|#\1#\2#\3|" "/etc/matrix-$app/homeserver.yaml"; + sed -i -z -r "s|#?[^\S\n]*registrations_require_3pid:\n#?[^\S\n]*-[^\S\n]*email\n#?[^\S\n]*-[^\S\n]*msisdn|#registrations_require_3pid:\n# - email\n# - msisdn|" "/etc/matrix-$app/homeserver.yaml" # empty fields and comment registration - allowedLocal3pids="$(echo ${allowedLocal3pids})#\1" + allowedLocal3pids=${allowedLocal3pids}"#\1" ;; esac # finalize regex then apply sed command on the homeserver conf file - allowedLocal3pids="$(echo ${allowedLocal3pids})\n;"; + allowedLocal3pids="${allowedLocal3pids}\n;"; sed -i -z -r "${allowedLocal3pids}" "/etc/matrix-$app/homeserver.yaml" From c77c1eb6a40551a4d3804a349afa9f14d1f3b8cc Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Mon, 10 Jul 2023 08:03:48 +0000 Subject: [PATCH 59/95] Update config_panel.toml auto_join_rooms backslash seems to be required to escape the # in the room list \#example:example.com --- config_panel.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_panel.toml b/config_panel.toml index 003a0601..06f03e46 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -46,7 +46,7 @@ services = ["matrix-__APP__"] [main.welcome.auto_join_rooms] ask = "Auto Join new Users in following Rooms:" type = "tags" - help = "( e.g. #example:example.com ). Users who register on this homeserver will automatically be joined to these rooms. If the room already exists, the join rule must be set to 'public'. See also next setting." + help = "( e.g. \#example:example.com ). Users who register on this homeserver will automatically be joined to these rooms. If the room already exists, the join rule must be set to 'public'. See also next setting." bind = ":/etc/matrix-__APP__/homeserver.yaml" [main.welcome.autocreate_auto_join_rooms] From cb1f43ed2e89037aa84250f91dbae036ae3eb8ee Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Mon, 10 Jul 2023 08:06:13 +0000 Subject: [PATCH 60/95] Update install auto_join_rooms add backslash to escape # --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index c58a37a1..24c12620 100644 --- a/scripts/install +++ b/scripts/install @@ -135,7 +135,7 @@ allowed_local_3pids_email="'^[^@]+@""matrix""\.org$'" allowed_local_3pids_msisdn="'\+33'" allow_guest_access="false" default_identity_server="https://matrix.org" -auto_join_rooms="#auto_join_room:""$server_name" +auto_join_rooms="\#auto_join_room:""$server_name" autocreate_auto_join_rooms="false" auto_join_rooms_for_guests="true" password_enabled="true" From 50b41da1dcd0479976ec38aca3636deac15da36d Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Mon, 10 Jul 2023 08:07:34 +0000 Subject: [PATCH 61/95] Update upgrade auto_join_rooms add backslash to escape # --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 13f47238..6a59c026 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -303,7 +303,7 @@ then fi if [ -z "$auto_join_rooms" ] then - auto_join_rooms="#auto_join_room:""$server_name" + auto_join_rooms="\#auto_join_room:""$server_name" ynh_app_setting_set --app=$app --key=auto_join_rooms --value=$auto_join_rooms fi if [ -z "$autocreate_auto_join_rooms" ] From 544d5b84f576ddeff7c0d43f215fdd5e02aebe49 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Mon, 10 Jul 2023 08:10:12 +0000 Subject: [PATCH 62/95] Update homeserver.yaml edit config to match the getter/setter usage --- conf/homeserver.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/homeserver.yaml b/conf/homeserver.yaml index 0a220c33..42c0d0cb 100644 --- a/conf/homeserver.yaml +++ b/conf/homeserver.yaml @@ -1272,8 +1272,8 @@ enable_registration: __ENABLE_REGISTRATION__ # The user must provide all of the below types of 3PID when registering. # registrations_require_3pid: - - __REGISTRATIONS_REQUIRE_3PID__ -# - msisdn + - email +# - msisdn # Explicitly disable asking for MSISDNs from the registration # flow (overrides registrations_require_3pid if MSISDNs are set as required) @@ -1393,7 +1393,7 @@ account_threepid_delegates: # room. The join rule of the room must be set to 'public'. # auto_join_rooms: - - "__AUTO_JOIN_ROOMS__" + - "#example:example.com" # Where auto_join_rooms are specified, setting this flag ensures that the # the rooms exist by creating them when the first user on the From 74c213b3d2a829017fa00325116d099f6efcd22b Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Sat, 15 Jul 2023 02:34:05 +0200 Subject: [PATCH 63/95] Update config_panel.toml see https://toml.io/en/v1.0.0#comment --- config_panel.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_panel.toml b/config_panel.toml index 06f03e46..003a0601 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -46,7 +46,7 @@ services = ["matrix-__APP__"] [main.welcome.auto_join_rooms] ask = "Auto Join new Users in following Rooms:" type = "tags" - help = "( e.g. \#example:example.com ). Users who register on this homeserver will automatically be joined to these rooms. If the room already exists, the join rule must be set to 'public'. See also next setting." + help = "( e.g. #example:example.com ). Users who register on this homeserver will automatically be joined to these rooms. If the room already exists, the join rule must be set to 'public'. See also next setting." bind = ":/etc/matrix-__APP__/homeserver.yaml" [main.welcome.autocreate_auto_join_rooms] From 154ca11d003cbe420b42f3130097dd7954397ad2 Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Sat, 15 Jul 2023 02:51:09 +0200 Subject: [PATCH 64/95] replace "\# with "# --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 24c12620..c58a37a1 100644 --- a/scripts/install +++ b/scripts/install @@ -135,7 +135,7 @@ allowed_local_3pids_email="'^[^@]+@""matrix""\.org$'" allowed_local_3pids_msisdn="'\+33'" allow_guest_access="false" default_identity_server="https://matrix.org" -auto_join_rooms="\#auto_join_room:""$server_name" +auto_join_rooms="#auto_join_room:""$server_name" autocreate_auto_join_rooms="false" auto_join_rooms_for_guests="true" password_enabled="true" diff --git a/scripts/upgrade b/scripts/upgrade index 6a59c026..13f47238 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -303,7 +303,7 @@ then fi if [ -z "$auto_join_rooms" ] then - auto_join_rooms="\#auto_join_room:""$server_name" + auto_join_rooms="#auto_join_room:""$server_name" ynh_app_setting_set --app=$app --key=auto_join_rooms --value=$auto_join_rooms fi if [ -z "$autocreate_auto_join_rooms" ] From c17d50bb2b3bfbe417f19082d8e49422e4590e5a Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Sat, 15 Jul 2023 03:58:54 +0200 Subject: [PATCH 65/95] help \\\ for user \\ to write \ --- config_panel.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 003a0601..04a274f4 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -34,13 +34,13 @@ services = ["matrix-__APP__"] [main.welcome.allowed_local_3pids_email] ask = "Register only with given email formats." type = "tags" - help = '( e.g. ^[^@]+@matrix\.org$ ) ' + help = '( e.g. ^[^@]+@matrix\\\.org$ ) Note that \\\ will write \\ in homeserver.yaml' visible = 'enable_registration && (registrations_require_3pid == "email" || registrations_require_3pid == "email&msisdn")' [main.welcome.allowed_local_3pids_msisdn] ask = "Register only with given phone number formats." type = "tags" - help = '( e.g. \+33)' + help = '( e.g. \\\+33 ) Note that \\\ will write \\ in homeserver.yaml' visible = 'enable_registration && (registrations_require_3pid == "email&msisdn" || registrations_require_3pid == "msisdn")' [main.welcome.auto_join_rooms] From 9b6641ddbbf62cc036fc5bb80bfe112be18cacf5 Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Sat, 15 Jul 2023 14:09:20 +0200 Subject: [PATCH 66/95] correct help \\\\+ to write \\+ --- config_panel.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 04a274f4..8ae65f20 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -34,13 +34,13 @@ services = ["matrix-__APP__"] [main.welcome.allowed_local_3pids_email] ask = "Register only with given email formats." type = "tags" - help = '( e.g. ^[^@]+@matrix\\\.org$ ) Note that \\\ will write \\ in homeserver.yaml' + help = '( e.g. ^[^@]+@matrix\\\\.org$ ) Note that \\\ will write \\ in homeserver.yaml' visible = 'enable_registration && (registrations_require_3pid == "email" || registrations_require_3pid == "email&msisdn")' [main.welcome.allowed_local_3pids_msisdn] ask = "Register only with given phone number formats." type = "tags" - help = '( e.g. \\\+33 ) Note that \\\ will write \\ in homeserver.yaml' + help = '( e.g. \\\\+33 ) Note that \\\ will write \\ in homeserver.yaml' visible = 'enable_registration && (registrations_require_3pid == "email&msisdn" || registrations_require_3pid == "msisdn")' [main.welcome.auto_join_rooms] From 2e4e56ba1c22813d44b3db4e440b787123d6c8ff Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Fri, 21 Jul 2023 19:04:11 +0000 Subject: [PATCH 67/95] Update config_panel.toml --- config_panel.toml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 8ae65f20..b110fa9c 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -34,21 +34,20 @@ services = ["matrix-__APP__"] [main.welcome.allowed_local_3pids_email] ask = "Register only with given email formats." type = "tags" - help = '( e.g. ^[^@]+@matrix\\\\.org$ ) Note that \\\ will write \\ in homeserver.yaml' + help = '( e.g. ^[^@]+@matrix\\.org$ ) Note that \\ will write \ in homeserver.yaml' visible = 'enable_registration && (registrations_require_3pid == "email" || registrations_require_3pid == "email&msisdn")' [main.welcome.allowed_local_3pids_msisdn] ask = "Register only with given phone number formats." type = "tags" - help = '( e.g. \\\\+33 ) Note that \\\ will write \\ in homeserver.yaml' + help = '( e.g. \\+33 ) Note that \\ will write \ in homeserver.yaml' visible = 'enable_registration && (registrations_require_3pid == "email&msisdn" || registrations_require_3pid == "msisdn")' [main.welcome.auto_join_rooms] ask = "Auto Join new Users in following Rooms:" type = "tags" - help = "( e.g. #example:example.com ). Users who register on this homeserver will automatically be joined to these rooms. If the room already exists, the join rule must be set to 'public'. See also next setting." - bind = ":/etc/matrix-__APP__/homeserver.yaml" - + help = "( e.g. \#example:example.com ) Note that \# will write # in homeserver.yaml. Users who register on this homeserver will automatically be joined to these rooms. If the room already exists, the join rule must be set to 'public'. See also next setting." + [main.welcome.autocreate_auto_join_rooms] ask = "Auto-Create room for Auto Join if not existing?" type = "boolean" From 086a58a74dfc335cc56a9c4951187760752b0394 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Fri, 21 Jul 2023 19:08:34 +0000 Subject: [PATCH 68/95] Update config escape old values starting with # by \# and eventually \*# by \# too --- scripts/config | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/config b/scripts/config index 60012e5e..59ce2f8e 100644 --- a/scripts/config +++ b/scripts/config @@ -138,6 +138,7 @@ set__allowed_local_3pids_msisdn() { get__auto_join_rooms() { auto_join_rooms=$(ynh_app_setting_get --app $app --key auto_join_rooms) + auto_join_rooms=$(echo ${auto_join_rooms} | sed "s~(\\\\)*\#~\\\\\#~g") echo "${auto_join_rooms}" } From f6c284a4aaebaf4ff8a3386b4a88604363139110 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Fri, 21 Jul 2023 19:29:43 +0000 Subject: [PATCH 69/95] Update install in my opinion --- scripts/install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index c58a37a1..5895783e 100644 --- a/scripts/install +++ b/scripts/install @@ -129,10 +129,10 @@ allow_public_rooms_without_auth="false" allow_public_rooms_over_federation="false" max_upload_size="10M" disable_msisdn_registration="true" -registrations_require_3pid="email" +registrations_require_3pid="false" # here we need sed magic to transform $server_name -allowed_local_3pids_email="'^[^@]+@""matrix""\.org$'" -allowed_local_3pids_msisdn="'\+33'" +allowed_local_3pids_email="" +allowed_local_3pids_msisdn="" allow_guest_access="false" default_identity_server="https://matrix.org" auto_join_rooms="#auto_join_room:""$server_name" From 86a92731c67befb942b484cfce248d3d06d3b3fd Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Tue, 25 Jul 2023 22:26:02 +0200 Subject: [PATCH 70/95] Update config_panel.toml --- config_panel.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index b110fa9c..03840447 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -34,19 +34,19 @@ services = ["matrix-__APP__"] [main.welcome.allowed_local_3pids_email] ask = "Register only with given email formats." type = "tags" - help = '( e.g. ^[^@]+@matrix\\.org$ ) Note that \\ will write \ in homeserver.yaml' + help = '( e.g. ^[^@]+@matrix.org$ ) Note that this syntax is OK even though ^[^@]+@matrix\\.org$ is suggested in homeserver.yaml' visible = 'enable_registration && (registrations_require_3pid == "email" || registrations_require_3pid == "email&msisdn")' [main.welcome.allowed_local_3pids_msisdn] ask = "Register only with given phone number formats." type = "tags" - help = '( e.g. \\+33 ) Note that \\ will write \ in homeserver.yaml' + help = '( e.g. \\\\+33 ) Note that \\\\ will write \\\ in homeserver.yaml' visible = 'enable_registration && (registrations_require_3pid == "email&msisdn" || registrations_require_3pid == "msisdn")' [main.welcome.auto_join_rooms] ask = "Auto Join new Users in following Rooms:" type = "tags" - help = "( e.g. \#example:example.com ) Note that \# will write # in homeserver.yaml. Users who register on this homeserver will automatically be joined to these rooms. If the room already exists, the join rule must be set to 'public'. See also next setting." + help = "( e.g. \\\\#example:example.com ) Note that \\\\# will write # in homeserver.yaml. Users who register on this homeserver will automatically be joined to these rooms. If the room already exists, the join rule must be set to 'public'. See also next setting." [main.welcome.autocreate_auto_join_rooms] ask = "Auto-Create room for Auto Join if not existing?" From 9f585ffcd62a927e93f60a3f646c156012961e7c Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Wed, 26 Jul 2023 10:27:35 +0200 Subject: [PATCH 71/95] Update config_panel.toml --- config_panel.toml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 03840447..010cd38e 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -43,6 +43,15 @@ services = ["matrix-__APP__"] help = '( e.g. \\\\+33 ) Note that \\\\ will write \\\ in homeserver.yaml' visible = 'enable_registration && (registrations_require_3pid == "email&msisdn" || registrations_require_3pid == "msisdn")' + [main.welcome.disable_msisdn_registration] + ask = "Disable asking Phone Number in Registration flow." + type = "boolean" + yes = true + no = false + help = "Overrides 3PID settings if MSISDNs are set as required." + bind = ":/etc/matrix-__APP__/homeserver.yaml" + visible = "enable_registration" + [main.welcome.auto_join_rooms] ask = "Auto Join new Users in following Rooms:" type = "tags" @@ -91,15 +100,6 @@ services = ["matrix-__APP__"] help = "Disabled by default. If disabled, users on other homeserver will not be able to look for a public room on your homeserver. They will have to type the ID of the room to join." bind = ":/etc/matrix-__APP__/homeserver.yaml" - [main.privacy.disable_msisdn_registration] - ask = "Disable asking Phone Number in Registration flow." - type = "boolean" - yes = true - no = false - help = "Overrides 3PID settings if MSISDNs are set as required." - bind = ":/etc/matrix-__APP__/homeserver.yaml" - visible = "enable_registration" - [main.privacy.push_include_content] ask = "Disable content sharing inside push notification." type = "boolean" From 96e125a103f07edc3e079c3cd8ace553f7360a7b Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Wed, 26 Jul 2023 11:13:55 +0200 Subject: [PATCH 72/95] Update config_panel.toml --- config_panel.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_panel.toml b/config_panel.toml index 010cd38e..bcfe8723 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -40,7 +40,7 @@ services = ["matrix-__APP__"] [main.welcome.allowed_local_3pids_msisdn] ask = "Register only with given phone number formats." type = "tags" - help = '( e.g. \\\\+33 ) Note that \\\\ will write \\\ in homeserver.yaml' + help = '( e.g. \\\\+33 ) Note that \\\\ will write \\ in homeserver.yaml' visible = 'enable_registration && (registrations_require_3pid == "email&msisdn" || registrations_require_3pid == "msisdn")' [main.welcome.disable_msisdn_registration] From 9d4c9ab292eb909a6104f7f4dba523025a30dccf Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Mon, 31 Jul 2023 02:03:22 +0200 Subject: [PATCH 73/95] \\\ will write \\ --- config_panel.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index bcfe8723..762c6a81 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -34,13 +34,13 @@ services = ["matrix-__APP__"] [main.welcome.allowed_local_3pids_email] ask = "Register only with given email formats." type = "tags" - help = '( e.g. ^[^@]+@matrix.org$ ) Note that this syntax is OK even though ^[^@]+@matrix\\.org$ is suggested in homeserver.yaml' + help = '( e.g. ^[^@]+@matrix\\\\.org$ ) Note that \\\ will write \\ as suggested in homeserver.yaml' visible = 'enable_registration && (registrations_require_3pid == "email" || registrations_require_3pid == "email&msisdn")' [main.welcome.allowed_local_3pids_msisdn] ask = "Register only with given phone number formats." type = "tags" - help = '( e.g. \\\\+33 ) Note that \\\\ will write \\ in homeserver.yaml' + help = '( e.g. \\\\+33 ) Note that \\\ will write \\ as suggested in homeserver.yaml' visible = 'enable_registration && (registrations_require_3pid == "email&msisdn" || registrations_require_3pid == "msisdn")' [main.welcome.disable_msisdn_registration] @@ -105,7 +105,7 @@ services = ["matrix-__APP__"] type = "boolean" yes = true no = false - help = "Send content message and sender infromation in push notification. Set to false increase privacy when GAFAM notification service is used (ie: when element client is downloaded thrue Gplay store)." + help = "Send content message and sender information in push notification. Set to false increase privacy when GAFAM notification service is used (ie: when element client is downloaded thrue Gplay store)." bind = "push>include_content:/etc/matrix-__APP__/homeserver.yaml" [main.experience] From a962f7e09fa495faceb6223290feb9ea999c7cac Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Sun, 13 Aug 2023 18:47:19 +0200 Subject: [PATCH 74/95] double quotes --- config_panel.toml | 64 +++++++++++++++++++++++------------------------ scripts/install | 2 +- scripts/upgrade | 2 +- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 762c6a81..5af07ab3 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -10,16 +10,16 @@ services = ["matrix-__APP__"] [main.welcome.enable_registration] ask = "Enable Registration for new users." type = "boolean" - yes = true - no = false + yes = "true" + no = "false" help = "Defaults to 'false'. If 'true', it is highly recommended to use either captcha, email, or token-based verification to avoid SPAM." bind = ":/etc/matrix-__APP__/homeserver.yaml" [main.welcome.password_enabled] ask = "Enable Password Login?" type = "boolean" - yes = true - no = false + yes = "true" + no = "false" help = "If disabled, Login with Non-YunoHost Users impossible. But it simplies Login process if your Matrix server only has YunoHost SSO Users." bind = "password_config>enabled:/etc/matrix-__APP__/homeserver.yaml" visible = "! enable_registration" @@ -46,8 +46,8 @@ services = ["matrix-__APP__"] [main.welcome.disable_msisdn_registration] ask = "Disable asking Phone Number in Registration flow." type = "boolean" - yes = true - no = false + yes = "true" + no = "false" help = "Overrides 3PID settings if MSISDNs are set as required." bind = ":/etc/matrix-__APP__/homeserver.yaml" visible = "enable_registration" @@ -60,16 +60,16 @@ services = ["matrix-__APP__"] [main.welcome.autocreate_auto_join_rooms] ask = "Auto-Create room for Auto Join if not existing?" type = "boolean" - yes = true - no = false + yes = "true" + no = "false" help = "Setting to false means that if the rooms are not manually created, users cannot be auto-joined. Auto-created rooms will be public and federated by default, this can be customised in CLI with the settings auto_join_*." bind = ":/etc/matrix-__APP__/homeserver.yaml" [main.welcome.notif_for_new_users] ask = "Enable email notifications for new users?" type = "boolean" - yes = true - no = false + yes = "true" + no = "false" help = "Defaults to 'true'." bind = ":/etc/matrix-__APP__/homeserver.yaml" visible = "enable_notifs" @@ -95,16 +95,16 @@ services = ["matrix-__APP__"] [main.privacy.allow_public_rooms_over_federation] ask = "Access Public Rooms Directory over Federation?" type = "boolean" - yes = true - no = false + yes = "true" + no = "false" help = "Disabled by default. If disabled, users on other homeserver will not be able to look for a public room on your homeserver. They will have to type the ID of the room to join." bind = ":/etc/matrix-__APP__/homeserver.yaml" [main.privacy.push_include_content] ask = "Disable content sharing inside push notification." type = "boolean" - yes = true - no = false + yes = "true" + no = "false" help = "Send content message and sender information in push notification. Set to false increase privacy when GAFAM notification service is used (ie: when element client is downloaded thrue Gplay store)." bind = "push>include_content:/etc/matrix-__APP__/homeserver.yaml" @@ -120,16 +120,16 @@ services = ["matrix-__APP__"] [main.experience.enable_group_creation] ask = "Allow non-server-admin Users to create Spaces?" type = "boolean" - yes = true - no = false + yes = "true" + no = "false" help = "Disabled by default: only server admins can create Spaces" bind = ":/etc/matrix-__APP__/homeserver.yaml" [main.experience.enable_notifs] ask = "Enable sending emails for messages the user missed?" type = "boolean" - yes = true - no = false + yes = "true" + no = "false" help = "Defaults to 'false'." bind = ":/etc/matrix-__APP__/homeserver.yaml" @@ -172,15 +172,15 @@ services = ["matrix-__APP__"] [advanced.others.backup_before_upgrade] ask = "Backup before upgrade?" type = "boolean" - yes = true - no = false + yes = "true" + no = "false" help = "!! If disabled, do a manual backup before upgrade !! Disable if your Synapse instance is huge and you prefer to disable the backup that is normally automatically done before each upgrade." [advanced.others.server_statistics] ask = "Server statistics" type = "boolean" - yes = true - no = false + yes = "true" + no = "false" help = "Enable to send anonymous statistics to Synapse Developers to improve performance." bind = "report_stats:/etc/matrix-__APP__/homeserver.yaml" @@ -196,16 +196,16 @@ services = ["matrix-__APP__"] [advanced.guests.allow_guest_access] ask = "Allow Users to Register as Guests?" type = "boolean" - yes = true - no = false + yes = "true" + no = "false" help = "Guests can participate on this server in rooms with guest access enabled, without a password/email/etc." bind = ":/etc/matrix-__APP__/homeserver.yaml" [advanced.guests.auto_join_rooms_for_guests] ask = "Enable Auto Join Room for Guests?" type = "boolean" - yes = true - no = false + yes = "true" + no = "false" help = "Defaults to 'true'." bind = ":/etc/matrix-__APP__/homeserver.yaml" visible = "allow_guest_access" @@ -216,8 +216,8 @@ services = ["matrix-__APP__"] [advanced.privacy.enable_3pid_lookup] ask = "Allow discovering friends with phone number or email?" type = "boolean" - yes = true - no = false + yes = "true" + no = "false" help = "Enable 3PIDs lookup requests to identity servers from this server. See Settings->General->Discovery in Element." bind = ":/etc/matrix-__APP__/homeserver.yaml" @@ -230,8 +230,8 @@ services = ["matrix-__APP__"] [advanced.privacy.allow_public_rooms_without_auth] ask = "Access Public Rooms Directory without authentification?" type = "boolean" - yes = true - no = false + yes = "true" + no = "false" help = "Disabled by default. If enabled, anyone can query the Public Rooms Directory (access through the client API). This only makes sense if you want everyone to be able to scroll your public room to see what's interesting on your Homeserver" bind = ":/etc/matrix-__APP__/homeserver.yaml" @@ -247,7 +247,7 @@ services = ["matrix-__APP__"] [advanced.registration.turn_allow_guests] ask = "Should guests be allowed to use the TURN server?" type = "boolean" - yes = true - no = false + yes = "true" + no = "false" help = "This defaults to True, otherwise VoIP will be unreliable for guests. However, it does introduce a slight security risk as it allows users to connect to arbitrary endpoints without having first signed up for a valid account (e.g. by passing a CAPTCHA)." bind = ":/etc/matrix-__APP__/homeserver.yaml" diff --git a/scripts/install b/scripts/install index 5895783e..90ca25ee 100644 --- a/scripts/install +++ b/scripts/install @@ -86,7 +86,7 @@ ynh_app_setting_set --app=$app --key=report_stats --value=$report_stats ynh_app_setting_set --app=$app --key=e2e_enabled_by_default --value=$e2e_enabled_by_default ynh_app_setting_set --app=$app --key=synapse_user_app_pwd --value=$synapse_user_app_pwd -if [ $is_free_registration -eq 0 ] +if [ "$is_free_registration" -eq "0" ] then enable_registration="false" turn_allow_guests="false" diff --git a/scripts/upgrade b/scripts/upgrade index 13f47238..8fb40205 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -334,7 +334,7 @@ fi if [ -z "$enable_registration" ] then - if [ $is_free_registration -eq 0 ] + if [ "$is_free_registration" -eq "0" ] then enable_registration="false" turn_allow_guests="false" From 93b8dc656110c050822467dd38441ed1ad91e6ea Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Mon, 21 Aug 2023 20:12:19 +0000 Subject: [PATCH 75/95] add msisdn delegates parameter # As email delegates is managed by the synapse server itself this email section is # deprecated but msisdn format is still composed by email: on a new line --- conf/homeserver.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/conf/homeserver.yaml b/conf/homeserver.yaml index 42c0d0cb..be5bfcc2 100644 --- a/conf/homeserver.yaml +++ b/conf/homeserver.yaml @@ -1356,7 +1356,9 @@ default_identity_server: __DEFAULT_IDENTITY_SERVER__ # by the Matrix Identity Service API specification: # https://matrix.org/docs/spec/identity_service/latest # -account_threepid_delegates: +# As email delegates is managed by the synapse server itself this email section is +# deprecated but msisdn format is still composed by email: on a new line +account_threepid_delegates: __ACCOUNT_THREEPID_DELEGATES_MSISDN__ #email: https://example.com # Delegate email sending to example.com #msisdn: http://localhost:8090 # Delegate SMS sending to this local process From f89060f1904472956807564cf19658a114d8a908 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Mon, 21 Aug 2023 20:30:00 +0000 Subject: [PATCH 76/95] add msisdn third party server condifuration for SMS otp --- config_panel.toml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/config_panel.toml b/config_panel.toml index 5af07ab3..cb1dfc23 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -28,7 +28,7 @@ services = ["matrix-__APP__"] ask = "Registration requires all following 3PID personal identifier." type = "select" choices = ["false","email", "msisdn", "email&msisdn"] - help = "Defaults to: 'email'. Phone number: 'msisdn'" + help = "! warning msisdn (Phone number) registration require a third party service which send confirmation token by SMS do not select any option including msisdn if you don't know what to do.\nDefaults to: 'email'." visible = "enable_registration" [main.welcome.allowed_local_3pids_email] @@ -51,6 +51,13 @@ services = ["matrix-__APP__"] help = "Overrides 3PID settings if MSISDNs are set as required." bind = ":/etc/matrix-__APP__/homeserver.yaml" visible = "enable_registration" + + [main.welcome.account_threepid_delegates_msisdn] + ask = "specify a third party server to send confirmation code by SMS." + type = "string" + help = "! Mandatory for msisdn registration. Specify here the server which will send the configmation token by SMS (synapse can not do it for now). it mus be preced by '\n msisdn: ' then the url of the server (for now)" + bind = ":/etc/matrix-__APP__/homeserver.yaml" + visible = 'enable_registration && (registrations_require_3pid == "email&msisdn" || registrations_require_3pid == "msisdn")' [main.welcome.auto_join_rooms] ask = "Auto Join new Users in following Rooms:" From 3f739251d925f5de7c32c721ae803f663314cb63 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Mon, 21 Aug 2023 20:32:11 +0000 Subject: [PATCH 77/95] little update --- conf/homeserver.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conf/homeserver.yaml b/conf/homeserver.yaml index be5bfcc2..4c968247 100644 --- a/conf/homeserver.yaml +++ b/conf/homeserver.yaml @@ -1358,7 +1358,8 @@ default_identity_server: __DEFAULT_IDENTITY_SERVER__ # # As email delegates is managed by the synapse server itself this email section is # deprecated but msisdn format is still composed by email: on a new line -account_threepid_delegates: __ACCOUNT_THREEPID_DELEGATES_MSISDN__ +account_threepid_delegates: + __ACCOUNT_THREEPID_DELEGATES_MSISDN__ #email: https://example.com # Delegate email sending to example.com #msisdn: http://localhost:8090 # Delegate SMS sending to this local process From 3ec12e3761df79fc5af6806a301ae598e0cedb9d Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Mon, 21 Aug 2023 20:34:35 +0000 Subject: [PATCH 78/95] little update --- config_panel.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_panel.toml b/config_panel.toml index cb1dfc23..f6ea3866 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -55,7 +55,7 @@ services = ["matrix-__APP__"] [main.welcome.account_threepid_delegates_msisdn] ask = "specify a third party server to send confirmation code by SMS." type = "string" - help = "! Mandatory for msisdn registration. Specify here the server which will send the configmation token by SMS (synapse can not do it for now). it mus be preced by '\n msisdn: ' then the url of the server (for now)" + help = "! Mandatory for msisdn registration. Specify here the server which will send the configmation token by SMS (synapse can not do it for now). it mus be preced by 'msisdn: ' then the url of the server (for now)" bind = ":/etc/matrix-__APP__/homeserver.yaml" visible = 'enable_registration && (registrations_require_3pid == "email&msisdn" || registrations_require_3pid == "msisdn")' From 9258436e9f54662480bf3155fcafd8c1b4387bb2 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Mon, 21 Aug 2023 20:40:32 +0000 Subject: [PATCH 79/95] add account_threepid_delegates_msisdn default config --- scripts/install | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/install b/scripts/install index 90ca25ee..ed872f0e 100644 --- a/scripts/install +++ b/scripts/install @@ -134,6 +134,8 @@ registrations_require_3pid="false" allowed_local_3pids_email="" allowed_local_3pids_msisdn="" allow_guest_access="false" +allow_guest_access="false" +account_threepid_delegates_msisdn="#email: " default_identity_server="https://matrix.org" auto_join_rooms="#auto_join_room:""$server_name" autocreate_auto_join_rooms="false" @@ -156,6 +158,7 @@ ynh_app_setting_set --app=$app --key=disable_msisdn_registration --value=$disabl ynh_app_setting_set --app=$app --key=registrations_require_3pid --value=$registrations_require_3pid ynh_app_setting_set --app=$app --key=allowed_local_3pids_email --value=$allowed_local_3pids_email ynh_app_setting_set --app=$app --key=allowed_local_3pids_msisdn --value=$allowed_local_3pids_msisdn +ynh_app_setting_set --app=$app --key=account_threepid_delegates_msisdn --value=$account_threepid_delegates_msisdn ynh_app_setting_set --app=$app --key=allow_guest_access --value=$allow_guest_access ynh_app_setting_set --app=$app --key=default_identity_server --value=$default_identity_server ynh_app_setting_set --app=$app --key=auto_join_rooms --value=$auto_join_rooms From ce6ad24a3c4a069cd3a5438b68d7bfb04e9ef15c Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Mon, 21 Aug 2023 20:45:22 +0000 Subject: [PATCH 80/95] add account_threepid_delegates_msisdn configuration --- scripts/upgrade | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 8fb40205..d5083eae 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -73,6 +73,7 @@ disable_msisdn_registration=$(ynh_app_setting_get --app=$app --key=disable_msisd registrations_require_3pid=$(ynh_app_setting_get --app=$app --key=registrations_require_3pid) allowed_local_3pids_email=$(ynh_app_setting_get --app=$app --key=allowed_local_3pids_email) allowed_local_3pids_msisdn=$(ynh_app_setting_get --app=$app --key=allowed_local_3pids_msisdn) +account_threepid_delegates_msisdn=$(ynh_app_setting_get --app=$app --key=account_threepid_delegates_msisdn) allow_guest_access=$(ynh_app_setting_get --app=$app --key=allow_guest_access) default_identity_server=$(ynh_app_setting_get --app=$app --key=default_identity_server) auto_join_rooms=$(ynh_app_setting_get --app=$app --key=auto_join_rooms) @@ -291,6 +292,11 @@ then allowed_local_3pids_msisdn="'\+33'" ynh_app_setting_set --app=$app --key=allowed_local_3pids_msisdn --value=$allowed_local_3pids_msisdn fi +if [ -z "$account_threepid_delegates_msisdn" ] +then + account_threepid_delegates_msisdn="#email:" + ynh_app_setting_set --app=$app --key=account_threepid_delegates_msisdn --value=$account_threepid_delegates_msisdn +fi if [ -z "$allow_guest_access" ] then allow_guest_access="false" From 6dd8dcdcdebe5ae74c4fd623fd86b1fb3c89c742 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Mon, 21 Aug 2023 21:39:33 +0000 Subject: [PATCH 81/95] Update upgrade my bad --- scripts/upgrade | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index d5083eae..6aa49696 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -73,7 +73,6 @@ disable_msisdn_registration=$(ynh_app_setting_get --app=$app --key=disable_msisd registrations_require_3pid=$(ynh_app_setting_get --app=$app --key=registrations_require_3pid) allowed_local_3pids_email=$(ynh_app_setting_get --app=$app --key=allowed_local_3pids_email) allowed_local_3pids_msisdn=$(ynh_app_setting_get --app=$app --key=allowed_local_3pids_msisdn) -account_threepid_delegates_msisdn=$(ynh_app_setting_get --app=$app --key=account_threepid_delegates_msisdn) allow_guest_access=$(ynh_app_setting_get --app=$app --key=allow_guest_access) default_identity_server=$(ynh_app_setting_get --app=$app --key=default_identity_server) auto_join_rooms=$(ynh_app_setting_get --app=$app --key=auto_join_rooms) From 6c2f8de938886763735ad65a5ff74adacb142e94 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Mon, 21 Aug 2023 21:45:08 +0000 Subject: [PATCH 82/95] Update upgrade ?/ --- scripts/upgrade | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/upgrade b/scripts/upgrade index 6aa49696..d5083eae 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -73,6 +73,7 @@ disable_msisdn_registration=$(ynh_app_setting_get --app=$app --key=disable_msisd registrations_require_3pid=$(ynh_app_setting_get --app=$app --key=registrations_require_3pid) allowed_local_3pids_email=$(ynh_app_setting_get --app=$app --key=allowed_local_3pids_email) allowed_local_3pids_msisdn=$(ynh_app_setting_get --app=$app --key=allowed_local_3pids_msisdn) +account_threepid_delegates_msisdn=$(ynh_app_setting_get --app=$app --key=account_threepid_delegates_msisdn) allow_guest_access=$(ynh_app_setting_get --app=$app --key=allow_guest_access) default_identity_server=$(ynh_app_setting_get --app=$app --key=default_identity_server) auto_join_rooms=$(ynh_app_setting_get --app=$app --key=auto_join_rooms) From 902e05601d41f9fd0f7272a0f448fd10f4441be8 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Tue, 22 Aug 2023 23:36:41 +0000 Subject: [PATCH 83/95] Update install account_threepid_delegates_msisdn --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index ed872f0e..d099e138 100644 --- a/scripts/install +++ b/scripts/install @@ -158,7 +158,7 @@ ynh_app_setting_set --app=$app --key=disable_msisdn_registration --value=$disabl ynh_app_setting_set --app=$app --key=registrations_require_3pid --value=$registrations_require_3pid ynh_app_setting_set --app=$app --key=allowed_local_3pids_email --value=$allowed_local_3pids_email ynh_app_setting_set --app=$app --key=allowed_local_3pids_msisdn --value=$allowed_local_3pids_msisdn -ynh_app_setting_set --app=$app --key=account_threepid_delegates_msisdn --value=$account_threepid_delegates_msisdn +ynh_app_setting_set --app=$app --key=account_threepid_delegates_msisdn --value="$account_threepid_delegates_msisdn" ynh_app_setting_set --app=$app --key=allow_guest_access --value=$allow_guest_access ynh_app_setting_set --app=$app --key=default_identity_server --value=$default_identity_server ynh_app_setting_set --app=$app --key=auto_join_rooms --value=$auto_join_rooms From 887a045e2a685d093b1e4c6092e8d48c4472dbaa Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Wed, 23 Aug 2023 00:07:35 +0000 Subject: [PATCH 84/95] Update homeserver.yaml --- conf/homeserver.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/homeserver.yaml b/conf/homeserver.yaml index 4c968247..7bac1bad 100644 --- a/conf/homeserver.yaml +++ b/conf/homeserver.yaml @@ -1357,7 +1357,7 @@ default_identity_server: __DEFAULT_IDENTITY_SERVER__ # https://matrix.org/docs/spec/identity_service/latest # # As email delegates is managed by the synapse server itself this email section is -# deprecated but msisdn format is still composed by email: on a new line +# not necessary but msisdn format is still composed by msisdn: on a new line account_threepid_delegates: __ACCOUNT_THREEPID_DELEGATES_MSISDN__ #email: https://example.com # Delegate email sending to example.com From 154f419b493e7e8b436b610c338ad3c968910f35 Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Wed, 23 Aug 2023 22:18:17 +0200 Subject: [PATCH 85/95] typo? --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index d099e138..ed872f0e 100644 --- a/scripts/install +++ b/scripts/install @@ -158,7 +158,7 @@ ynh_app_setting_set --app=$app --key=disable_msisdn_registration --value=$disabl ynh_app_setting_set --app=$app --key=registrations_require_3pid --value=$registrations_require_3pid ynh_app_setting_set --app=$app --key=allowed_local_3pids_email --value=$allowed_local_3pids_email ynh_app_setting_set --app=$app --key=allowed_local_3pids_msisdn --value=$allowed_local_3pids_msisdn -ynh_app_setting_set --app=$app --key=account_threepid_delegates_msisdn --value="$account_threepid_delegates_msisdn" +ynh_app_setting_set --app=$app --key=account_threepid_delegates_msisdn --value=$account_threepid_delegates_msisdn ynh_app_setting_set --app=$app --key=allow_guest_access --value=$allow_guest_access ynh_app_setting_set --app=$app --key=default_identity_server --value=$default_identity_server ynh_app_setting_set --app=$app --key=auto_join_rooms --value=$auto_join_rooms From a509883d2c12c3c7d9284f81ffa00fab61c1d480 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Wed, 23 Aug 2023 22:45:02 +0000 Subject: [PATCH 86/95] correct threepid error --- config_panel.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index f6ea3866..7e431652 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -28,7 +28,7 @@ services = ["matrix-__APP__"] ask = "Registration requires all following 3PID personal identifier." type = "select" choices = ["false","email", "msisdn", "email&msisdn"] - help = "! warning msisdn (Phone number) registration require a third party service which send confirmation token by SMS do not select any option including msisdn if you don't know what to do.\nDefaults to: 'email'." + help = "! Warning msisdn (Phone number) registration require a third party service which send confirmation token by SMS.\n Do not select any option including msisdn if you don't know what to do. And don't understand privacy flow\nDefaults to: 'false'." visible = "enable_registration" [main.welcome.allowed_local_3pids_email] @@ -55,8 +55,8 @@ services = ["matrix-__APP__"] [main.welcome.account_threepid_delegates_msisdn] ask = "specify a third party server to send confirmation code by SMS." type = "string" - help = "! Mandatory for msisdn registration. Specify here the server which will send the configmation token by SMS (synapse can not do it for now). it mus be preced by 'msisdn: ' then the url of the server (for now)" - bind = ":/etc/matrix-__APP__/homeserver.yaml" + help = "Specify here the server which will send the configmation token by SMS (synapse can not do it for now). \nIt mus be preced by 'msisdn: ' then the url of the server" + bind = "account_threepid_delegates:/etc/matrix-__APP__/homeserver.yaml" visible = 'enable_registration && (registrations_require_3pid == "email&msisdn" || registrations_require_3pid == "msisdn")' [main.welcome.auto_join_rooms] From 9fb4fe1f0b092632278a3ba9f1ca3e807932390a Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Sat, 26 Aug 2023 00:29:00 +0000 Subject: [PATCH 87/95] third party server to send confirmation code by SMS. last change --- config_panel.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 7e431652..a1b37c72 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -55,8 +55,8 @@ services = ["matrix-__APP__"] [main.welcome.account_threepid_delegates_msisdn] ask = "specify a third party server to send confirmation code by SMS." type = "string" - help = "Specify here the server which will send the configmation token by SMS (synapse can not do it for now). \nIt mus be preced by 'msisdn: ' then the url of the server" - bind = "account_threepid_delegates:/etc/matrix-__APP__/homeserver.yaml" + help = "Specify here the server which will send the configmation token by SMS (synapse can not do it for now). " + bind = "account_threepid_delegates>msisdn:/etc/matrix-__APP__/homeserver.yaml" visible = 'enable_registration && (registrations_require_3pid == "email&msisdn" || registrations_require_3pid == "msisdn")' [main.welcome.auto_join_rooms] From bc753b37c422f49211bd69c82f15ed48292adb0f Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Sat, 26 Aug 2023 00:30:42 +0000 Subject: [PATCH 88/95] defaullt value for third party server to send confirmation code by SMS. --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index ed872f0e..124461cb 100644 --- a/scripts/install +++ b/scripts/install @@ -135,7 +135,7 @@ allowed_local_3pids_email="" allowed_local_3pids_msisdn="" allow_guest_access="false" allow_guest_access="false" -account_threepid_delegates_msisdn="#email: " +account_threepid_delegates_msisdn="" default_identity_server="https://matrix.org" auto_join_rooms="#auto_join_room:""$server_name" autocreate_auto_join_rooms="false" From b8379fe2e0c3842ee89b1f2ef4942c80dc7f5154 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Sat, 26 Aug 2023 00:32:48 +0000 Subject: [PATCH 89/95] default value for third party server to send confirmation code by SMS. --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index d5083eae..5279a9f7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -294,7 +294,7 @@ then fi if [ -z "$account_threepid_delegates_msisdn" ] then - account_threepid_delegates_msisdn="#email:" + account_threepid_delegates_msisdn="" ynh_app_setting_set --app=$app --key=account_threepid_delegates_msisdn --value=$account_threepid_delegates_msisdn fi if [ -z "$allow_guest_access" ] From d47041f6bb401f8e2c193f5688bee42ef40c8528 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Sat, 26 Aug 2023 00:36:10 +0000 Subject: [PATCH 90/95] enable but default empty third party server to send confirmation code by SMS. server run with this empty config maybe someone can test if it generates error with elements. --- conf/homeserver.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/homeserver.yaml b/conf/homeserver.yaml index 7bac1bad..ed4b65e4 100644 --- a/conf/homeserver.yaml +++ b/conf/homeserver.yaml @@ -1359,7 +1359,7 @@ default_identity_server: __DEFAULT_IDENTITY_SERVER__ # As email delegates is managed by the synapse server itself this email section is # not necessary but msisdn format is still composed by msisdn: on a new line account_threepid_delegates: - __ACCOUNT_THREEPID_DELEGATES_MSISDN__ + msisdn: __ACCOUNT_THREEPID_DELEGATES_MSISDN__ #email: https://example.com # Delegate email sending to example.com #msisdn: http://localhost:8090 # Delegate SMS sending to this local process From 594607424b2a60aef75250e4208d1f4570eff6a9 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Wed, 30 Aug 2023 00:26:33 +0000 Subject: [PATCH 91/95] Update config_panel.toml --- config_panel.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index a1b37c72..f9113ff7 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -53,9 +53,9 @@ services = ["matrix-__APP__"] visible = "enable_registration" [main.welcome.account_threepid_delegates_msisdn] - ask = "specify a third party server to send confirmation code by SMS." + ask = "Specify a third party server to send confirmation code by SMS." type = "string" - help = "Specify here the server which will send the configmation token by SMS (synapse can not do it for now). " + help = "That should be an URL with port or API." bind = "account_threepid_delegates>msisdn:/etc/matrix-__APP__/homeserver.yaml" visible = 'enable_registration && (registrations_require_3pid == "email&msisdn" || registrations_require_3pid == "msisdn")' From 8c32dcde62395c3ae156baa9e6830edff16636c2 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Fri, 1 Sep 2023 00:10:08 +0000 Subject: [PATCH 92/95] fix duplicated default value --- scripts/install | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/install b/scripts/install index 124461cb..d7afd9ab 100644 --- a/scripts/install +++ b/scripts/install @@ -134,7 +134,6 @@ registrations_require_3pid="false" allowed_local_3pids_email="" allowed_local_3pids_msisdn="" allow_guest_access="false" -allow_guest_access="false" account_threepid_delegates_msisdn="" default_identity_server="https://matrix.org" auto_join_rooms="#auto_join_room:""$server_name" From 5f71398ae8d81c8d0e4f0102bff768f809f0d17b Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Sat, 2 Sep 2023 02:14:12 +0000 Subject: [PATCH 93/95] fix "false" value to "none" in select field --- config_panel.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index f9113ff7..28c208f2 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -27,8 +27,8 @@ services = ["matrix-__APP__"] [main.welcome.registrations_require_3pid] ask = "Registration requires all following 3PID personal identifier." type = "select" - choices = ["false","email", "msisdn", "email&msisdn"] - help = "! Warning msisdn (Phone number) registration require a third party service which send confirmation token by SMS.\n Do not select any option including msisdn if you don't know what to do. And don't understand privacy flow\nDefaults to: 'false'." + choices = ["none","email", "msisdn", "email&msisdn"] + help = "! Warning msisdn (Phone number) registration require a third party service which send confirmation token by SMS.\n Do not select any option including msisdn if you don't know what to do. And don't user email nor msisdn if you don't understand privacy flow\nDefaults to: 'none'." visible = "enable_registration" [main.welcome.allowed_local_3pids_email] From 924b976afb6b8e827cad0bc563675955088d76ba Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Sat, 2 Sep 2023 02:16:06 +0000 Subject: [PATCH 94/95] fix "false" value to "none" in select field --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index d7afd9ab..81d123b8 100644 --- a/scripts/install +++ b/scripts/install @@ -129,7 +129,7 @@ allow_public_rooms_without_auth="false" allow_public_rooms_over_federation="false" max_upload_size="10M" disable_msisdn_registration="true" -registrations_require_3pid="false" +registrations_require_3pid="none" # here we need sed magic to transform $server_name allowed_local_3pids_email="" allowed_local_3pids_msisdn="" From 1347933e01b501fb849dc47bd4a7d14a8ccbe53b Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Sat, 2 Sep 2023 02:16:56 +0000 Subject: [PATCH 95/95] fix "false" value to "none" in select field --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 5279a9f7..fd287507 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -279,7 +279,7 @@ then fi if [ -z "$registrations_require_3pid" ] then - registrations_require_3pid="email" + registrations_require_3pid="none" ynh_app_setting_set --app=$app --key=registrations_require_3pid --value=$registrations_require_3pid fi if [ -z "$allowed_local_3pids_email" ]