aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-03-28 16:25:26 +0100
committerGitHub <noreply@github.com>2022-03-28 16:25:26 +0100
commit7972915806348847ecd9a9b8a1b1ff0609cb883c (patch)
treedfbf719e8229dc4faeef133b150b2d7a6dc7eac8 /build
parent0692be44d91a42945dde0eab3e2f7481cc2e0896 (diff)
User directory for nearby Pinecone peers (P2P demo) (#2311)
* User directory for nearby Pinecone peers * Fix mux routing * Use config to determine which server notices user to exclude
Diffstat (limited to 'build')
-rw-r--r--build/gobind-pinecone/monolith.go21
1 files changed, 14 insertions, 7 deletions
diff --git a/build/gobind-pinecone/monolith.go b/build/gobind-pinecone/monolith.go
index 8ef4bbc7..346c5d1e 100644
--- a/build/gobind-pinecone/monolith.go
+++ b/build/gobind-pinecone/monolith.go
@@ -22,6 +22,7 @@ import (
"github.com/matrix-org/dendrite/clientapi/userutil"
"github.com/matrix-org/dendrite/cmd/dendrite-demo-pinecone/conn"
"github.com/matrix-org/dendrite/cmd/dendrite-demo-pinecone/rooms"
+ "github.com/matrix-org/dendrite/cmd/dendrite-demo-pinecone/users"
"github.com/matrix-org/dendrite/cmd/dendrite-demo-yggdrasil/signing"
"github.com/matrix-org/dendrite/eduserver"
"github.com/matrix-org/dendrite/eduserver/cache"
@@ -326,6 +327,9 @@ func (m *DendriteMonolith) Start() {
// This is different to rsAPI which can be the http client which doesn't need this dependency
rsAPI.SetFederationAPI(fsAPI, keyRing)
+ userProvider := users.NewPineconeUserProvider(m.PineconeRouter, m.PineconeQUIC, m.userAPI, federation)
+ roomProvider := rooms.NewPineconeRoomProvider(m.PineconeRouter, m.PineconeQUIC, fsAPI, federation)
+
monolith := setup.Monolith{
Config: base.Cfg,
AccountDB: accountDB,
@@ -333,13 +337,14 @@ func (m *DendriteMonolith) Start() {
FedClient: federation,
KeyRing: keyRing,
- AppserviceAPI: asAPI,
- EDUInternalAPI: eduInputAPI,
- FederationAPI: fsAPI,
- RoomserverAPI: rsAPI,
- UserAPI: m.userAPI,
- KeyAPI: keyAPI,
- ExtPublicRoomsProvider: rooms.NewPineconeRoomProvider(m.PineconeRouter, m.PineconeQUIC, fsAPI, federation),
+ AppserviceAPI: asAPI,
+ EDUInternalAPI: eduInputAPI,
+ FederationAPI: fsAPI,
+ RoomserverAPI: rsAPI,
+ UserAPI: m.userAPI,
+ KeyAPI: keyAPI,
+ ExtPublicRoomsProvider: roomProvider,
+ ExtUserDirectoryProvider: userProvider,
}
monolith.AddAllPublicRoutes(
base.ProcessContext,
@@ -357,10 +362,12 @@ func (m *DendriteMonolith) Start() {
httpRouter.PathPrefix(httputil.PublicMediaPathPrefix).Handler(base.PublicMediaAPIMux)
pMux := mux.NewRouter().SkipClean(true).UseEncodedPath()
+ pMux.PathPrefix(users.PublicURL).HandlerFunc(userProvider.FederatedUserProfiles)
pMux.PathPrefix(httputil.PublicFederationPathPrefix).Handler(base.PublicFederationAPIMux)
pMux.PathPrefix(httputil.PublicMediaPathPrefix).Handler(base.PublicMediaAPIMux)
pHTTP := m.PineconeQUIC.HTTP()
+ pHTTP.Mux().Handle(users.PublicURL, pMux)
pHTTP.Mux().Handle(httputil.PublicFederationPathPrefix, pMux)
pHTTP.Mux().Handle(httputil.PublicMediaPathPrefix, pMux)