aboutsummaryrefslogtreecommitdiff
path: root/internal/config/config_keyserver.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/config/config_keyserver.go')
-rw-r--r--internal/config/config_keyserver.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/internal/config/config_keyserver.go b/internal/config/config_keyserver.go
new file mode 100644
index 00000000..c0967a8a
--- /dev/null
+++ b/internal/config/config_keyserver.go
@@ -0,0 +1,23 @@
+package config
+
+type KeyServer struct {
+ Matrix *Global `yaml:"-"`
+
+ Listen Address `yaml:"listen"`
+ Bind Address `yaml:"bind"`
+
+ Database DatabaseOptions `yaml:"database"`
+}
+
+func (c *KeyServer) Defaults() {
+ c.Listen = "localhost:7779"
+ c.Bind = "localhost:7779"
+ c.Database.Defaults()
+ c.Database.ConnectionString = "file:keyserver.db"
+}
+
+func (c *KeyServer) Verify(configErrs *ConfigErrors, isMonolith bool) {
+ checkNotEmpty(configErrs, "key_server.listen", string(c.Listen))
+ checkNotEmpty(configErrs, "key_server.bind", string(c.Bind))
+ checkNotEmpty(configErrs, "key_server.database.connection_string", string(c.Database.ConnectionString))
+}