Skip to content
This repository was archived by the owner on Nov 25, 2024. It is now read-only.

Commit 79b87c7

Browse files
committed
Merge branch 'main' of github.com:matrix-org/dendrite
2 parents 488009c + 6cd1285 commit 79b87c7

File tree

24 files changed

+1195
-50
lines changed

24 files changed

+1195
-50
lines changed

.github/workflows/helm.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
version: v3.10.0
3333

3434
- name: Run chart-releaser
35-
uses: helm/chart-releaser-action@ed43eb303604cbc0eeec8390544f7748dc6c790d # specific commit, since `mark_as_latest` is not yet in a release
35+
uses: helm/chart-releaser-action@v1.6.0
3636
env:
3737
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
3838
with:

CHANGES.md

+21-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,28 @@
11
# Changelog
22

3-
## Dendrite 0.xx.x
3+
## Dendrite 0.13.8 (2024-09-13)
44

5-
### Other
5+
### Features
6+
7+
- The required Go version to build Dendrite is now 1.21
8+
- Support for authenticated media ([MSC3916](https://github.com/matrix-org/matrix-spec-proposals/pull/3916)) has been added
9+
- NATS can now connect to servers requiring authentication (contributed by [paigeadelethompson](https://github.com/paigeadelethompson))
10+
- Updated dependencies
11+
- Internal NATS Server has been updated from v2.10.7 to v2.10.20 (contributed by [neilalexander](https://github.com/neilalexander))
12+
13+
### Fixes
614

7-
- Bump required Go version to 1.21
15+
- Fix parsing `?ts` query param (contributed by [tulir](https://github.com/tulir))
16+
- Don't query the database if we could fetch all keys from cache
17+
- Fix media DB potentially leaking connections
18+
- Fixed a bug where we would return that an account exists if we encountered an unhandled error case
19+
- Fixed an issues where edited message could appear twice in search results (contributed by [adnull](https://github.com/adnull))
20+
- Outgoing threepid HTTP requests now correctly close the returned body (contributed by [ testwill](https://github.com/testwill))
21+
- Presence conflicts are handled better, reducing the amount of outgoing federation requests (contributed by [jjj333-p](https://github.com/jjj333-p))
22+
- Internal NATS now uses `SyncAlways` which should improve resilience against crashes (contributed by [neilalexander](https://github.com/neilalexander))
23+
- Whitespaces in the `X-Matrix` header are now handled correctly
24+
- `/.well-known/matrix/server` lookups now timeout after 30 seconds
25+
- Purging rooms has seen a huge speed-up
826

927
## Dendrite 0.13.7 (2024-04-09)
1028

build/docker/Dockerfile.demo-pinecone

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM docker.io/golang:1.22 AS base
1+
FROM docker.io/golang:1.22-alpine AS base
22

33
#
44
# Needs to be separate from the main Dockerfile for OpenShift,

contrib/dendrite-demo-i2p/main.go

+185
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
// Copyright 2017 Vector Creations Ltd
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package main
16+
17+
import (
18+
"flag"
19+
"os"
20+
"time"
21+
22+
"github.com/getsentry/sentry-go"
23+
"github.com/matrix-org/dendrite/internal"
24+
"github.com/matrix-org/dendrite/internal/caching"
25+
"github.com/matrix-org/dendrite/internal/httputil"
26+
"github.com/matrix-org/dendrite/internal/sqlutil"
27+
"github.com/matrix-org/dendrite/setup/jetstream"
28+
"github.com/matrix-org/dendrite/setup/process"
29+
"github.com/matrix-org/gomatrixserverlib/fclient"
30+
"github.com/prometheus/client_golang/prometheus"
31+
"github.com/sirupsen/logrus"
32+
33+
"github.com/matrix-org/dendrite/appservice"
34+
"github.com/matrix-org/dendrite/federationapi"
35+
"github.com/matrix-org/dendrite/roomserver"
36+
"github.com/matrix-org/dendrite/setup"
37+
basepkg "github.com/matrix-org/dendrite/setup/base"
38+
"github.com/matrix-org/dendrite/setup/config"
39+
"github.com/matrix-org/dendrite/setup/mscs"
40+
"github.com/matrix-org/dendrite/userapi"
41+
)
42+
43+
var (
44+
samAddr = flag.String("samaddr", "127.0.0.1:7656", "Address to connect to the I2P SAMv3 API")
45+
_, skip = os.LookupEnv("CI")
46+
)
47+
48+
func main() {
49+
cfg := setup.ParseFlags(true)
50+
if skip {
51+
return
52+
}
53+
54+
configErrors := &config.ConfigErrors{}
55+
cfg.Verify(configErrors)
56+
if len(*configErrors) > 0 {
57+
for _, err := range *configErrors {
58+
logrus.Errorf("Configuration error: %s", err)
59+
}
60+
logrus.Fatalf("Failed to start due to configuration errors")
61+
}
62+
processCtx := process.NewProcessContext()
63+
64+
internal.SetupStdLogging()
65+
internal.SetupHookLogging(cfg.Logging)
66+
internal.SetupPprof()
67+
68+
basepkg.PlatformSanityChecks()
69+
70+
logrus.Infof("Dendrite version %s", internal.VersionString())
71+
if !cfg.ClientAPI.RegistrationDisabled && cfg.ClientAPI.OpenRegistrationWithoutVerificationEnabled {
72+
logrus.Warn("Open registration is enabled")
73+
}
74+
75+
// create DNS cache
76+
var dnsCache *fclient.DNSCache
77+
if cfg.Global.DNSCache.Enabled {
78+
dnsCache = fclient.NewDNSCache(
79+
cfg.Global.DNSCache.CacheSize,
80+
cfg.Global.DNSCache.CacheLifetime,
81+
)
82+
logrus.Infof(
83+
"DNS cache enabled (size %d, lifetime %s)",
84+
cfg.Global.DNSCache.CacheSize,
85+
cfg.Global.DNSCache.CacheLifetime,
86+
)
87+
}
88+
89+
// setup tracing
90+
closer, err := cfg.SetupTracing()
91+
if err != nil {
92+
logrus.WithError(err).Panicf("failed to start opentracing")
93+
}
94+
defer closer.Close() // nolint: errcheck
95+
96+
// setup sentry
97+
if cfg.Global.Sentry.Enabled {
98+
logrus.Info("Setting up Sentry for debugging...")
99+
err = sentry.Init(sentry.ClientOptions{
100+
Dsn: cfg.Global.Sentry.DSN,
101+
Environment: cfg.Global.Sentry.Environment,
102+
Debug: true,
103+
ServerName: string(cfg.Global.ServerName),
104+
Release: "dendrite@" + internal.VersionString(),
105+
AttachStacktrace: true,
106+
})
107+
if err != nil {
108+
logrus.WithError(err).Panic("failed to start Sentry")
109+
}
110+
go func() {
111+
processCtx.ComponentStarted()
112+
<-processCtx.WaitForShutdown()
113+
if !sentry.Flush(time.Second * 5) {
114+
logrus.Warnf("failed to flush all Sentry events!")
115+
}
116+
processCtx.ComponentFinished()
117+
}()
118+
}
119+
120+
federationClient := basepkg.CreateFederationClient(cfg, dnsCache)
121+
httpClient := basepkg.CreateClient(cfg, dnsCache)
122+
123+
// prepare required dependencies
124+
cm := sqlutil.NewConnectionManager(processCtx, cfg.Global.DatabaseOptions)
125+
routers := httputil.NewRouters()
126+
127+
caches := caching.NewRistrettoCache(cfg.Global.Cache.EstimatedMaxSize, cfg.Global.Cache.MaxAge, caching.EnableMetrics)
128+
natsInstance := jetstream.NATSInstance{}
129+
rsAPI := roomserver.NewInternalAPI(processCtx, cfg, cm, &natsInstance, caches, caching.EnableMetrics)
130+
fsAPI := federationapi.NewInternalAPI(
131+
processCtx, cfg, cm, &natsInstance, federationClient, rsAPI, caches, nil, false,
132+
)
133+
134+
keyRing := fsAPI.KeyRing()
135+
136+
// The underlying roomserver implementation needs to be able to call the fedsender.
137+
// This is different to rsAPI which can be the http client which doesn't need this
138+
// dependency. Other components also need updating after their dependencies are up.
139+
rsAPI.SetFederationAPI(fsAPI, keyRing)
140+
141+
userAPI := userapi.NewInternalAPI(processCtx, cfg, cm, &natsInstance, rsAPI, federationClient, caching.EnableMetrics, fsAPI.IsBlacklistedOrBackingOff)
142+
asAPI := appservice.NewInternalAPI(processCtx, cfg, &natsInstance, userAPI, rsAPI)
143+
144+
rsAPI.SetAppserviceAPI(asAPI)
145+
rsAPI.SetUserAPI(userAPI)
146+
147+
monolith := setup.Monolith{
148+
Config: cfg,
149+
Client: httpClient,
150+
FedClient: federationClient,
151+
KeyRing: keyRing,
152+
153+
AppserviceAPI: asAPI,
154+
// always use the concrete impl here even in -http mode because adding public routes
155+
// must be done on the concrete impl not an HTTP client else fedapi will call itself
156+
FederationAPI: fsAPI,
157+
RoomserverAPI: rsAPI,
158+
UserAPI: userAPI,
159+
}
160+
monolith.AddAllPublicRoutes(processCtx, cfg, routers, cm, &natsInstance, caches, caching.EnableMetrics)
161+
162+
if len(cfg.MSCs.MSCs) > 0 {
163+
if err := mscs.Enable(cfg, cm, routers, &monolith, caches); err != nil {
164+
logrus.WithError(err).Fatalf("Failed to enable MSCs")
165+
}
166+
}
167+
168+
upCounter := prometheus.NewCounter(prometheus.CounterOpts{
169+
Namespace: "dendrite",
170+
Name: "up",
171+
ConstLabels: map[string]string{
172+
"version": internal.VersionString(),
173+
},
174+
})
175+
upCounter.Add(1)
176+
prometheus.MustRegister(upCounter)
177+
178+
// Expose the matrix APIs directly rather than putting them under a /api path.
179+
go func() {
180+
SetupAndServeHTTPS(processCtx, cfg, routers) //, httpsAddr, nil, nil)
181+
}()
182+
183+
// We want to block forever to let the HTTP and HTTPS handler serve the APIs
184+
basepkg.WaitForShutdown(processCtx)
185+
}

0 commit comments

Comments
 (0)