mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-04-11 22:33:40 +00:00
Add missing http mode for userapi
This commit is contained in:
parent
f8d481f25a
commit
f003faa8c3
1 changed files with 17 additions and 8 deletions
|
@ -69,6 +69,7 @@ func main() {
|
||||||
cfg.RoomServer.InternalAPI.Connect = httpAPIAddr
|
cfg.RoomServer.InternalAPI.Connect = httpAPIAddr
|
||||||
cfg.SigningKeyServer.InternalAPI.Connect = httpAPIAddr
|
cfg.SigningKeyServer.InternalAPI.Connect = httpAPIAddr
|
||||||
cfg.SyncAPI.InternalAPI.Connect = httpAPIAddr
|
cfg.SyncAPI.InternalAPI.Connect = httpAPIAddr
|
||||||
|
cfg.UserAPI.InternalAPI.Connect = httpAPIAddr
|
||||||
}
|
}
|
||||||
|
|
||||||
base := setup.NewBaseDendrite(cfg, "Monolith", *enableHTTPAPIs)
|
base := setup.NewBaseDendrite(cfg, "Monolith", *enableHTTPAPIs)
|
||||||
|
@ -114,12 +115,27 @@ func main() {
|
||||||
|
|
||||||
keyAPI := keyserver.NewInternalAPI(base, &base.Cfg.KeyServer, fsAPI)
|
keyAPI := keyserver.NewInternalAPI(base, &base.Cfg.KeyServer, fsAPI)
|
||||||
userAPI := userapi.NewInternalAPI(accountDB, &cfg.UserAPI, cfg.Derived.ApplicationServices, keyAPI)
|
userAPI := userapi.NewInternalAPI(accountDB, &cfg.UserAPI, cfg.Derived.ApplicationServices, keyAPI)
|
||||||
keyAPI.SetUserAPI(userAPI)
|
|
||||||
|
// The appservice might try to create a new service account on startup, which will fail if running in httpapi mode
|
||||||
|
// since there won't be an userapi endpoint yet, so move this before switching to httpapi mode.
|
||||||
|
asAPI := appservice.NewInternalAPI(base, userAPI, rsAPI)
|
||||||
|
if base.UseHTTPAPIs {
|
||||||
|
appservice.AddInternalRoutes(base.InternalAPIMux, asAPI)
|
||||||
|
asAPI = base.AppserviceHTTPClient()
|
||||||
|
}
|
||||||
|
rsAPI.SetAppserviceAPI(asAPI)
|
||||||
|
|
||||||
|
if base.UseHTTPAPIs {
|
||||||
|
userapi.AddInternalRoutes(base.InternalAPIMux, userAPI)
|
||||||
|
userAPI = base.UserAPIClient()
|
||||||
|
}
|
||||||
if traceInternal {
|
if traceInternal {
|
||||||
userAPI = &uapi.UserInternalAPITrace{
|
userAPI = &uapi.UserInternalAPITrace{
|
||||||
Impl: userAPI,
|
Impl: userAPI,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
keyAPI.SetUserAPI(userAPI)
|
||||||
|
|
||||||
// needs to be after the SetUserAPI call above
|
// needs to be after the SetUserAPI call above
|
||||||
if base.UseHTTPAPIs {
|
if base.UseHTTPAPIs {
|
||||||
keyserver.AddInternalRoutes(base.InternalAPIMux, keyAPI)
|
keyserver.AddInternalRoutes(base.InternalAPIMux, keyAPI)
|
||||||
|
@ -134,13 +150,6 @@ func main() {
|
||||||
eduInputAPI = base.EDUServerClient()
|
eduInputAPI = base.EDUServerClient()
|
||||||
}
|
}
|
||||||
|
|
||||||
asAPI := appservice.NewInternalAPI(base, userAPI, rsAPI)
|
|
||||||
if base.UseHTTPAPIs {
|
|
||||||
appservice.AddInternalRoutes(base.InternalAPIMux, asAPI)
|
|
||||||
asAPI = base.AppserviceHTTPClient()
|
|
||||||
}
|
|
||||||
rsAPI.SetAppserviceAPI(asAPI)
|
|
||||||
|
|
||||||
monolith := setup.Monolith{
|
monolith := setup.Monolith{
|
||||||
Config: base.Cfg,
|
Config: base.Cfg,
|
||||||
AccountDB: accountDB,
|
AccountDB: accountDB,
|
||||||
|
|
Loading…
Reference in a new issue