Panic when keys are not present

This commit is contained in:
Parminder Singh 2019-08-15 03:36:20 +05:30
parent 28f60bec4e
commit 4438ae62b6

View file

@ -44,6 +44,17 @@ func SetupClientAPIComponent(
asAPI appserviceAPI.AppServiceQueryAPI, asAPI appserviceAPI.AppServiceQueryAPI,
transactionsCache *transactions.Cache, 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) roomserverProducer := producers.NewRoomserverProducer(inputAPI)
typingProducer := producers.NewTypingServerProducer(typingInputAPI) typingProducer := producers.NewTypingServerProducer(typingInputAPI)