Config validation
This commit is contained in:
parent
ed915eed19
commit
7ff7c7eaba
|
@ -115,6 +115,10 @@ func (c *Global) Verify(configErrs *ConfigErrors, isMonolith bool) {
|
||||||
checkNotEmpty(configErrs, "global.server_name", string(c.ServerName))
|
checkNotEmpty(configErrs, "global.server_name", string(c.ServerName))
|
||||||
checkNotEmpty(configErrs, "global.private_key", string(c.PrivateKeyPath))
|
checkNotEmpty(configErrs, "global.private_key", string(c.PrivateKeyPath))
|
||||||
|
|
||||||
|
for _, v := range c.VirtualHosts {
|
||||||
|
v.Verify(configErrs)
|
||||||
|
}
|
||||||
|
|
||||||
c.JetStream.Verify(configErrs, isMonolith)
|
c.JetStream.Verify(configErrs, isMonolith)
|
||||||
c.Metrics.Verify(configErrs, isMonolith)
|
c.Metrics.Verify(configErrs, isMonolith)
|
||||||
c.Sentry.Verify(configErrs, isMonolith)
|
c.Sentry.Verify(configErrs, isMonolith)
|
||||||
|
@ -183,6 +187,10 @@ type VirtualHost struct {
|
||||||
KeyValidityPeriod time.Duration `yaml:"key_validity_period"`
|
KeyValidityPeriod time.Duration `yaml:"key_validity_period"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (v *VirtualHost) Verify(configErrs *ConfigErrors) {
|
||||||
|
checkNotEmpty(configErrs, "virtual_host.*.server_name", string(v.ServerName))
|
||||||
|
}
|
||||||
|
|
||||||
func (v *VirtualHost) SigningIdentity() *gomatrixserverlib.SigningIdentity {
|
func (v *VirtualHost) SigningIdentity() *gomatrixserverlib.SigningIdentity {
|
||||||
return &gomatrixserverlib.SigningIdentity{
|
return &gomatrixserverlib.SigningIdentity{
|
||||||
ServerName: v.ServerName,
|
ServerName: v.ServerName,
|
||||||
|
|
Loading…
Reference in a new issue