aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-09-23Update gomatrixserverlib to matrix-org/gomatrixserverlib#223Neil Alexander
2020-09-23Enforce valid key IDs (#1437)Neil Alexander
* Enforce valid key IDs * Don't use key_id from dendrite.yaml as it is in matrix_key.pem
2020-09-22Update gomatrixserverlibNeil Alexander
2020-09-22Fix backoff bugNeil Alexander
2020-09-22Initial notary support (#1436)Neil Alexander
* Initial work on notary support * Somewhat working (but not properly filtered) notary support, other tweaks * Update gomatrixserverlib
2020-09-22Process federated joins in background context (#1434)Neil Alexander
* Return early from federated room join * Synchronous perform-join as long as possible * Don't allow multiple federated joins to the same room by the same user
2020-09-21Use room version cache in Events()Neil Alexander
2020-09-21Soft-fail (#1364)Neil Alexander
* Initial work on soft-fail * Fix state block retrieval * Copy-pasta QueryLatestEventsAndState code * Fix state lookup * Clean up * Fix up failing sytest * Linting * Update previous events SQLite insert query * Update SQLite InsertPreviousEvent properly * Hopefully fix the event references updates Co-authored-by: Kegan Dougal <kegan@matrix.org>
2020-09-21Refactor backoff again (#1431)Neil Alexander
* Tweak backoffs * Refactor backoff some more, remove BackoffIfRequired as it adds unnecessary complexity * Ignore 404s
2020-09-16Implement rejected events (#1426)Kegsay
* WIP Event rejection * Still send back errors for rejected events Instead, discard them at the federationapi /send layer rather than re-implementing checks at the clientapi/PerformJoin layer. * Implement rejected events Critically, rejected events CAN cause state resolution to happen as it can merge forks in the DAG. This is fine, _provided_ we do not add the rejected event when performing state resolution, which is what this PR does. It also fixes the error handling when NotAllowed happens, as we were checking too early and needlessly handling NotAllowed in more than one place. * Update test to match reality * Modify InputRoomEvents to no longer return an error Errors do not serialise across HTTP boundaries in polylith mode, so instead set fields on the InputRoomEventsResponse. Add `Err()` function to make the API shape basically the same. * Remove redundant returns; linting * Update blacklist
2020-09-15Disable prometheus to unbreak testsKegan Dougal
2020-09-15Handle state with input event as new events (#1415)Neil Alexander
* SendEventWithState events as new * Use cumulative state IDs for final event * Error wrapping in calculateAndSetState * Handle overwriting same event type and state key * Hacky way to spot historical events * Don't exclude from sync * Don't generate output events when rewriting forward extremities * Update output event check * Historical output events * Define output room event type * Notify key changes on state * Don't send our membership event twice * Deduplicate state entries * Tweaks * Remove unnecessary nolint * Fix current state upsert in sync API * Send auth events as outliers, state events as rewrite * Sync API don't consume state events * Process events actually * Improve outlier check * Fix local room check * Remove extra room check, it seems to break the whole damn world * Fix federated join check * Fix nil pointer exception * Better comments on DeduplicateStateEntries * Reflow forced federated joins * Don't force federated join for possibly even local invites * Comment SendEventWithState better * Rewrite room state in sync API storage * Add TODO * Clean up all room data when receiving create event * Don't generate output events for rewrites, but instead notify that state is rewritten on the final new event * Rename to PurgeRoom * Exclude backfilled messages from /sync * Split out rewriting state from updating state from state res Co-authored-by: Kegan Dougal <kegan@matrix.org>
2020-09-14Don't use more than 999 variables in SQLite querys. (#1425)Kegsay
* Don't use more than 999 variables in SQLite querys. Solve this problem in a more general and reusable way. Also fix #1369 Add some unit tests. Signed-off-by: Henrik Sölver <henrik.solver@gmail.com> * Don't rely on testify for basic assertions * Readability improvements and linting Co-authored-by: Henrik Sölver <henrik.solver@gmail.com>
2020-09-10Add hardware requirements; fixes #324 (#1420)Kegsay
2020-09-10Add support for database migrations (#1416)Kegsay
* Add support for database migrations Closes #1246 This PR does NOT add any migrations as an example. I have manually tested that the library works with SQL and Go based upgrades correctly. Documentation should be sufficient for devs to add migrations. * Clarifications * Linting
2020-09-10Peeking via MSC2753 (#1370)Matthew Hodgson
Initial implementation of MSC2753, as tested by https://github.com/matrix-org/sytest/pull/944. Doesn't yet handle unpeeks, peeked EDUs, or history viz changing during a peek - these will follow. https://github.com/matrix-org/dendrite/pull/1370 has full details.
2020-09-08Process membership updates in writers (#1414)Neil Alexander
2020-09-08Exclude deleted keys from selectBatchDeviceKeysSQL (#1412)Neil Alexander
2020-09-08Track goids when running with tracing enabled (#1413)Kegsay
* Track goids when running with tracing enabled * Linting
2020-09-08Backoff for 401s (#1410)Neil Alexander
* Backoff for 401s * Human-readable retry_after in logs
2020-09-08Backoff ignore invalid signatures (#1408)Neil Alexander
2020-09-07Ignore state events with invalid signatures when joining rooms (#1407)Neil Alexander
* Use state from RespSendJoin post-check * Don't create input events for invalid events * Let's try this again * Update gomatrixserverlib * Update gomatrixserverlib to matrix-org/gomatrixserverlib@38f437f
2020-09-07Remove current state server (#1405)Kegsay
* Remove current state server Closes #1365 #1272 #1357 * Remove current state server from scripts/docs
2020-09-07Update gomatrixserverlib to matrix-org/gomatrixserverlib@66753e2Neil Alexander
2020-09-07Remove QueryBulkStateContent from current state server (#1404)Kegsay
* Remove QueryBulkStateContent from current state server Expected fail due to db impl not existing * Implement query bulk state content * Fix up rejecting invites over federation * Fix bulk content marshalling
2020-09-07Use background context when processing event with missing state (#1403)Neil Alexander
* Use background context when processing event with missing state * Five minute timeout * Remove context from txnreq, thread through instead * Fix unit tests
2020-09-04Update GetStateEvent behaviour (#1399)Neil Alexander
2020-09-04Remove QueryRoomsForUser from current state server (#1398)Kegsay
2020-09-04Password changes (#1397)Neil Alexander
* User API support for password changes * Password changes in client API * Update sytest-whitelist * Remove debug logging * Default logout_devices to true * Fix deleting devices by local part
2020-09-04Remove QuerySharedUsers from current state server (#1396)Kegsay
* Remove QuerySharedUsers from current state server * Bugfixes
2020-09-04Remove QueryCurrentState from current-state-server (#1395)Kegsay
2020-09-04Remove QueryKnownUsers from current state server (#1393)Kegsay
* Remove QueryKnownUsers from current state server * Fix HTTP mode
2020-09-04Sync bug fixes (#1394)Neil Alexander
* Sync bug fixes * Remove logging
2020-09-04Remove ServerACLs from the current state server (#1390)Kegsay
* Remove ServerACLs from the current state server Functionality moved to roomserver * Nothing to see here, move along
2020-09-04Fix nil txn bugNeil Alexander
2020-09-03Defer keyserver and federationsender wakeups to give HTTP listeners time to ↵Neil Alexander
start (#1389)
2020-09-03Implement more CSS storage functions in roomserver (#1388)Kegsay
2020-09-03Move currentstateserver API to roomserver (#1387)Kegsay
* Move currentstateserver API to roomserver Stub out DB functions for now, nothing uses the roomserver version yet. * Allow it to startup * Implement some current-state-server storage interface functions * Add missing package
2020-09-03FIFO ordering of input events (#1386)Neil Alexander
* Initial FIFOing of roomserver inputs * Remove EventID response from api.InputRoomEventsResponse * Don't send back event ID unnecessarily * Fix ordering hopefully * Reduce copies, use buffered task channel to reduce contention on other rooms * Fix error handling
2020-09-03Rate limiting (#1385)Neil Alexander
* Initial rate limiting * Move rate limiting to client API * Update rate limits to hopefully be self-cleaning * Use X-Forwarded-For, add comments * Reduce rate limit threshold * Tweak interval * Configurable backoff * Review comments, set cleanup interval to 30 seconds * Allow generate-config to produce sane CI config * Fix Complement dockerfile
2020-09-03Update complement.shKegsay
2020-09-02Add Queryer and Inputer and factor out more RSAPI stuff (#1382)Kegsay
* Add Queryer and use embedded structs * Add Inputer and factor out more RS API stuff This neatly splits up the RS API based on the functionality it provides, whilst providing a useful place for code sharing via the `helpers` package.
2020-09-02Fix #1381 (#1384)Neil Alexander
2020-09-02Version imprint (#1383)Neil Alexander
* Versions * Update build.sh
2020-09-02Use federation sender for backfill/getting missing events (#1379)Neil Alexander
* Use federation sender for backfill and getting missing events * Fix internal URL paths * Update go.mod/go.sum for matrix-org/gomatrixserverlib#218 * Add missing server implementations in HTTP interface
2020-09-02Refactor roomserver/internal - split perform stuff out (#1380)Kegsay
- New package `perform` which contains all `Perform` functions - New package `helpers` which contains helper functions used by both perform and query/input functions. - Perform invite/leave have no idea how to `WriteOutputEvents` and this is now returned from `PerformInvite` or `PerformLeave` respectively. Still to do: - RSAPI is fed into the inviter/joiner/leaver - this introduces circular logic so will need to be removed. - Put query operations in a `query` package. - Put input operations (and output) in an `input` package. - Factor out helper functions as much as possible, possibly rejigging the storage layer in the process.
2020-09-02Expand RoomInfo to cover more DB storage functions (#1377)Kegsay
* Factor more things to RoomInfo * Factor out remaining bits for RoomInfo * Linting for now
2020-09-01Put redactions/filters in the writer goroutine (#1378)Kegsay
* Put redactions in the writer goroutine * Update filters on writer goroutine
2020-09-01Fix duplicate writers (#1376)Neil Alexander
* Fix writers * Don't use writers in both shared and sqlite3
2020-09-01Report which component failed to consume (#1375)Neil Alexander