Commit graph

2724 commits

Author SHA1 Message Date
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
Devon Hudson a252ad4516
Isolate p2p specific federation & federation db apis 2023-01-13 11:40:25 -07:00
Devon Hudson f45d612ebd
Refactor federationapi db to better distinguish p2p specifics 2023-01-13 11:35:49 -07:00
Devon Hudson d926444daf
Add new test db files 2023-01-12 16:15:27 -07:00
Devon Hudson 51d2e7f51e
Remove package name shadowing 2023-01-12 16:13:50 -07:00
Devon Hudson e83940b5cf
Move in memory test databases into test package 2023-01-12 16:11:15 -07:00
Devon Hudson 75bc8ab826
Various typos and whitespace cleanup 2023-01-12 14:16:23 -07:00
Devon Hudson 4626f6c9d8
Fix license headers on some files 2023-01-12 14:05:55 -07:00
Devon Hudson e089015020
Refactor federation perform relay bailout to reduce duplication 2023-01-12 13:24:28 -07:00
Devon Hudson 0f7ac684b7
Remove accidentally added file 2023-01-12 12:43:52 -07:00
Devon Hudson b2c8094643
Name test constants for clarity 2023-01-12 12:27:06 -07:00
Devon Hudson 73c42232fc
Fix race in refactored statistics 2023-01-12 12:20:03 -07:00
Devon Hudson e54e036948
Remove code complexity when adding relay server 2023-01-12 11:35:54 -07:00
Devon Hudson 7fb194fc61
Rework statistics offline/blacklist clearing logic to flow better 2023-01-12 11:23:08 -07:00
Devon Hudson f6a9a77ecc
Check assumed offline state in statistics test 2023-01-12 11:22:10 -07:00
Devon Hudson cba0644ec2
Refactor stats success to clarify whether sent via relay or direct 2023-01-12 10:44:52 -07:00
Devon Hudson 75fd677081
Merge branch 'main' into mailbox 2023-01-12 09:29:16 -07:00