aboutsummaryrefslogtreecommitdiff
path: root/internal
AgeCommit message (Collapse)Author
2022-12-05Enable/Disable internal metrics (#2899)Till
Basically enables us to use `test.WithAllDatabases` when testing internal HTTP APIs, as this would otherwise result in Prometheus complaining about already registered metric names.
2022-12-02Test and CI related changes (#2896)Till
In an attempt to: - make on-boarding a bit easier (`go test ./...` should now not need additional postgres setup) - get code coverage faster, not only scheduled at night - test the `create-account` binary
2022-11-30Push rule evaluation tweaks (#2897)Neil Alexander
This tweaks push rule evaluation: 1. to be more strict around pattern matching and to not match empty patterns 3. to bail if we come across a `dont_notify`, since cycles after that are wasted 4. refactors `ActionsToTweaks` to make a bit more sense
2022-11-29Version 0.10.8v0.10.8Neil Alexander
2022-11-15Federation fixes for virtual hostingNeil Alexander
2022-11-11Deny guest access on several endpoints (#2873)Till
Second part for guest access, this adds a `WithAllowGuests()` option to `MakeAuthAPI`, allowing guests to access the specified endpoints. Endpoints taken from the [spec](https://spec.matrix.org/v1.4/client-server-api/#client-behaviour-14) and by checking Synapse endpoints for `allow_guest=true`.
2022-11-04Version 0.10.7 (#2861)v0.10.7Neil Alexander
Changelog and version bump.
2022-11-02Fix `moderncsqlite` errors and rebase onto `main` (#2832)0x1a8510f2
This is #2819 but rebased on latest `main`. This PR is against main too as opposed to the `moderncsqlite` branch. The main change here is simply: ```go // add query parameters to the dsn if strings.Contains(dsn, "?") { dsn += "&" } else { dsn += "?" } // wait some time before erroring if the db is locked // https://gitlab.com/cznic/sqlite/-/issues/106#note_1058094993 dsn += "_pragma=busy_timeout%3d10000" ``` ### Pull Request Checklist <!-- Please read https://matrix-org.github.io/dendrite/development/contributing before submitting your pull request --> * [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 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 privately. Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2022-11-01Version 0.10.6v0.10.6Neil Alexander
2022-10-31Version 0.10.5 (#2845)v0.10.5Neil Alexander
Changelog and version bump.
2022-10-21Version 0.10.4 (#2822)v0.10.4Neil Alexander
Changelog and version bump.
2022-10-17Scope transactions to endpoints (#2799)Till
To avoid returning results from e.g. `/redact` on `/sendToDevice` requests. Takes the raw URL path and uses `filepath.Dir` to remove the `txnID` (file) from it. Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2022-10-14Dendrite 0.10.3v0.10.3Neil Alexander
commit c6e18c18e93b54c006c6b4d0044aa53a0735a906 Author: Neil Alexander <neilalexander@users.noreply.github.com> Date: Fri Oct 14 15:42:58 2022 +0100 Changelog and version bump
2022-10-11Private read receipts (#2789)Neil Alexander
Implement behaviours for `m.read.private` receipts.
2022-10-07Version 0.10.2 (#2778)v0.10.2Neil Alexander
Changelog and version bump.
2022-10-05Check PostgreSQL connection count (#2760)Neil Alexander
This PR queries PostgreSQL for the `max_connections` and `superuser_reserved_connections` settings and then ensures that Dendrite's `max_open_conns` doesn't exceed the allowed value. This is a really common source of configuration problems and can either result in blocking queries or deadlocks, so it seems reasonable that we complain as loudly as possible when it happens.
2022-10-05Side effect import bleve analyzer languages (#2763)Till
... to actually allow different languages. Fixes #2761 Binary size increases by ~1MB.
2022-09-30Version 0.10.1v0.10.1Neil Alexander
2022-09-30Version 0.10.0 (#2753)v0.10.0Neil Alexander
Changelog and version bump.
2022-09-27Fulltext implementation using Bleve (#2675)Till
Based on #2480 This actually indexes events based on their event type. They are removed from the index if we receive a `m.room.redaction` event on the `OutputRoomEvent` stream. An admin endpoint is added to reindex all existing events. Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2022-09-22Version 0.9.9 (#2732)v0.9.9Neil Alexander
Changelog and version bump.
2022-09-22Tweak `InsertMigration` to avoid logging (#2720)Till
We'd still produce logs in Postgres when trying to insert a migration we already ran. This should stop us from creating those log entries.
2022-09-20Update dependencies (#2729)Neil Alexander
This updates Dendrite dependencies.
2022-09-13Check unique constraint errors when manually inserting migrations (#2712)Till
This should avoid unnecessary logging on startup if the migration (were we need `InsertMigration`) was already executed. This now checks for "unique constraint errors" for SQLite and Postgres and fails the startup process if the migration couldn't be manually inserted for some other reason.
2022-09-12Version 0.9.8v0.9.8Neil Alexander
2022-09-09Version 0.9.7 (#2707)v0.9.7Neil Alexander
Changelog and version bump.
2022-09-09Change detection of already executed migrations (#2665)Till
This changes the detection of already executed migrations for the roomserver state block and keychange refactor. It now uses schema tables provided by the database engine to check if the column was already removed. We now also store the migration in the migrations table. This should stop e.g. Postgres from logging errors like `ERROR: column "event_nid" does not exist at character 8`.
2022-09-09Update getting pushrules, add tests, tweak pushrules (#2705)Till
This PR - adds tests for `evaluatePushrules` - removes the need for the UserAPI on the `OutputStreamEventConsumer` (for easier testing) - adds a method to get the pushrules from the database - adds a new default pushrule for `m.reaction` events (and some other tweaks)
2022-09-07Fulltext implementation incl. config (#2480)Till
This adds the main component of the fulltext search. This PR doesn't do anything yet, besides creating an empty fulltextindex folder if enabled. Indexing events is done in a separate PR.
2022-09-07Handle errors differently in the `DeviceListUpdater` (#2695)Till
`If a device list update goes missing, the server resyncs on the next one` was failing because a previous test would receive a `waitTime` of 1h, resulting in the test timing out. This now tries to handle the returned errors differently, e.g. by using the default `waitTime` of 2s. Also doesn't try further users in the list, if one of the errors would cause a longer `waitTime`.
2022-09-06Stronger default power levelsNeil Alexander
2022-09-05Tweak Sentry againNeil Alexander
2022-09-05Set Sentry user where knownNeil Alexander
2022-09-05Improve Sentry reportingNeil Alexander
2022-09-01Version 0.9.6 (#2689)v0.9.6Neil Alexander
Changelog and version bump.
2022-08-25Version 0.9.5 (#2673)v0.9.5Neil Alexander
Changelog and version bump.
2022-08-19Version 0.9.4 (#2658)v0.9.4Neil Alexander
### Fixes * A bug in the roomserver around handling rejected outliers has been fixed * Backfilled events will now use the correct history visibility where possible * The device list updater backoff has been fixed, which should reduce the number of outbound HTTP requests and `Failed to query device keys for some users` log entries for dead servers * The `/sync` endpoint will no longer incorrectly return room entries for retired invites which could cause some rooms to show up in the client "Historical" section * The `/createRoom` endpoint will now correctly populate `is_direct` in invite membership events, which may help clients to classify direct messages correctly * The `create-account` tool will now log an error if the shared secret is not set in the Dendrite config * A couple of minor bugs have been fixed in the membership lazy-loading * Queued EDUs in the federation API are now cached properly
2022-08-15Version 0.9.3v0.9.3Neil Alexander
2022-08-12Version 0.9.2 (#2638)v0.9.2Neil Alexander
2022-08-12Use `/admin/v1/register` in `create-account` (#2484)Till
* Get all account data on CompleteSync * Revert "Get all account data on CompleteSync" This reverts commit 44a3e566d8fb940b0b757aea9b8408fa19ea9f54. * Use /_synapse/admin/v1/register to create account * Linting * Linter again :) * Update docs * Use HTTP API to reset password, add option to User API `PerformPasswordUpdate` to invalidate sessions * Fix routing name * Tell me more about what went wrong * Deprecate the `-reset-password` flag, document the new API Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2022-08-12Protect user_interactive reads and writes with locks (#2635)Tak Wai Wong
* Protect user_interactive reads and writes with locks * Ignore golangci-lint false positive * fix lint Co-authored-by: Tak Wai Wong <tak@hntlabs.com>
2022-08-11Generic-based internal HTTP API (#2626)Neil Alexander
* Generic-based internal HTTP API (tested out on a few endpoints in the federation API) * Add `PerformInvite` * More tweaks * Fix metric name * Fix LookupStateIDs * Lots of changes to clients * Some serverside stuff * Some error handling * Use paths as metric names * Revert "Use paths as metric names" This reverts commit a9323a6a343f5ce6461a2e5bd570fe06465f1b15. * Namespace metric names * Remove duplicate entry * Remove another duplicate entry * Tweak error handling * Some more tweaks * Update error behaviour * Some more error tweaking * Fix API path for `PerformDeleteKeys` * Fix another path * Tweak federation client proxying * Fix another path * Don't return typed nils * Some more tweaks, not that it makes any difference * Tweak federation client proxying * Maybe fix the key backup test
2022-08-05Invalidate lazyLoadCache if we're doing an initial sync (#2623)Till
* Bypass lazyLoadCache if we're doing an initial sync * Make the linter happy again? * Revert "Make the linter happy again?" This reverts commit 52a5691ba3c17c05698bcc6a13092090f27ace63. * Try that again * Invalidate LazyLoadCache on initial syncs * Remove unneeded check * Add TODO * Rename Invalite -> InvalidateLazyLoadedUser * Thanks IDE
2022-08-05Do not use `ioutil` as it is deprecated (#2625)Neil Alexander
2022-08-05Fix linter issues (#2624)Till
* Try that again * All hail the mighty linter? * And once again * goimport all the things
2022-08-03Version 0.9.1 (#2616)v0.9.1Neil Alexander
* Version 0.9.1 * Update CHANGES.md
2022-08-03Remove roominfo cache (#2615)Neil Alexander
* Remove roominfo cache It's the source of a number of race conditions which are seemingly causing bugs and CI failures. * Make the linter less sad
2022-08-01Version 0.9.0 (#2602)v0.9.0Neil Alexander
2022-07-25Update database migrations, remove goose (#2264)Till
* Add new db migration * Update migrations Remove goose * Add possibility to test direct upgrades * Try to fix WASM test * Add checks for specific migrations * Remove AddMigration Use WithTransaction Add Dendrite version to table * Fix linter issues * Update tests * Update comments, outdent if * Namespace migrations * Add direct upgrade tests, skipping over one version * Split migrations * Update go version in CI * Fix copy&paste mistake * Use contexts in migrations Co-authored-by: kegsay <kegan@matrix.org> Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2022-07-19Add event state key cache (#2576)Neil Alexander