Commit graph

2740 commits

Author SHA1 Message Date
Devon Hudson 7900bfeb52
Remove outdated comments 2023-01-23 10:34:51 -07:00
Devon Hudson 5773e8722f
Merge branch 'main' into mailbox 2023-01-23 10:08:48 -07:00
Devon Hudson 1551539c24
Run fed routing tests with both databases 2023-01-23 09:36:01 -07:00
Devon Hudson 298e3455d5
Move transaction request tests beside txn request code 2023-01-23 09:35:36 -07:00
Till 48fa869fa3
Use t.TempDir for SQLite databases, so tests don't rip out each others databases (#2950)
This should hopefully finally fix issues about `disk I/O error` as seen
[here](https://gitlab.alpinelinux.org/alpine/aports/-/jobs/955030/raw)

Hopefully this will also fix `SSL accept attempt failed` issues by
disabling HTTP keep alives when generating a config for CI.
2023-01-23 13:17:15 +01:00
Devon Hudson 9d52bed9c1
Check error and log when closing full text search 2023-01-20 11:59:07 -07:00
Devon Hudson 4dab13a5da
Fix pinecone monolith test with Stop working properly 2023-01-20 11:53:29 -07:00
Devon Hudson a2be8ca873
Only perform mediaapi metrics if enabled in config 2023-01-20 11:52:54 -07:00
Devon Hudson 33cdc5adb7
Close full text search index on dendrite shutdown 2023-01-20 11:52:10 -07:00
Devon Hudson 3b76c776f6
Merge branch 'main' into mailbox 2023-01-20 11:49:07 -07:00
Till 430932f0f1
Version 0.11.0 (#2949) 2023-01-20 16:20:01 +01:00
Catalan Lover 25cb65acdb
Change Default Room version to 10 (#2933)
This PR implements
[MSC3904](https://github.com/matrix-org/matrix-spec-proposals/pull/3904).
This PR is almost identical to #2781 but this PR is also filed well
technically 1 day before the MSC passes FCP but well everyone knows this
MSC is expected to have passed FCP on monday so im refiling this change
today on saturday as i was doing prep work for monday. I assume that
this PR wont be counted as clogging the queue since by the next time i
expect to be a work day for this project this PR will be implementing an
FCP passed disposition merge MSC.

Also as for the lack of tests i belive that this simple change does not
need to pass new tests due to that these tests are expected to already
have been passed by the successful use of Dendrite with Room version 10
already.

### Pull Request Checklist

* [X] I have added tests for PR _or_ I have justified why this PR
doesn't need tests.
* [X] Pull request includes a [sign
off](https://github.com/matrix-org/dendrite/blob/main/docs/CONTRIBUTING.md#sign-off)

Signed-off-by: Catalan Lover <catalanlover@protonmail.com>

Co-authored-by: Till <2353100+S7evinK@users.noreply.github.com>
Co-authored-by: kegsay <kegan@matrix.org>
2023-01-20 15:41:29 +01:00
Till caf310fd79
AWSY missing federation tests (#2943)
In an attempt to fix the missing AWSY tests and to get to 100%
server-server compliance.
2023-01-20 15:18:06 +01:00
Bernhard Feichtinger a2b4860912
Fix oversight in cmd/generate-config (#2946)
The -dir argument was ignored for media_api->base_path.
Signed-off-by: `Bernhard Feichtinger
<43303168+BieHDC@users.noreply.github.com>`
2023-01-20 13:13:36 +01:00
Till ce2bfc3f2e
Make tests more reliable (#2948)
When using `testrig.CreateBase` and then using that base for other
`NewInternalAPI` calls, we never actually shutdown the components.
`testrig.CreateBase` returns a `close` function, which only removes the
database, so still running components have issues connecting to the
database, since we ripped it out underneath it - which can result in
"Disk I/O" or "pq deadlock detected" issues.
2023-01-20 12:45:56 +01:00
Devon Hudson e958251461
Fix spelling mistake in comment for linter... 2023-01-19 16:07:49 -07:00
Devon Hudson 87fde8fdf8
Add doc comments for relayapi db interface 2023-01-19 16:04:55 -07:00
Devon Hudson acb6f65c77
Add doc comments for fedapi assumed offline db interface 2023-01-19 15:38:13 -07:00
Devon Hudson f4c328fed8
Add doc comments for fedapi relay server db interface 2023-01-19 15:34:50 -07:00
Devon Hudson f8e11207c1
Add PurgeRoom to in memory federation db 2023-01-19 14:49:28 -07:00
Devon Hudson 3c54ea1d56
Merge branch 'main' into mailbox 2023-01-19 14:47:14 -07:00
Devon Hudson 491ee90d49
Add missed file updates in refactor 2023-01-19 14:33:30 -07:00
Devon Hudson 3f10d42c1b
Remove name ghosting when referring to receipts 2023-01-19 14:30:18 -07:00
Devon Hudson b3af289136
Update to gmsl main with s&f changes 2023-01-19 13:59:36 -07:00
Neil 738686ae68
Add /_dendrite/admin/purgeRoom/{roomID} (#2662)
This adds a new admin endpoint `/_dendrite/admin/purgeRoom/{roomID}`. It
completely erases all database entries for a given room ID.

The roomserver will start by clearing all data for that room and then
will generate an output event to notify downstream components (i.e. the
sync API and federation API) to do the same.

It does not currently clear media and it is currently not implemented
for SQLite since it relies on SQL array operations right now.

Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
Co-authored-by: Till Faelligen <2353100+S7evinK@users.noreply.github.com>
2023-01-19 21:02:32 +01:00
Devon Hudson 18dec3807d
Add comments to dest queue relay server sending 2023-01-19 10:53:09 -07:00
Devon Hudson e1c50b78bd
Rename destination queue variable for correctness 2023-01-19 10:10:39 -07:00
Devon Hudson a5da7301fd
Document relayapi db table interfaces 2023-01-18 18:07:17 -07:00
Devon Hudson 1981ac2735
Generate test dendrite config for sqlite in monolith mode 2023-01-18 16:36:25 -07:00
Devon Hudson 91126e6efa
Fix sqlite unit test parallelization issues 2023-01-18 16:02:32 -07:00
Devon Hudson 703d4371f5
Update gmsl dependency 2023-01-18 09:50:50 -07:00
Devon Hudson 02eff71f40
Use valid servers in relayapi http routing test 2023-01-18 09:29:04 -07:00
genofire 67f5c5bc1e
fix(helm): extract image tag to value (and use as default from Chart.… (#2934)
improve image tag handling on the default helm way.
with usage of appVersion from:

0995dc4822/helm/dendrite/Chart.yaml (L4)

maybe you like to review @S7evinK ?

### Pull Request Checklist

<!-- Please read
https://matrix-org.github.io/dendrite/development/contributing before
submitting your pull request -->

* [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: `Geno <geno+dev@fireorbit.de>`
2023-01-18 08:45:34 +01:00
Devon Hudson 5833c86aca
Insert relay transaction destinations in a single db transaction 2023-01-17 17:41:04 -07:00
Devon Hudson cbad03fc5e
Add validation to relay_txn prev entry id 2023-01-17 17:22:05 -07:00
Devon Hudson 41cd9d256e
Change to using default prevEntryIDs for initial relay query 2023-01-17 17:08:07 -07:00
Devon Hudson 5aa6b47a64
Order relay queue select to return oldest entries first 2023-01-17 16:47:10 -07:00
Devon Hudson 7c692e7eda
Check that db actually returned json blob for requested nid 2023-01-17 15:50:25 -07:00
Devon Hudson d440223e04
Delete relay entries and json in a single transaction 2023-01-17 15:38:04 -07:00
Devon Hudson c476e71ec3
Update sendrelay_test todo contexts to background 2023-01-17 14:49:30 -07:00
Devon Hudson 0e4d2593eb
Refactor relay perform_test for clarity 2023-01-17 13:41:01 -07:00
Devon Hudson 27b40621fd
Refactor relayapi routing tests to be parametric & reduce redundancy 2023-01-17 13:37:53 -07:00
Devon Hudson 4037ee3b21
Refactor relayapi to remove unnecessary internal http scaffolding 2023-01-17 12:41:58 -07:00
Till b55a7c238f
Version 0.10.9 (#2942) 2023-01-17 19:04:02 +01:00
Devon Hudson 8090f20c20
Remove redundant tests for assumed offline table 2023-01-17 10:33:58 -07:00
Till 0d0280cf5f
/sync performance optimizations (#2927)
Since #2849 there is no limit for the current state we fetch to
calculate history visibility. In large rooms this can cause us to fetch
thousands of membership events we don't really care about.
This now only gets the state event types and senders in our timeline,
which should significantly reduce the amount of events we fetch from the
database.

Also removes `MaxTopologicalPosition`, as it is an unnecessary DB call,
given we use the result in `topological_position < $1` calls.
2023-01-17 10:08:23 +01:00
Umar Getagazov 8582c7520a
Omit state field from /messages response if empty (#2940)
The field type is `[ClientEvent]` in the
[spec](https://spec.matrix.org/v1.5/client-server-api/#get_matrixclientv3roomsroomidmessages),
but right now `null` can also be returned. Omit the field completely if
it's empty. Some clients (rightfully) assume it's either not present at
all or it's of the right type (see
https://github.com/matrix-org/matrix-react-sdk/pull/9913).

### Pull Request Checklist

<!-- Please read
https://matrix-org.github.io/dendrite/development/contributing before
submitting your pull request -->

* [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
    * The PR is a simple struct tag fix
* [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: `Umar Getagazov <umar@handlerug.me>`

Signed-off-by: Umar Getagazov <umar@handlerug.me>
2023-01-17 09:07:42 +01:00
Andrew Morgan eeeb3017d6
Switch the default config option values for recaptcha_sitekey_class and recaptcha_form_field (#2939)
Attempting to use the [web auth fallback
mechanism](https://spec.matrix.org/v1.5/client-server-api/#fallback) for
Google ReCAPTCHA with the default setting for
`client_api.recaptcha_sitekey_class` of "g-recaptcha-response" results
in no captcha being rendered:


![image](https://user-images.githubusercontent.com/1342360/212482321-14980045-6e20-4d59-adaa-59a01ad88367.png)

I cross-checked the captcha code between [dendrite.matrix.org's fallback
page](https://dendrite.matrix.org/_matrix/client/r0/auth/m.login.recaptcha/fallback/web?session=asdhjaksd)
and [matrix-client.matrix.org's
one](https://matrix-client.matrix.org/_matrix/client/r0/auth/m.login.recaptcha/fallback/web?session=asdhjaksd)
(which both use the same captcha public key) and noticed a discrepancy
in the `class` attribute of the div that renders the captcha.
[ReCAPTCHA's docs
state](https://developers.google.com/recaptcha/docs/v3#automatically_bind_the_challenge_to_a_button)
to use "g-recaptcha" as the class for the submit button.

I noticed this when user `@parappanon:parappa.party` reported that they
were also seeing no captcha being rendered on their Dendrite instance.
Changing `client_api.recaptcha_sitekey_class` to "g-recaptcha" caused
their captcha to render properly as well.

There may have been a change in the class name from ReCAPTCHA v2 to v3?
The [docs for
v2](https://developers.google.com/recaptcha/docs/display#auto_render)
also request one uses "g-recaptcha" though.

Thus I propose changing the default setting to unbreak people's
recaptcha auth fallback pages. Should fix dendrite.matrix.org as well.
2023-01-16 12:52:30 +01:00
Devon Hudson 16eb9e4e49
Cleanup relay servers table and add batch deletion to sqlite 2023-01-13 16:00:36 -07:00
Devon Hudson 98d4e4f89b
Simplify assumed offline table sql 2023-01-13 11:54:13 -07:00