aboutsummaryrefslogtreecommitdiff
path: root/cmd/dendrite-monolith-server
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2020-05-01 10:48:17 +0100
committerGitHub <noreply@github.com>2020-05-01 10:48:17 +0100
commite15f6676ac3f76ec2ef679c2df300d6a8e7e668f (patch)
tree0b82339939e8932d46e1ca2cf6024ab55dc7602f /cmd/dendrite-monolith-server
parentebbfc125920beb321713e28a2a137d768406fa15 (diff)
Consolidation of roomserver APIs (#994)
* Consolidation of roomserver APIs * Comment out alias tests for now, they are broken * Wire AS API into roomserver again * Roomserver didn't take asAPI param before so return to that * Prevent roomserver asking AS API for alias info * Rename some files * Remove alias_test, incoherent tests and unwanted appservice integration * Remove FS API inject on syncapi component
Diffstat (limited to 'cmd/dendrite-monolith-server')
-rw-r--r--cmd/dendrite-monolith-server/main.go28
1 files changed, 17 insertions, 11 deletions
diff --git a/cmd/dendrite-monolith-server/main.go b/cmd/dendrite-monolith-server/main.go
index f43f8b04..06001971 100644
--- a/cmd/dendrite-monolith-server/main.go
+++ b/cmd/dendrite-monolith-server/main.go
@@ -57,28 +57,34 @@ func main() {
federation := base.CreateFederationClient()
keyRing := keydb.CreateKeyRing(federation.Client, keyDB, cfg.Matrix.KeyPerspectives)
- alias, input, query := roomserver.SetupRoomServerComponent(base, keyRing, federation)
- eduInputAPI := eduserver.SetupEDUServerComponent(base, cache.New())
- asQuery := appservice.SetupAppServiceAPIComponent(
- base, accountDB, deviceDB, federation, alias, query, transactions.New(),
+ rsAPI := roomserver.SetupRoomServerComponent(
+ base, keyRing, federation,
)
- fsAPI := federationsender.SetupFederationSenderComponent(base, federation, query, input, &keyRing)
- input.SetFederationSenderAPI(fsAPI)
+ eduInputAPI := eduserver.SetupEDUServerComponent(
+ base, cache.New(),
+ )
+ asAPI := appservice.SetupAppServiceAPIComponent(
+ base, accountDB, deviceDB, federation, rsAPI, transactions.New(),
+ )
+ fsAPI := federationsender.SetupFederationSenderComponent(
+ base, federation, rsAPI, &keyRing,
+ )
+ rsAPI.SetFederationSenderAPI(fsAPI)
clientapi.SetupClientAPIComponent(
base, deviceDB, accountDB,
- federation, &keyRing, alias, input, query,
- eduInputAPI, asQuery, transactions.New(), fsAPI,
+ federation, &keyRing, rsAPI,
+ eduInputAPI, asAPI, transactions.New(), fsAPI,
)
eduProducer := producers.NewEDUServerProducer(eduInputAPI)
- federationapi.SetupFederationAPIComponent(base, accountDB, deviceDB, federation, &keyRing, alias, input, query, asQuery, fsAPI, eduProducer)
+ federationapi.SetupFederationAPIComponent(base, accountDB, deviceDB, federation, &keyRing, rsAPI, asAPI, fsAPI, eduProducer)
mediaapi.SetupMediaAPIComponent(base, deviceDB)
publicRoomsDB, err := storage.NewPublicRoomsServerDatabase(string(base.Cfg.Database.PublicRoomsAPI))
if err != nil {
logrus.WithError(err).Panicf("failed to connect to public rooms db")
}
- publicroomsapi.SetupPublicRoomsAPIComponent(base, deviceDB, publicRoomsDB, query, federation, nil)
- syncapi.SetupSyncAPIComponent(base, deviceDB, accountDB, query, federation, cfg)
+ publicroomsapi.SetupPublicRoomsAPIComponent(base, deviceDB, publicRoomsDB, rsAPI, federation, nil)
+ syncapi.SetupSyncAPIComponent(base, deviceDB, accountDB, rsAPI, federation, cfg)
httpHandler := common.WrapHandlerInCORS(base.APIMux)