2020-08-10 15:18:04 +02:00
|
|
|
package config
|
|
|
|
|
|
|
|
type KeyServer struct {
|
|
|
|
Matrix *Global `yaml:"-"`
|
|
|
|
|
2020-08-13 13:16:37 +02:00
|
|
|
InternalAPI InternalAPIOptions `yaml:"internal_api"`
|
2020-08-10 15:18:04 +02:00
|
|
|
|
|
|
|
Database DatabaseOptions `yaml:"database"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *KeyServer) Defaults() {
|
2020-08-13 13:16:37 +02:00
|
|
|
c.InternalAPI.Listen = "http://localhost:7779"
|
|
|
|
c.InternalAPI.Connect = "http://localhost:7779"
|
2020-08-10 15:18:04 +02:00
|
|
|
c.Database.Defaults()
|
|
|
|
c.Database.ConnectionString = "file:keyserver.db"
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *KeyServer) Verify(configErrs *ConfigErrors, isMonolith bool) {
|
2020-08-13 13:16:37 +02:00
|
|
|
checkURL(configErrs, "key_server.internal_api.listen", string(c.InternalAPI.Listen))
|
|
|
|
checkURL(configErrs, "key_server.internal_api.bind", string(c.InternalAPI.Connect))
|
2020-08-10 15:18:04 +02:00
|
|
|
checkNotEmpty(configErrs, "key_server.database.connection_string", string(c.Database.ConnectionString))
|
|
|
|
}
|