diff --git a/cmd/dendrite-appservice-server/main.go b/cmd/dendrite-appservice-server/main.go index 1e0b7e4d8..54818f7e0 100644 --- a/cmd/dendrite-appservice-server/main.go +++ b/cmd/dendrite-appservice-server/main.go @@ -29,11 +29,11 @@ func main() { intAPI := appservice.NewInternalAPI(base, userAPI, rsAPI) appservice.AddInternalRoutes(base.InternalAPIMux, intAPI) - setup.AddHealthCheck(base.InternalAPIMux, base.Cfg.AppServiceAPI.Database) base.SetupAndServeHTTP( base.Cfg.AppServiceAPI.InternalAPI.Listen, setup.NoExternalListener, nil, nil, + base.Cfg.AppServiceAPI.Database, ) } diff --git a/cmd/dendrite-key-server/main.go b/cmd/dendrite-key-server/main.go index 2643c5934..609fd8d0d 100644 --- a/cmd/dendrite-key-server/main.go +++ b/cmd/dendrite-key-server/main.go @@ -28,11 +28,11 @@ func main() { intAPI.SetUserAPI(base.UserAPIClient()) keyserver.AddInternalRoutes(base.InternalAPIMux, intAPI) - setup.AddHealthCheck(base.InternalAPIMux, base.Cfg.KeyServer.Database) base.SetupAndServeHTTP( base.Cfg.KeyServer.InternalAPI.Listen, setup.NoExternalListener, nil, nil, + base.Cfg.KeyServer.Database, ) } diff --git a/cmd/dendrite-media-api-server/main.go b/cmd/dendrite-media-api-server/main.go index c7e455b4a..13ce64056 100644 --- a/cmd/dendrite-media-api-server/main.go +++ b/cmd/dendrite-media-api-server/main.go @@ -28,11 +28,11 @@ func main() { client := base.CreateClient() mediaapi.AddPublicRoutes(base.PublicMediaAPIMux, &base.Cfg.MediaAPI, userAPI, client) - setup.AddHealthCheck(base.InternalAPIMux, base.Cfg.MediaAPI.Database) base.SetupAndServeHTTP( base.Cfg.MediaAPI.InternalAPI.Listen, base.Cfg.MediaAPI.ExternalAPI.Listen, nil, nil, + base.Cfg.MediaAPI.Database, ) } diff --git a/cmd/dendrite-monolith-server/main.go b/cmd/dendrite-monolith-server/main.go index a9a1798bd..eb5ebc557 100644 --- a/cmd/dendrite-monolith-server/main.go +++ b/cmd/dendrite-monolith-server/main.go @@ -145,7 +145,7 @@ func main() { base.PublicMediaAPIMux, ) - setup.AddHealthCheck(base.InternalAPIMux, + dbConfigs := []config.DatabaseOptions{ base.Cfg.AppServiceAPI.Database, base.Cfg.FederationSender.Database, base.Cfg.KeyServer.Database, @@ -154,7 +154,7 @@ func main() { base.Cfg.SyncAPI.Database, base.Cfg.UserAPI.AccountDatabase, base.Cfg.UserAPI.DeviceDatabase, - ) + } // Expose the matrix APIs directly rather than putting them under a /api path. go func() { @@ -162,6 +162,7 @@ func main() { config.HTTPAddress(httpAddr), // internal API config.HTTPAddress(httpAddr), // external API nil, nil, // TLS settings + dbConfigs..., // used in health checks ) }() // Handle HTTPS if certificate and key are provided @@ -171,6 +172,7 @@ func main() { config.HTTPAddress(httpsAddr), // internal API config.HTTPAddress(httpsAddr), // external API certFile, keyFile, // TLS settings + dbConfigs..., // used in health checks ) }() } diff --git a/cmd/dendrite-room-server/main.go b/cmd/dendrite-room-server/main.go index 56b201d13..e140baf46 100644 --- a/cmd/dendrite-room-server/main.go +++ b/cmd/dendrite-room-server/main.go @@ -31,11 +31,11 @@ func main() { rsAPI := roomserver.NewInternalAPI(base, keyRing) rsAPI.SetFederationSenderAPI(fsAPI) roomserver.AddInternalRoutes(base.InternalAPIMux, rsAPI) - setup.AddHealthCheck(base.InternalAPIMux, base.Cfg.RoomServer.Database) base.SetupAndServeHTTP( base.Cfg.RoomServer.InternalAPI.Listen, setup.NoExternalListener, nil, nil, + base.Cfg.RoomServer.Database, ) } diff --git a/cmd/dendrite-server-key-api-server/main.go b/cmd/dendrite-server-key-api-server/main.go index e3d05ee4f..3e81cfa55 100644 --- a/cmd/dendrite-server-key-api-server/main.go +++ b/cmd/dendrite-server-key-api-server/main.go @@ -28,11 +28,11 @@ func main() { intAPI := serverkeyapi.NewInternalAPI(&base.Cfg.ServerKeyAPI, federation, base.Caches) serverkeyapi.AddInternalRoutes(base.InternalAPIMux, intAPI, base.Caches) - setup.AddHealthCheck(base.InternalAPIMux, base.Cfg.ServerKeyAPI.Database) base.SetupAndServeHTTP( base.Cfg.ServerKeyAPI.InternalAPI.Listen, setup.NoExternalListener, nil, nil, + base.Cfg.ServerKeyAPI.Database, ) } diff --git a/cmd/dendrite-sync-api-server/main.go b/cmd/dendrite-sync-api-server/main.go index 46ad0e40f..f57bedeb4 100644 --- a/cmd/dendrite-sync-api-server/main.go +++ b/cmd/dendrite-sync-api-server/main.go @@ -34,11 +34,11 @@ func main() { base.KeyServerHTTPClient(), federation, &cfg.SyncAPI, ) - setup.AddHealthCheck(base.InternalAPIMux, base.Cfg.SyncAPI.Database) base.SetupAndServeHTTP( base.Cfg.SyncAPI.InternalAPI.Listen, base.Cfg.SyncAPI.ExternalAPI.Listen, nil, nil, + base.Cfg.SyncAPI.Database, ) } diff --git a/cmd/dendrite-user-api-server/main.go b/cmd/dendrite-user-api-server/main.go index 730682f4d..a6b8afa6d 100644 --- a/cmd/dendrite-user-api-server/main.go +++ b/cmd/dendrite-user-api-server/main.go @@ -29,11 +29,11 @@ func main() { userAPI := userapi.NewInternalAPI(accountDB, &cfg.UserAPI, cfg.Derived.ApplicationServices, base.KeyServerHTTPClient()) userapi.AddInternalRoutes(base.InternalAPIMux, userAPI) - setup.AddHealthCheck(base.InternalAPIMux, cfg.UserAPI.AccountDatabase, cfg.UserAPI.DeviceDatabase) base.SetupAndServeHTTP( base.Cfg.UserAPI.InternalAPI.Listen, setup.NoExternalListener, nil, nil, + cfg.UserAPI.AccountDatabase, cfg.UserAPI.DeviceDatabase, ) }