From d784b13560c43a091c74e8e43dce543540f02958 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 28 Apr 2022 17:18:31 +0100 Subject: [PATCH] Ignore shared secret when warning about open registration, since it's not strictly required when it is set if registration is otherwise enabled --- setup/config/config_clientapi.go | 4 ++-- setup/flags.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/setup/config/config_clientapi.go b/setup/config/config_clientapi.go index 0819c6661..6104ed8b9 100644 --- a/setup/config/config_clientapi.go +++ b/setup/config/config_clientapi.go @@ -82,10 +82,10 @@ func (c *ClientAPI) Verify(configErrs *ConfigErrors, isMonolith bool) { // Ensure there is any spam counter measure when enabling registration if !c.RegistrationDisabled && !c.OpenRegistrationWithoutVerificationEnabled { - if !c.RecaptchaEnabled && c.RegistrationSharedSecret == "" { + if !c.RecaptchaEnabled { configErrs.Add( "You have tried to enable open registration without any secondary verification methods " + - "(such as captcha or shared secret). By enabling open registration, you are SIGNIFICANTLY " + + "(such as reCAPTCHA). By enabling open registration, you are SIGNIFICANTLY " + "increasing the risk that your server will be used to send spam or abuse, and may result in " + "your server being banned from some rooms. If you are ABSOLUTELY CERTAIN you want to do this, " + "start Dendrite with the -really-enable-open-registration command line flag. Otherwise, you " + diff --git a/setup/flags.go b/setup/flags.go index bf8c2f4ac..a9dac61a1 100644 --- a/setup/flags.go +++ b/setup/flags.go @@ -27,7 +27,7 @@ import ( var ( configPath = flag.String("config", "dendrite.yaml", "The path to the config file. For more information, see the config file in this repository.") version = flag.Bool("version", false, "Shows the current version and exits immediately.") - enableRegistrationWithoutVerification = flag.Bool("really-enable-open-registration", false, "This allows open registration without secondary verification (captcha, shared secret etc). This is NOT RECOMMENDED and will SIGNIFICANTLY increase the risk that your server will be used to send spam or conduct attacks, which may result in your server being banned from rooms.") + enableRegistrationWithoutVerification = flag.Bool("really-enable-open-registration", false, "This allows open registration without secondary verification (reCAPTCHA). This is NOT RECOMMENDED and will SIGNIFICANTLY increase the risk that your server will be used to send spam or conduct attacks, which may result in your server being banned from rooms.") ) // ParseFlags parses the commandline flags and uses them to create a config.