aboutsummaryrefslogtreecommitdiff
path: root/build/dendritejs-pinecone
diff options
context:
space:
mode:
authorTill <2353100+S7evinK@users.noreply.github.com>2023-03-17 12:09:45 +0100
committerGitHub <noreply@github.com>2023-03-17 11:09:45 +0000
commit5579121c6f27105342a2aea05cf9a3119d73cecb (patch)
tree1d8b7bec90079b6f693585d306c19019ea426870 /build/dendritejs-pinecone
parentd88f71ab71a60348518f7fa6735ac9f0bfb472c3 (diff)
Preparations for removing `BaseDendrite` (#3016)
Preparations to actually remove/replace `BaseDendrite`. Quite a few changes: - SyncAPI accepts an `fulltext.Indexer` interface (fulltext is removed from `BaseDendrite`) - Caches are removed from `BaseDendrite` - Introduces a `Router` struct (likely to change) - also fixes #2903 - Introduces a `sqlutil.ConnectionManager`, which should remove `base.DatabaseConnection` later on - probably more
Diffstat (limited to 'build/dendritejs-pinecone')
-rw-r--r--build/dendritejs-pinecone/main.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/build/dendritejs-pinecone/main.go b/build/dendritejs-pinecone/main.go
index 44e52286..96f034bd 100644
--- a/build/dendritejs-pinecone/main.go
+++ b/build/dendritejs-pinecone/main.go
@@ -29,6 +29,7 @@ import (
"github.com/matrix-org/dendrite/cmd/dendrite-demo-pinecone/rooms"
"github.com/matrix-org/dendrite/cmd/dendrite-demo-yggdrasil/signing"
"github.com/matrix-org/dendrite/federationapi"
+ "github.com/matrix-org/dendrite/internal/caching"
"github.com/matrix-org/dendrite/internal/httputil"
"github.com/matrix-org/dendrite/roomserver"
"github.com/matrix-org/dendrite/setup"
@@ -192,7 +193,8 @@ func startup() {
base, userAPI, rsAPI,
)
rsAPI.SetAppserviceAPI(asQuery)
- fedSenderAPI := federationapi.NewInternalAPI(base, federation, rsAPI, base.Caches, keyRing, true)
+ caches := caching.NewRistrettoCache(base.Cfg.Global.Cache.EstimatedMaxSize, base.Cfg.Global.Cache.MaxAge, caching.EnableMetrics)
+ fedSenderAPI := federationapi.NewInternalAPI(base, federation, rsAPI, caches, keyRing, true)
rsAPI.SetFederationAPI(fedSenderAPI, keyRing)
monolith := setup.Monolith{
@@ -208,15 +210,15 @@ func startup() {
//ServerKeyAPI: serverKeyAPI,
ExtPublicRoomsProvider: rooms.NewPineconeRoomProvider(pRouter, pSessions, fedSenderAPI, federation),
}
- monolith.AddAllPublicRoutes(base)
+ monolith.AddAllPublicRoutes(base, caches)
httpRouter := mux.NewRouter().SkipClean(true).UseEncodedPath()
- httpRouter.PathPrefix(httputil.PublicClientPathPrefix).Handler(base.PublicClientAPIMux)
- httpRouter.PathPrefix(httputil.PublicMediaPathPrefix).Handler(base.PublicMediaAPIMux)
+ httpRouter.PathPrefix(httputil.PublicClientPathPrefix).Handler(base.Routers.Client)
+ httpRouter.PathPrefix(httputil.PublicMediaPathPrefix).Handler(base.Routers.Media)
p2pRouter := pSessions.Protocol("matrix").HTTP().Mux()
- p2pRouter.Handle(httputil.PublicFederationPathPrefix, base.PublicFederationAPIMux)
- p2pRouter.Handle(httputil.PublicMediaPathPrefix, base.PublicMediaAPIMux)
+ p2pRouter.Handle(httputil.PublicFederationPathPrefix, base.Routers.Federation)
+ p2pRouter.Handle(httputil.PublicMediaPathPrefix, base.Routers.Media)
// Expose the matrix APIs via fetch - for local traffic
go func() {