dendrite/setup/config/config_monolith.go
Timo Rothenpieler 3bfd5f18ae Add Monolith config options for HTTP(s) Bind Addresses
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2022-11-23 15:16:24 +01:00

23 lines
562 B
Go

package config
type Monolith struct {
HTTPBindAddr HTTPAddress `yaml:"http_bind_address"`
HTTPSBindAddr HTTPAddress `yaml:"https_bind_address"`
}
func (c *Monolith) Defaults(opts DefaultOpts) {
if !opts.Monolithic {
return
}
c.HTTPBindAddr = "http://:8008"
c.HTTPSBindAddr = "https://:8448"
}
func (c *Monolith) Verify(configErrs *ConfigErrors, isMonolith bool) {
if !isMonolith {
return
}
checkURL(configErrs, "monolith.http_bind_address", string(c.HTTPBindAddr))
checkURL(configErrs, "monolith.https_bind_address", string(c.HTTPSBindAddr))
}