aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorKegsay <kegan@matrix.org>2020-12-04 14:11:01 +0000
committerGitHub <noreply@github.com>2020-12-04 14:11:01 +0000
commitb507312d4cf9d35b5d4eaaa01a7f74d095b825f8 (patch)
tree2812bd7453da07a3c2850fb0b27a740c950af212 /cmd
parentc052edafdd765d821f9732add4f5d33962ba5ba4 (diff)
MSC2836 threading: part 2 (#1596)
* Update GMSL * Add MSC2836EventRelationships to fedsender * Call MSC2836EventRelationships in reqCtx * auth remote servers * Extract room ID and servers from previous events; refactor a bit * initial cut of federated threading * Use the right client/fed struct in the response * Add QueryAuthChain for use with MSC2836 * Add auth chain to federated response * Fix pointers * under CI: more logging and enable mscs, nil fix * Handle direction: up * Actually send message events to the roomserver.. * Add children and children_hash to unsigned, with tests * Add logic for exploring threads and tracking children; missing storage functions * Implement storage functions for children * Add fetchUnknownEvent * Do federated hits for include_children if we have unexplored children * Use /ev_rel rather than /event as the former includes child metadata * Remove cross-room threading impl * Enable MSC2836 in the p2p demo * Namespace mscs db * Enable msc2836 for ygg Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/dendrite-demo-libp2p/main.go6
-rw-r--r--cmd/dendrite-demo-yggdrasil/main.go6
-rw-r--r--cmd/generate-config/main.go2
3 files changed, 14 insertions, 0 deletions
diff --git a/cmd/dendrite-demo-libp2p/main.go b/cmd/dendrite-demo-libp2p/main.go
index 9aae34e3..92c283b5 100644
--- a/cmd/dendrite-demo-libp2p/main.go
+++ b/cmd/dendrite-demo-libp2p/main.go
@@ -36,6 +36,7 @@ import (
"github.com/matrix-org/dendrite/roomserver"
"github.com/matrix-org/dendrite/setup"
"github.com/matrix-org/dendrite/setup/config"
+ "github.com/matrix-org/dendrite/setup/mscs"
"github.com/matrix-org/dendrite/signingkeyserver"
"github.com/matrix-org/dendrite/userapi"
"github.com/matrix-org/gomatrixserverlib"
@@ -130,6 +131,8 @@ func main() {
cfg.AppServiceAPI.Database.ConnectionString = config.DataSource(fmt.Sprintf("file:%s-appservice.db", *instanceName))
cfg.Global.Kafka.Database.ConnectionString = config.DataSource(fmt.Sprintf("file:%s-naffka.db", *instanceName))
cfg.KeyServer.Database.ConnectionString = config.DataSource(fmt.Sprintf("file:%s-e2ekey.db", *instanceName))
+ cfg.MSCs.MSCs = []string{"msc2836"}
+ cfg.MSCs.Database.ConnectionString = config.DataSource(fmt.Sprintf("file:%s-mscs.db", *instanceName))
if err = cfg.Derive(); err != nil {
panic(err)
}
@@ -190,6 +193,9 @@ func main() {
base.Base.PublicKeyAPIMux,
base.Base.PublicMediaAPIMux,
)
+ if err := mscs.Enable(&base.Base, &monolith); err != nil {
+ logrus.WithError(err).Fatalf("Failed to enable MSCs")
+ }
httpRouter := mux.NewRouter().SkipClean(true).UseEncodedPath()
httpRouter.PathPrefix(httputil.InternalPathPrefix).Handler(base.Base.InternalAPIMux)
diff --git a/cmd/dendrite-demo-yggdrasil/main.go b/cmd/dendrite-demo-yggdrasil/main.go
index 39643cc2..16f92cfa 100644
--- a/cmd/dendrite-demo-yggdrasil/main.go
+++ b/cmd/dendrite-demo-yggdrasil/main.go
@@ -39,6 +39,7 @@ import (
"github.com/matrix-org/dendrite/roomserver"
"github.com/matrix-org/dendrite/setup"
"github.com/matrix-org/dendrite/setup/config"
+ "github.com/matrix-org/dendrite/setup/mscs"
"github.com/matrix-org/dendrite/userapi"
"github.com/matrix-org/gomatrixserverlib"
@@ -83,6 +84,8 @@ func main() {
cfg.FederationSender.Database.ConnectionString = config.DataSource(fmt.Sprintf("file:%s-federationsender.db", *instanceName))
cfg.AppServiceAPI.Database.ConnectionString = config.DataSource(fmt.Sprintf("file:%s-appservice.db", *instanceName))
cfg.Global.Kafka.Database.ConnectionString = config.DataSource(fmt.Sprintf("file:%s-naffka.db", *instanceName))
+ cfg.MSCs.MSCs = []string{"msc2836"}
+ cfg.MSCs.Database.ConnectionString = config.DataSource(fmt.Sprintf("file:%s-mscs.db", *instanceName))
if err = cfg.Derive(); err != nil {
panic(err)
}
@@ -151,6 +154,9 @@ func main() {
base.PublicKeyAPIMux,
base.PublicMediaAPIMux,
)
+ if err := mscs.Enable(base, &monolith); err != nil {
+ logrus.WithError(err).Fatalf("Failed to enable MSCs")
+ }
httpRouter := mux.NewRouter().SkipClean(true).UseEncodedPath()
httpRouter.PathPrefix(httputil.InternalPathPrefix).Handler(base.InternalAPIMux)
diff --git a/cmd/generate-config/main.go b/cmd/generate-config/main.go
index 3233cf80..c4cb4abb 100644
--- a/cmd/generate-config/main.go
+++ b/cmd/generate-config/main.go
@@ -63,6 +63,8 @@ func main() {
if *defaultsForCI {
cfg.ClientAPI.RateLimiting.Enabled = false
cfg.FederationSender.DisableTLSValidation = true
+ cfg.MSCs.MSCs = []string{"msc2836"}
+ cfg.Logging[0].Level = "trace"
}
j, err := yaml.Marshal(cfg)