From 4438ae62b6753508a5d81594a6cde04505ecafc5 Mon Sep 17 00:00:00 2001 From: Parminder Singh Date: Thu, 15 Aug 2019 03:36:20 +0530 Subject: [PATCH] Panic when keys are not present --- clientapi/clientapi.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/clientapi/clientapi.go b/clientapi/clientapi.go index 5b6e21c80..b891f046c 100644 --- a/clientapi/clientapi.go +++ b/clientapi/clientapi.go @@ -44,6 +44,17 @@ func SetupClientAPIComponent( asAPI appserviceAPI.AppServiceQueryAPI, transactionsCache *transactions.Cache, ) { + if base.Cfg.Matrix.RecaptchaEnabled && + (base.Cfg.Matrix.RecaptchaPublicKey == "" || + base.Cfg.Matrix.RecaptchaPrivateKey == "" || + base.Cfg.Matrix.RecaptchaSiteVerifyAPI == "") { + logrus.Panicf( + "Recaptcha configs are missing. " + + "Ensure that recaptcha_public_key, recaptcha_private_key and " + + "recaptcha_siteverify_api are specified", + ) + } + roomserverProducer := producers.NewRoomserverProducer(inputAPI) typingProducer := producers.NewTypingServerProducer(typingInputAPI)