Commit graph

2858 commits

Author SHA1 Message Date
Till Faelligen 0df982a2e5
Update NATS again [skip ci] 2023-07-13 14:17:48 +02:00
Till 99f94fc735
Add revision to version string (#3147)
Since the removal of `build.sh`, we don't include any information about
the revision Dendrite was build from. Since go1.18, the revision a
binary was build from is automatically included, so we can try to get
that instead.

This also adds a `dendrite_up` metric showing the current version
(`dendrite_up{version="0.13.1+c796f20"} 1`)

Closes #2993
2023-07-11 13:56:25 +02:00
Till 69b2069dea
Avoid loops by setting end to an empty string if start == end (#3146) 2023-07-08 11:45:44 +02:00
Till Faelligen b965a08faa
Unknown issue 2023-07-07 22:52:23 +02:00
Till Faelligen ef32de928d
[NATS] Issue identified and fixed applied, workaround known. 2023-07-07 22:10:52 +02:00
Till 74a5ab6c24
Fix issues reported by Sentry (#3143)
This should fix a few issues reported by Sentry
2023-07-07 22:00:10 +02:00
Till eb9e90379d
Add event size checks similar to Synapse (#3140)
Companion to https://github.com/matrix-org/gomatrixserverlib/pull/400
This tries to mimic the logic found in Synapse, as dropping events can
break rooms (and we may end up in endless loops..)
2023-07-07 20:37:23 +02:00
Neil e93bdd56fd
Set max age for roomserver input stream to avoid excessive interior deletes (#3145)
If old messages build up in the input stream and do not get processed
successfully, this can create a significant drift between the stream
first sequence and the consumer ack floors, which results in a slow and
expensive start-up when interest-based retention is in use.

If a message is sat in the stream for 24 hours, it's probably not going
to get processed successfully, so let NATS drop them instead. Dendrite
can reconcile by fetching missing events later if it needs to.

---------

Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2023-07-07 19:59:34 +02:00
Till c08c7405db
Prepare statement on an existing transaction (#3144)
This should fix an issue with the database being locked for SQLite.
2023-07-07 13:09:39 +02:00
devonh cc9b695c1e
Populate syncapi state event prev_sender with userID (#3142) 2023-07-06 23:54:35 +00:00
devonh 3a125fd8fa
Fix prev event lookup in syncapi (#3141)
The syncapi operates using userID's so when querying for the previous
state event we need to lookup the userID from the given senderID before
the state query.
2023-07-06 19:50:28 +00:00
devonh d507c5fc95
Add pseudoID compatibility to Invites (#3126) 2023-07-06 15:15:24 +00:00
Till Faelligen fea946d914
Don't spam the logs - downgrade sentry 2023-07-06 10:55:21 +02:00
Till Faelligen 9f7e14e4d0
Back to the original version for now 2023-07-06 10:44:11 +02:00
Till Faelligen 4a666932f5
[debug] Downgrade NATS 2023-07-06 10:31:32 +02:00
Till Faelligen e1d76de6c6
Increase NATS server startup timeout 2023-07-06 10:04:46 +02:00
Till 49d75d3cf6
Version 0.13.1 (#3136) 2023-07-06 09:28:39 +02:00
Till Faelligen 5a87c703fa
Fix metrics.. 2023-07-05 12:34:53 +02:00
Till 4c3a526e1b
Fix adding state events to the database (#3133)
When we're adding state to the database, we check which eventNIDs are
already in a block, if we already have that eventNID, we remove it from
the list. In its current form we would skip over eventNIDs in the case
we already found a match (we're decrementing `i` twice)
My theory is, that when we later get the state blocks, we are receiving
"too many" eventNIDs (well, yea, we stored too many), which may or may
not can result in state resets when comparing different state snapshots.
(e.g. when adding state we stored a eventNID by accident because we
skipped it, later we add more state and are not adding it because we
don't skip it)
2023-07-04 17:15:44 +02:00
KuhnChris 532cdd1f45
Make it more go
Co-authored-by: Till <2353100+S7evinK@users.noreply.github.com>
2023-07-03 16:48:44 +02:00
KuhnChris eb51b1d24e Allow loginflows based on config 2023-07-03 14:45:02 +02:00
KuhnChris 272f3cc2cc gofmt -w fixes it. 2023-06-30 13:24:59 +02:00
KuhnChris 721782f4f0 Remove rouge "," 2023-06-30 12:53:46 +02:00
KuhnChris 579eb2f993 Make tests go brrrr. 2023-06-30 12:28:07 +02:00
KuhnChris 27f2867984 more cleanups 2023-06-30 12:28:07 +02:00
KuhnChris bf053595ae Clean up merge from main 2023-06-30 12:28:07 +02:00
KuhnChris 814e2b8e0e Apparently that cfg structure was there on purpose. 2023-06-30 12:28:07 +02:00
KuhnChris 843a3038fc 🤷 2023-06-30 12:28:07 +02:00
KuhnChris 1020f604e8 linting 2023-06-30 12:28:07 +02:00
Sijmen Schoon fa42d71862 Update TestValidationOfApplicationServices function name 2023-06-30 12:28:07 +02:00
Sijmen Schoon 4b98bbe180 Convert TestValidationOfApplicationServices to be table-driven 2023-06-30 12:28:07 +02:00
Sijmen Schoon 25f2b51c3d Move UsernameMatchesExclusiveNamespaces back to register.go 2023-06-30 12:28:07 +02:00
Sijmen Schoon 923f47c3a8 Improve documentation and naming 2023-06-30 12:28:07 +02:00
Sijmen Schoon 4cca740ecf Replace handcrafted genHTTPRequest with httptest.NewRequest 2023-06-30 12:28:07 +02:00
Sijmen Schoon a5f4c5e466 Fix typo "POSTGERS" in CONTRIBUTING.md 2023-06-30 12:28:07 +02:00
Sijmen Schoon d46267f9ef Simplify GET /login and add test for it 2023-06-30 12:28:07 +02:00
Sijmen Schoon aafb13f616 Remove dead, untested code from userIDIsWithinApplicationServiceNamespace 2023-06-30 12:28:07 +02:00
Sijmen Schoon 55bc0f6807 Improve ValidateApplicationService test coverage 2023-06-30 12:28:07 +02:00
Sijmen Schoon 9bef2876b4 Add tests for m.login.application_service
Signed-off-by: Sijmen Schoon <me@sijman.nl>
2023-06-30 12:28:07 +02:00
Sijmen Schoon 019a5d0e87 Make ValidateApplicationService work with UserIDs and move to internal
Signed-off-by: Sijmen <me@sijman.nl>
Signed-off-by: Sijmen Schoon <me@sijman.nl>
2023-06-30 12:28:07 +02:00
Sijmen Schoon 20b0bfaac0 Implement POST /login for LoginTypeApplicationService
Signed-off-by: Sijmen <me@sijman.nl>
Signed-off-by: Sijmen Schoon <me@sijman.nl>
2023-06-30 12:28:07 +02:00
Sijmen Schoon 29bf744832 Move ValidateApplicationService to a separate package for reuse
Signed-off-by: Sijmen <me@sijman.nl>
Signed-off-by: Sijmen Schoon <me@sijman.nl>
2023-06-30 12:28:07 +02:00
Sijmen Schoon 4899bdb663 Add LoginTypeApplicationService to GET /login
Signed-off-by: Sijmen <me@sijman.nl>
Signed-off-by: Sijmen Schoon <me@sijman.nl>
2023-06-30 12:28:07 +02:00
Sijmen Schoon 56f6ad1362 Replace "m.login.password" with authtypes constant
Signed-off-by: Sijmen <me@sijman.nl>
Signed-off-by: Sijmen Schoon <me@sijman.nl>
2023-06-30 12:28:07 +02:00
Till 2ee03fd657
Version 0.13.0 (#3127) 2023-06-30 08:49:37 +02:00
Omar Pakker de1ed9d486
Extend Dendrite Helm chart with some additional config options (#3077)
This set of changes introduces a few (compatible) changes to the Helm
chart:
- Allow PVC class to be set on each PVC, not only one-for-all.
- Allow Prometheus servicemonitor and rules labels to be empty.
- Have the option to generate the ingress (incl. TLS config) based on
dendrite_config.


* [x] I have added Go unit tests or [Complement integration
tests](https://github.com/matrix-org/complement) for this PR _or_ I have
justified why this PR doesn't need tests
* [x] Pull request includes a [sign off below using a legally
identifiable
name](https://matrix-org.github.io/dendrite/development/contributing#sign-off)
_or_ I have already signed off privately

Signed-off-by: Omar Pakker <Omar007@users.noreply.github.com>

---------

Signed-off-by: Omar Pakker <Omar007@users.noreply.github.com>
Co-authored-by: Till <2353100+S7evinK@users.noreply.github.com>
2023-06-30 08:26:06 +02:00
Till Faelligen 939ee325f8
Actually use the parameter 2023-06-29 18:02:11 +02:00
Till 23cd7877a1
Add MXIDMapping for pseudoID rooms (#3112)
Add `MXIDMapping` on membership events when
creating/joining rooms.
2023-06-28 20:29:49 +02:00
Till 4722f12fab
Fix setting displayname and avatar_url (#3125)
As per the spec, `displayname` and `avatar_url` may be empty.
2023-06-28 20:18:07 +02:00
Till a5ea928d0f
Fix syncAPI redactions (#3118)
Previously we were setting `redacted_because` to the PDU event, but as
per the spec it should really be a client event.
This fixes it.
2023-06-28 10:05:00 +02:00