mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-03 14:42:47 +00:00
Add push server component template
This commit is contained in:
parent
092edee210
commit
6843c3beee
22 changed files with 487 additions and 0 deletions
|
@ -65,6 +65,7 @@ type Dendrite struct {
|
|||
SigningKeyServer SigningKeyServer `yaml:"signing_key_server"`
|
||||
SyncAPI SyncAPI `yaml:"sync_api"`
|
||||
UserAPI UserAPI `yaml:"user_api"`
|
||||
PushServer PushServer `yaml:"push_server"`
|
||||
|
||||
MSCs MSCs `yaml:"mscs"`
|
||||
|
||||
|
@ -308,6 +309,7 @@ func (c *Dendrite) Defaults() {
|
|||
c.SyncAPI.Defaults()
|
||||
c.UserAPI.Defaults()
|
||||
c.AppServiceAPI.Defaults()
|
||||
c.PushServer.Defaults()
|
||||
c.MSCs.Defaults()
|
||||
|
||||
c.Wiring()
|
||||
|
@ -340,6 +342,7 @@ func (c *Dendrite) Wiring() {
|
|||
c.SyncAPI.Matrix = &c.Global
|
||||
c.UserAPI.Matrix = &c.Global
|
||||
c.AppServiceAPI.Matrix = &c.Global
|
||||
c.PushServer.Matrix = &c.Global
|
||||
c.MSCs.Matrix = &c.Global
|
||||
|
||||
c.ClientAPI.Derived = &c.Derived
|
||||
|
@ -547,6 +550,15 @@ func (config *Dendrite) KeyServerURL() string {
|
|||
return string(config.KeyServer.InternalAPI.Connect)
|
||||
}
|
||||
|
||||
// PushServerURL returns an HTTP URL for where the push server is listening.
|
||||
func (config *Dendrite) PushServerURL() string {
|
||||
// Hard code the push server to talk HTTP for now.
|
||||
// If we support HTTPS we need to think of a practical way to do certificate validation.
|
||||
// People setting up servers shouldn't need to get a certificate valid for the public
|
||||
// internet for an internal API.
|
||||
return string(config.PushServer.InternalAPI.Connect)
|
||||
}
|
||||
|
||||
// SetupTracing configures the opentracing using the supplied configuration.
|
||||
func (config *Dendrite) SetupTracing(serviceName string) (closer io.Closer, err error) {
|
||||
if !config.Tracing.Enabled {
|
||||
|
|
22
setup/config/config_pushserver.go
Normal file
22
setup/config/config_pushserver.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package config
|
||||
|
||||
type PushServer struct {
|
||||
Matrix *Global `yaml:"-"`
|
||||
|
||||
InternalAPI InternalAPIOptions `yaml:"internal_api"`
|
||||
|
||||
Database DatabaseOptions `yaml:"database"`
|
||||
}
|
||||
|
||||
func (c *PushServer) Defaults() {
|
||||
c.InternalAPI.Listen = "http://localhost:7783"
|
||||
c.InternalAPI.Connect = "http://localhost:7783"
|
||||
c.Database.Defaults(10)
|
||||
c.Database.ConnectionString = "file:pushserver.db"
|
||||
}
|
||||
|
||||
func (c *PushServer) Verify(configErrs *ConfigErrors, isMonolith bool) {
|
||||
checkURL(configErrs, "room_server.internal_api.listen", string(c.InternalAPI.Listen))
|
||||
checkURL(configErrs, "room_server.internal_ap.bind", string(c.InternalAPI.Connect))
|
||||
checkNotEmpty(configErrs, "room_server.database.connection_string", string(c.Database.ConnectionString))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue