mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 06:12:45 +00:00
Shuffle config Verify/Defaults a bit around (#2459)
This commit is contained in:
parent
fc670f03a2
commit
870f9b0c3f
9 changed files with 60 additions and 47 deletions
|
@ -67,19 +67,13 @@ func (c *ClientAPI) Defaults(generate bool) {
|
|||
}
|
||||
|
||||
func (c *ClientAPI) Verify(configErrs *ConfigErrors, isMonolith bool) {
|
||||
checkURL(configErrs, "client_api.internal_api.listen", string(c.InternalAPI.Listen))
|
||||
checkURL(configErrs, "client_api.internal_api.connect", string(c.InternalAPI.Connect))
|
||||
if !isMonolith {
|
||||
checkURL(configErrs, "client_api.external_api.listen", string(c.ExternalAPI.Listen))
|
||||
}
|
||||
if c.RecaptchaEnabled {
|
||||
checkNotEmpty(configErrs, "client_api.recaptcha_public_key", string(c.RecaptchaPublicKey))
|
||||
checkNotEmpty(configErrs, "client_api.recaptcha_private_key", string(c.RecaptchaPrivateKey))
|
||||
checkNotEmpty(configErrs, "client_api.recaptcha_siteverify_api", string(c.RecaptchaSiteVerifyAPI))
|
||||
}
|
||||
c.TURN.Verify(configErrs)
|
||||
c.RateLimiting.Verify(configErrs)
|
||||
|
||||
if c.RecaptchaEnabled {
|
||||
checkNotEmpty(configErrs, "client_api.recaptcha_public_key", c.RecaptchaPublicKey)
|
||||
checkNotEmpty(configErrs, "client_api.recaptcha_private_key", c.RecaptchaPrivateKey)
|
||||
checkNotEmpty(configErrs, "client_api.recaptcha_siteverify_api", c.RecaptchaSiteVerifyAPI)
|
||||
}
|
||||
// Ensure there is any spam counter measure when enabling registration
|
||||
if !c.RegistrationDisabled && !c.OpenRegistrationWithoutVerificationEnabled {
|
||||
if !c.RecaptchaEnabled {
|
||||
|
@ -93,6 +87,12 @@ func (c *ClientAPI) Verify(configErrs *ConfigErrors, isMonolith bool) {
|
|||
)
|
||||
}
|
||||
}
|
||||
if isMonolith { // polylith required configs below
|
||||
return
|
||||
}
|
||||
checkURL(configErrs, "client_api.internal_api.listen", string(c.InternalAPI.Listen))
|
||||
checkURL(configErrs, "client_api.internal_api.connect", string(c.InternalAPI.Connect))
|
||||
checkURL(configErrs, "client_api.external_api.listen", string(c.ExternalAPI.Listen))
|
||||
}
|
||||
|
||||
type TURN struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue