1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/dendrite_ynh.git synced 2024-09-03 18:25:58 +02:00

no federation if no captcha

This commit is contained in:
Gredin67 2023-08-02 18:26:08 +02:00 committed by GitHub
parent 54d31281e3
commit 3e0b90bf9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 14 deletions

View file

@ -29,7 +29,6 @@ services = ["__APP__"]
yes = true yes = true
no = false no = false
help = "If True, Registration of default user accounts from a Client App is disabled. If false and your server is federated, reCAPTCHA verification should be activated to avoid spamming the whole Matrix network." help = "If True, Registration of default user accounts from a Client App is disabled. If false and your server is federated, reCAPTCHA verification should be activated to avoid spamming the whole Matrix network."
default = true
[main.registration.enable_registration_captcha] [main.registration.enable_registration_captcha]
ask = "Require CAPTCHA verification for Registration." ask = "Require CAPTCHA verification for Registration."
@ -38,7 +37,6 @@ services = ["__APP__"]
no = false no = false
help = "ReCAPTCHA API should be configured. See instructions https://matrix-org.github.io/dendrite/administration/registration#recaptcha-verification" help = "ReCAPTCHA API should be configured. See instructions https://matrix-org.github.io/dendrite/administration/registration#recaptcha-verification"
bind = ":/opt/yunohost/__APP__/dendrite.yaml" bind = ":/opt/yunohost/__APP__/dendrite.yaml"
default = true
visible = "!registration_disabled" visible = "!registration_disabled"
[main.registration.guests_disabled] [main.registration.guests_disabled]
@ -48,7 +46,6 @@ services = ["__APP__"]
no = false no = false
help = "Guest registration is also disabled implicitly if Registration from Element is disabled." help = "Guest registration is also disabled implicitly if Registration from Element is disabled."
bind = ":/opt/yunohost/__APP__/dendrite.yaml" bind = ":/opt/yunohost/__APP__/dendrite.yaml"
default = true
visible = "!registration_disabled" visible = "!registration_disabled"
[main.registration.disable_federation] [main.registration.disable_federation]
@ -58,4 +55,4 @@ services = ["__APP__"]
no = false no = false
help = "Do not communicate with other homeservers of the Matrix Federation." help = "Do not communicate with other homeservers of the Matrix Federation."
bind = ":/opt/yunohost/__APP__/dendrite.yaml" bind = ":/opt/yunohost/__APP__/dendrite.yaml"
default = false visible = "enable_registration_captcha"

View file

@ -44,6 +44,8 @@ ram.runtime = "50M"
ask.en = "Should the server allow any visitor to register as a user?" 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 ?" ask.fr = "Le serveur doit-il permettre à quiconque de s'enregistrer comme utilisateur ?"
type = "boolean" 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 default = false
[resources] [resources]

View file

@ -19,11 +19,11 @@ if [ $registration -eq 1 ]
then then
registration_disabled="false" registration_disabled="false"
really_enable_open_registration="--really-enable-open-registration" really_enable_open_registration="--really-enable-open-registration"
enable_registration_captcha="true" disable_federation="true"
else else
registration_disabled="true" registration_disabled="true"
really_enable_open_registration="" really_enable_open_registration=""
enable_registration_captcha="false" disable_federation="false"
fi fi
#================================================= #=================================================
@ -108,9 +108,9 @@ chown -R $app:root "$install_dir"
#================================================= #=================================================
## SET STANDARD SETTINGS FROM DEFAULT CONFIG ## SET STANDARD SETTINGS FROM DEFAULT CONFIG
#================================================= #=================================================
disable_federation="false"
guests_disabled="true" guests_disabled="true"
registration_shared_secret="" registration_shared_secret=""
enable_registration_captcha="false"
ynh_app_setting_set --app=$app --key=registration_disabled --value=$registration_disabled ynh_app_setting_set --app=$app --key=registration_disabled --value=$registration_disabled
ynh_app_setting_set --app=$app --key=disable_federation --value=$disable_federation ynh_app_setting_set --app=$app --key=disable_federation --value=$disable_federation
ynh_app_setting_set --app=$app --key=guests_disabled --value=$guests_disabled ynh_app_setting_set --app=$app --key=guests_disabled --value=$guests_disabled

View file

@ -61,9 +61,9 @@ if [ -z $server_name ]; then
fi fi
# Define $disable_federation if not already defined # Define $disable_federation if not already defined
if [ -z $disable_federation ]; then if [ -z $enable_registration_captcha ]; then
disable_federation="false" enable_registration_captcha="false"
ynh_app_setting_set --app=$app --key=disable_federation --value=$disable_federation ynh_app_setting_set --app=$app --key=enable_registration_captcha --value=$enable_registration_captcha
fi fi
# Define $guests_disabled if not already defined # Define $guests_disabled if not already defined
@ -88,15 +88,15 @@ else
then then
registration_disabled="false" registration_disabled="false"
really_enable_open_registration="--really-enable-open-registration" really_enable_open_registration="--really-enable-open-registration"
enable_registration_captcha="true" disable_federation="true"
ynh_app_setting_set --app=$app --key=registration_disabled --value=$registration_disabled ynh_app_setting_set --app=$app --key=registration_disabled --value=$registration_disabled
ynh_app_setting_set --app=$app --key=enable_registration_captcha --value=$enable_registration_captcha ynh_app_setting_set --app=$app --key=disable_federation --value=$disable_federation
else else
registration_disabled="true" registration_disabled="true"
really_enable_open_registration="" really_enable_open_registration=""
enable_registration_captcha="false" disable_federation="false"
ynh_app_setting_set --app=$app --key=registration_disabled --value=$registration_disabled ynh_app_setting_set --app=$app --key=registration_disabled --value=$registration_disabled
ynh_app_setting_set --app=$app --key=enable_registration_captcha --value=$enable_registration_captcha ynh_app_setting_set --app=$app --key=disable_federation --value=$disable_federation
fi fi
fi fi