From bf5efbc31fa02ef438b450b78db5eef14b3ab3a7 Mon Sep 17 00:00:00 2001 From: Parminder Singh Date: Thu, 15 Aug 2019 23:29:17 +0530 Subject: [PATCH] Error when recaptcha enabled with empty configs (#786) --- common/config/config.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/config/config.go b/common/config/config.go index 9fcab8cf..40232fb0 100644 --- a/common/config/config.go +++ b/common/config/config.go @@ -498,6 +498,11 @@ func (config *Dendrite) checkMatrix(configErrs *configErrors) { checkNotEmpty(configErrs, "matrix.server_name", string(config.Matrix.ServerName)) checkNotEmpty(configErrs, "matrix.private_key", string(config.Matrix.PrivateKeyPath)) checkNotZero(configErrs, "matrix.federation_certificates", int64(len(config.Matrix.FederationCertificatePaths))) + if config.Matrix.RecaptchaEnabled { + checkNotEmpty(configErrs, "matrix.recaptcha_public_key", string(config.Matrix.RecaptchaPublicKey)) + checkNotEmpty(configErrs, "matrix.recaptcha_private_key", string(config.Matrix.RecaptchaPrivateKey)) + checkNotEmpty(configErrs, "matrix.recaptcha_siteverify_api", string(config.Matrix.RecaptchaSiteVerifyAPI)) + } } // checkMedia verifies the parameters media.* are valid.