dendrite/internal/config/config_federationapi.go
Neil Alexander c782197eed
Updates
2020-08-11 09:35:50 +01:00

25 lines
1.2 KiB
Go

package config
import "github.com/matrix-org/gomatrixserverlib"
type FederationAPI struct {
Matrix *Global `json:"-"`
Listen Address `json:"Listen" comment:"Listen address for this component."`
Bind Address `json:"Bind" comment:"Bind address for this component."`
FederationCertificatePaths []Path `json:"FederationCertificates" comment:"List of paths to X.509 certificates to be used by the external federation listeners.\nThese certificates will be used to calculate the TLS fingerprints and other servers\nwill expect the certificate to match these fingerprints. Certificates must be in PEM\nformat."`
TLSFingerPrints []gomatrixserverlib.TLSFingerprint `json:"-"`
}
func (c *FederationAPI) Defaults() {
c.Listen = "localhost:7772"
c.Bind = "localhost:7772"
}
func (c *FederationAPI) Verify(configErrs *ConfigErrors, isMonolith bool) {
checkNotEmpty(configErrs, "FederationAPI.Listen", string(c.Listen))
checkNotEmpty(configErrs, "FederationAPI.Bind", string(c.Bind))
// TODO: not applicable always, e.g. in demos
//checkNotZero(configErrs, "FederationAPI.FederationCertificates", int64(len(c.FederationCertificatePaths)))
}