mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-15 10:53:09 -06:00
moved check to config.go
This commit is contained in:
parent
4438ae62b6
commit
2a8541e47f
|
|
@ -44,17 +44,6 @@ 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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue