mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-29 12:42:46 +00:00
Configuration format v1 (#1230)
* Initial pass at refactoring config (not finished) * Don't forget current state and EDU servers * More shifting around * Update server key API tests * Fix roomserver test * Fix more tests * Further tweaks * Fix current state server test (sort of) * Maybe fix appservices * Fix client API test * Include database connection string in database options * Fix sync API build * Update config test * Fix unit tests * Fix federation sender build * Fix gobind build * Set Listen address for all services in HTTP monolith mode * Validate config, reinstate appservice derived in directory, tweaks * Tweak federation API test * Set MaxOpenConnections/MaxIdleConnections to previous values * Update generate-config
This commit is contained in:
parent
fdabba1851
commit
4b09f445c9
155 changed files with 1716 additions and 1503 deletions
|
@ -54,11 +54,17 @@ func main() {
|
|||
// the API endpoints. They'll listen on the same port as the monolith
|
||||
// itself.
|
||||
addr := config.Address(*httpBindAddr)
|
||||
cfg.Listen.RoomServer = addr
|
||||
cfg.Listen.EDUServer = addr
|
||||
cfg.Listen.AppServiceAPI = addr
|
||||
cfg.Listen.FederationSender = addr
|
||||
cfg.Listen.ServerKeyAPI = addr
|
||||
cfg.AppServiceAPI.Listen = addr
|
||||
cfg.ClientAPI.Listen = addr
|
||||
cfg.CurrentStateServer.Listen = addr
|
||||
cfg.EDUServer.Listen = addr
|
||||
cfg.FederationAPI.Listen = addr
|
||||
cfg.FederationSender.Listen = addr
|
||||
cfg.KeyServer.Listen = addr
|
||||
cfg.MediaAPI.Listen = addr
|
||||
cfg.RoomServer.Listen = addr
|
||||
cfg.ServerKeyAPI.Listen = addr
|
||||
cfg.SyncAPI.Listen = addr
|
||||
}
|
||||
|
||||
base := setup.NewBaseDendrite(cfg, "Monolith", *enableHTTPAPIs)
|
||||
|
@ -69,15 +75,15 @@ func main() {
|
|||
federation := base.CreateFederationClient()
|
||||
|
||||
serverKeyAPI := serverkeyapi.NewInternalAPI(
|
||||
base.Cfg, federation, base.Caches,
|
||||
&base.Cfg.ServerKeyAPI, federation, base.Caches,
|
||||
)
|
||||
if base.UseHTTPAPIs {
|
||||
serverkeyapi.AddInternalRoutes(base.InternalAPIMux, serverKeyAPI, base.Caches)
|
||||
serverKeyAPI = base.ServerKeyAPIClient()
|
||||
}
|
||||
keyRing := serverKeyAPI.KeyRing()
|
||||
keyAPI := keyserver.NewInternalAPI(base.Cfg, federation, base.KafkaProducer)
|
||||
userAPI := userapi.NewInternalAPI(accountDB, deviceDB, cfg.Matrix.ServerName, cfg.Derived.ApplicationServices, keyAPI)
|
||||
keyAPI := keyserver.NewInternalAPI(&base.Cfg.KeyServer, federation, base.KafkaProducer)
|
||||
userAPI := userapi.NewInternalAPI(accountDB, deviceDB, cfg.Global.ServerName, cfg.Derived.ApplicationServices, keyAPI)
|
||||
keyAPI.SetUserAPI(userAPI)
|
||||
|
||||
rsImpl := roomserver.NewInternalAPI(
|
||||
|
@ -109,7 +115,7 @@ func main() {
|
|||
asAPI = base.AppserviceHTTPClient()
|
||||
}
|
||||
|
||||
stateAPI := currentstateserver.NewInternalAPI(base.Cfg, base.KafkaConsumer)
|
||||
stateAPI := currentstateserver.NewInternalAPI(&base.Cfg.CurrentStateServer, base.KafkaConsumer)
|
||||
|
||||
fsAPI := federationsender.NewInternalAPI(
|
||||
base, federation, rsAPI, stateAPI, keyRing,
|
||||
|
@ -126,7 +132,7 @@ func main() {
|
|||
Config: base.Cfg,
|
||||
AccountDB: accountDB,
|
||||
DeviceDB: deviceDB,
|
||||
Client: gomatrixserverlib.NewClient(cfg.Matrix.FederationDisableTLSValidation),
|
||||
Client: gomatrixserverlib.NewClient(cfg.FederationSender.DisableTLSValidation),
|
||||
FedClient: federation,
|
||||
KeyRing: keyRing,
|
||||
KafkaConsumer: base.KafkaConsumer,
|
||||
|
@ -147,7 +153,7 @@ func main() {
|
|||
base.BaseMux,
|
||||
base.PublicAPIMux,
|
||||
base.InternalAPIMux,
|
||||
cfg,
|
||||
&cfg.Global,
|
||||
base.UseHTTPAPIs,
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue