From dfbca12f16bcda05cc129bcc9cc0be731fa817ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 11 Aug 2023 16:26:46 +0200 Subject: [PATCH] fix --- conf/conduit.toml | 2 +- config_panel.toml | 11 ++++++++++- manifest.toml | 2 ++ scripts/install | 6 ++++-- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/conf/conduit.toml b/conf/conduit.toml index 777b910..e66518a 100644 --- a/conf/conduit.toml +++ b/conf/conduit.toml @@ -31,7 +31,7 @@ max_request_size = 20_000_000 # in bytes # Enables registration. If set to false, no users can register on this server. allow_registration = __REGISTRATION__ -allow_federation = true +allow_federation = __DISABLE_FEDERATION__ allow_check_for_updates = true # Server to get public keys from. You probably shouldn't change this diff --git a/config_panel.toml b/config_panel.toml index c633d8e..ace58a7 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -9,5 +9,14 @@ name = "Conduit configuration" [main.registration.registration] ask = "Should registration be enabled?" type = "boolean" - default = false + yes = true + no = false bind = "allow_registration:/var/www/__APP__/conduit.toml" + + [main.registration.disable_federation] + ask = "Disable Federation" + type = "boolean" + yes = true + no = false + help = "Do not communicate with other homeservers of the Matrix Federation." + bind = "allow_federation:/var/www/__APP__/conduit.toml" diff --git a/manifest.toml b/manifest.toml index 812f76c..de4f6d4 100644 --- a/manifest.toml +++ b/manifest.toml @@ -40,6 +40,8 @@ ram.runtime = "50M" ask.en = "Should the server allow any visitor to register as a user?" ask.fr = "Le serveur doit-il permettre à quiconque de s'enregistrer comme utilisateur ?" type = "boolean" + help.en = "If no, accounts should be registered by an admin after defining a secret. If yes, to protect your server and the federation from spammer, federation will be deactived by default. You must Activate CAPTCHA verification before federation reactivation. See Config Panel for instructions" + help.fr = "Si non, les comptes seront créés par un admin après avoir défini un secret. Si oui, la fédération sera désactivée pour protéger la fédération et vous des spammeurs. Activez la vérification par CAPTCHA avant de réactiver la fédération ! Voir les instructions dans le Config Panel" default = false [resources] diff --git a/scripts/install b/scripts/install index 40af542..6b2ae3b 100755 --- a/scripts/install +++ b/scripts/install @@ -13,15 +13,17 @@ source /usr/share/yunohost/helpers # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -server_name=$YNH_APP_ARG_SERVER_NAME +#server_name=$YNH_APP_ARG_SERVER_NAME registration=$YNH_APP_ARG_REGISTRATION +disable_federation="true" #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_app_setting_set --app=$app --key=server_name --value=$server_name +#ynh_app_setting_set --app=$app --key=server_name --value=$server_name ynh_app_setting_set --app=$app --key=registration --value=$registration +ynh_app_setting_set --app=$app --key=disable_federation --value=$disable_federation #================================================= # APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC)