aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-05-05Prefer /state_ids when missing state across federation (#1008)Kegsay
* Prefer /state_ids when missing state across federation * Linting * Better logging
2020-05-05Fix RespState/RespSendJoin (#1005)Neil Alexander
* Update gmsl * Update gomatrixserverlib * Add link to spec
2020-05-04Roomserver perform leave (#1004)Neil Alexander
* First pass at PerformLeave * Fix SQLite bulkSelectEventStateKey * Update gomatrixserverlib * Fix bugs * Tidy a bit * Satisfy King Linter * Review comments * Review comments * Fix constants in SQLite event state keys table
2020-05-04Update gomatrixserverlibNeil Alexander
2020-05-04Fix newlines between white/blacklist test names in buildkite annotations (#1003)Andrew Morgan
2020-05-04Roomserver perform join (#1001)Neil Alexander
* Add PerformJoin template * Try roomserver perform join * Send correct server name to FS API * Pass through content, try to handle multiple server names * Fix local server checks * Don't refer to non-existent error * Add directory lookups of aliases * Remove unneeded parameters * Don't repeat join events into the roomserver * Unmarshal the content, that would help * Check if the user is already in the room in the fedeationapi too * Return incompatible room version error * Use Membership, don't try more servers than needed * Review comments, make FS API take list of servernames, dedupe them, break out of loop properly on success * Tweaks
2020-05-01Fix ordering when backfilling (#1000)Kegsay
* Fix ordering when backfilling The problem was that we weren't sorting the returned events by depth when sending them back to the caller, instead we were sorting by prev_events which is not the same thing. * Fixup tests
2020-05-01Limit database connections (#980, #564) (#998)Neil Alexander
* Limit database connections (#564) - Add new options to the config file database: max_open_conns: 100 max_idle_conns: 2 conn_max_lifetime: -1 - Implement connection parameter setup on the *DB (database/sql) in internal/sqlutil/trace.go:Open() - Propagate the values in the form of DbProperties interface via all the Open() and NewDatabase() functions Signed-off-by: Tomas Jirka <tomas.jirka@email.cz> * Fix wasm builds * Remove file accidentally added from working tree Co-authored-by: Tomas Jirka <tomas.jirka@email.cz>
2020-05-01Rename FS queue package to internal (#997)Neil Alexander
2020-05-01Fix prev_batch tokens (#999)Kegsay
2020-05-01Correctly generate backpagination tokens for events which have the same ↵Kegsay
depth (#996) * Correctly generate backpagination tokens for events which have the same depth With tests. Unfortunately the code around here is hard to understand. There will be a subsequent PR which fixes this up now that we have a test harness in place. * Add postgres impl * More linting * Fix psql statement so it actually works
2020-05-01Consolidation of roomserver APIs (#994)Neil Alexander
* Consolidation of roomserver APIs * Comment out alias tests for now, they are broken * Wire AS API into roomserver again * Roomserver didn't take asAPI param before so return to that * Prevent roomserver asking AS API for alias info * Rename some files * Remove alias_test, incoherent tests and unwanted appservice integration * Remove FS API inject on syncapi component
2020-04-30Add tests for the storage interface (#995)Kegsay
* Move docs to interface * Add tests around syncing * Add topology token test * Linting
2020-04-30Update gmsl for key validity fixNeil Alexander
2020-04-29Enable v5 rooms (#992)Neil Alexander
* Enable v5 roooms * Update sytest-whitelist * Enable v5 rooms by default, update gomatrixserverlib
2020-04-29Honour history_visibility when backfilling (#990)Kegsay
* Make backfill work for shared history visibility * fetch missing state on backfill to remember snapshots correctly * Fix gmsl to not mux in auth events into room state * Whoops * Linting
2020-04-29Update gomatrixserverlibNeil Alexander
2020-04-29Join room support in federation sender (#989)Neil Alexander
* Implement PerformJoinRequest * Rename perform functions * Check send join response * Temporary wiring to test federation sender room joins * Actually pass through the config * Make sure membership content shows join
2020-04-29Federation sender API remodel (#988)Neil Alexander
* Define an input API for the federationsender * Wiring for rooomserver input API and federation sender input API * Whoops, commit common too * Merge input API into query API * Rename FederationSenderQueryAPI to FederationSenderInternalAPI * Fix dendritejs * Rename Input to Perform * Fix a couple of inputs -> performs * Remove needless storage interface, add comments
2020-04-28Dependency inject the federation client so p2p binaries work as expected (#987)Kegsay
2020-04-28Unbreak the wasm build (#986)Kegsay
2020-04-28sql/backwards_extremities: Shift to table format and share code (#985)Kegsay
* sql/backwards_extremities: Shift to table format and share code This is an initial cut to reduce boilerplate at the storage layer. It removes the need for 2x `_table.go` files, one for each DB engine, replacing it with a single struct which has an interface which implements the raw SQL statements. The actual impl sits alongside the interface declaration which is generally regarded as best practice (though no canonical sources). Especially in this case where the impl is tiny (functions returning strings) and relies heavily on the function signatures of the table struct (for parameters), having the context in the same file is useful. * Remove _table redundancy
2020-04-28Fix URLDecodeMapValues (#984)Neil Alexander
* Update gomatrixserverlib * Fix URLDecodeMapValues * Update gomatrixserverlib
2020-04-28Implement backfill in the roomserver (#983)Kegsay
* Initial cut for backfilling The syncserver now asks the roomserver via QueryBackfill (which already existed to *handle* backfill requests) which then makes federation requests via gomatrixserverlib.RequestBackfill. Currently, tests fail on subsequent /messages requests because we don't know which servers are in the room, because we are unable to get state snapshots from a backfilled event because that code doesn't exist yet. * WIP backfill, doesn't work * Make initial backfill pass checks * Persist backfilled events with state snapshots * Remove debug lines * Linting * Review comments
2020-04-28Loopback event from invite response (#982)Neil Alexander
* Working invite v2 support * Fix copyright notice * Update gomatrixserverlib * Add fallthrough * Add missing continue * Update sytest-whitelist, gomatrixserverlib * Update gomatrixserverlib to test matrix-org/gomatrixserverlib#181 * Update gomatrixserverlib
2020-04-27Update gomatrixserverlibNeil Alexander
2020-04-24More invite support (#979)Neil Alexander
* Update gomatixserverlib * Try to build invite stripped state if not given to us * SendInvite improvements * Transpose invite_room_state into invite_state.events for sync API * Remove syncapi debugging output * Use RespInviteV2 * Update gomatrixserverlib * Send the invite event as a normal roomserver event too, for incorporating into room (should this be done by the roomserver automatically for invite inputs?) * Federation sender use invite_room_state, room server try to insert membership state * Check supported room versions on the invite endpoint * Prevent roomserver query API from trying to handle requests for stub rooms * Adding a nolint * Replace IsRoomStub with RoomNIDExcludingStubs, fix query API to use that instead * Review comments
2020-04-24Add new sytests to listKegan Dougal
2020-04-24Use a single storage.Database interface (#978)Kegsay
2020-04-22Fix sarama import URLs (#856)Neil Alexander
* Fix sarama import URLs * Update gomatrixserverlib * Update naffka * Update naffka * Update in kafka-producer
2020-04-22Response from /send_join now use gomatrixserverlib.RespSendJoin (#796)Behouba Manassé
* response from /send_join now use gomatrixserverlib.RespSendJoin * Update Dendrite gomatrixserverlib version * Fix spelling Co-authored-by: Andrew Morgan <andrew@amorgan.xyz> Co-authored-by: Cnly <minecnly@gmail.com> Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2020-04-22LRU cache for room versions in RS query API (#976)Neil Alexander
* Experimental LRU cache for room versions * Don't accidentally try to type-assert nil * Also reduce hits on query API * Use hashicorp implementation which mutexes for us * Define const for max cache entries * Rename to be specifically immutable, panic if we try to mutate a cache entry * Review comments * Remove nil guards, give roomserver integration test a cache * go mod tidy
2020-04-21Update gomatrixserverlibNeil Alexander
2020-04-20Perspective key fetching, some federation room join fixes (#975)Neil Alexander
* Update gomatrixserverlib * Test matrix.org as perspective key server * Base64 decode better * Optional strict validity checking in gmsl * Update gomatrixserverlib * Attempt to find missing auth events over federation (this shouldn't happen but I am guessing there is a synapse bug involved where we don't get all of the auth events) * Update gomatrixserverlib, debug logging * Remove debugging output * More verbose debugging * Print outliers * Increase timeouts for testing, observe contexts before trying to join over more servers * Don't block on roomserver (experimental) * Don't block on roomserver * Update gomatrixserverlib * Update gomatrixserverlib * Configurable perspective key fetchers * Output number of configured keys for perspective * Example perspective config included * Undo debug stack trace * Undo debug stack trace * Restore original HTTP listener in monolith * Fix lint * Review comments * Set default HTTP server timeout to 5 minutes now, block again when joining * Don't use HTTP address for HTTPS whoops * Update gomatrixserverlib * Update gomatrixserverlib * Update gomatrixserverlib * Actually add perspectives * Actually add perspectives * Update gomatrixserverlib
2020-04-20Add login sytests (#974)Kegsay
2020-04-19Fix nil http clients provided to components in polylith mode (#973)Alex Chen
Signed-off-by: Alex Chen <minecnly@gmail.com>
2020-04-18Ensure room version tests can be grouped whether failed or passed (#972)Alex Chen
Signed-off-by: Alex Chen <minecnly@gmail.com>
2020-04-17Allow anyone to publish rooms (#971)Kegsay
* Allow anyone to publish rooms * Formatting and unused var * Review comments
2020-04-16Federation fixes and error handling (#970)Neil Alexander
* Improve error handling in federation /send endpoint a bit * Remove unknownRoomError, use unmarshalError when unable to get room ID * Swap out a couple more internal server errors * Update gomatrixserverlib * Update gomatrixserverlib * Update gomatrixserverlib * Update gomatrixserverlib * Update gomatrixserverlib * Update gomatrixserverlib * Return bad limit in error * Same with domain/userid
2020-04-16Set default room version to 4 (#957)Neil Alexander
* Set default room version to 4 * Default to v1 when room_version key missing Signed-off-by: Alex Chen <minecnly@gmail.com> * Squashed commit of the following: commit c1bca95adbe04a17d8feb91aa24dde9c4cffb1fb Author: Kegsay <kegan@matrix.org> Date: Thu Apr 16 10:06:55 2020 +0100 Add SQL tracing via DENDRITE_TRACE_SQL (#968) * Add SQL tracing via DENDRITE_TRACE_SQL Add this to `internal/sqlutil` in preparation for #897 * Not entirely commit c2ea96190944d8e39b0c200e43b1eedfeeeb49a6 Author: Kegsay <kegan@matrix.org> Date: Wed Apr 15 17:48:40 2020 +0100 Add HTTP trace logging (#965) * Dump all requests/response server-side * Wrap in DENDRITE_TRACE * DENDRITE_TRACE_HTTP is better * Bugfix for response body and linting * False is true and true is false * Linting * How did this get missed * More linting * Update gomatrixserverlib * Remove unneeded imports Co-authored-by: Cnly <minecnly@gmail.com>
2020-04-16Add SQL tracing via DENDRITE_TRACE_SQL (#968)Kegsay
* Add SQL tracing via DENDRITE_TRACE_SQL Add this to `internal/sqlutil` in preparation for #897 * Not entirely
2020-04-15Add HTTP trace logging (#965)Kegsay
* Dump all requests/response server-side * Wrap in DENDRITE_TRACE * DENDRITE_TRACE_HTTP is better * Bugfix for response body and linting * False is true and true is false * Linting * How did this get missed * More linting
2020-04-15Use topological ordering for /messages response (#966)Neil Alexander
* Use topological ordering for /messages response * Update gomatrixserverlib
2020-04-15Tweaks to backfill (#964)Neil Alexander
2020-04-14Move /room/{roomID}/state endpoints into client API (#606) (#962)Neil Alexander
* Move /room/{roomID}/state endpoints into client API (#606) * Update sytest-whitelist * Blacklist tests which rely on endpoints we don't implement
2020-04-14WIP: Add libp2p-go (#956)Hilmar Gústafsson
* Add libp2p-go * Some tweaks, tidying up (cherry picked from commit 1a5bb121f8121c4f68a27abbf25a9a35a1b7c63e) * Move p2p dockerfile (cherry picked from commit 8d3bf44ea1bf37f950034e73bcdc315afdabe79a) * Remove containsBackwardsExtremity * Fix some linter errors, update some libp2p packages/calls, other tidying up * Add -port for dendrite-p2p-demo * Use instance name as key ID * Remove P2P demo docker stuff, no longer needed now that we have SQLite * Remove Dockerfile-p2p too * Remove p2p logic from dendrite-monolith-server * Inject publicRoomsDB in publicroomsapi Inject publicRoomsDB instead of switching on base.libP2P. See: https://github.com/matrix-org/dendrite/pull/956/files?file-filters%5B%5D=.go#r406276914 * Fix lint warning * Extract mDNSListener from base.go * Extract CreateFederationClient into demo * Create P2PDendrite from BaseDendrite Extract logic specific to P2PDendrite from base.go * Set base.go to upstream/master * Move pubsub to demo cmd * Move PostgreswithDHT to cmd * Remove unstable features * Add copyrights * Move libp2pvalidator into p2pdendrite * Rename dendrite-p2p-demo -> dendrite-demo-libp2p * Update copyrights * go mod tidy Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2020-04-14Are we synapse yet? (#960)Kegsay
* Add a script which tracks synapse parity based on sytests Processes results.tap to give you a percentage check. * Pretty * argparse and -v output
2020-04-14S7evinK: basicauth metrics (#961)Kegsay
* Add setting to enable/disable metrics (#461) Add basic auth to /metric handlers Signed-off-by: Till Faelligen <tfaelligen@gmail.com> * Add warning message if metrics are exposed without protection * Remove redundant type conversion Signed-off-by: Till Faelligen <tfaelligen@gmail.com> * SetBasicAuth per test case * Update warning message and change loglevel to warn * Update common/config/config.go * Update dendrite-config.yaml Co-authored-by: Till Faelligen <tfaelligen@gmail.com> Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2020-04-14support non-exclusive namespaces for AS (#828)mohit kumar singh
Signed-off-by: MohitKS5 <mohitkumarsingh907@gmail.com> Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com> Co-authored-by: Kegsay <kegan@matrix.org>
2020-04-14Check if user has the power level to edit the room visibility (#900)Prateek Sachan
* Check if user has the power level to edit the room visibility * fix review changes * Add nil check for queryEventsRes.StateEvents Co-authored-by: Alex Chen <Cnly@users.noreply.github.com> Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>