aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-08-18Version 0.5.0rc1v0.5.0rc1Neil Alexander
2021-08-18Build Docker images using Go 1.17Neil Alexander
2021-08-18Add and use M_ROOM_IN_USE (#1972)Kevin Liu
Signed-off-by: nivekuil <mail@nivekuil.com> Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2021-08-18Delete device keys/signatures from key server when deleting devices (#1979)Neil Alexander
* Delete device keys/signatures from key server when deleting device from user API * Move loop to within database transaction * Don't fall over deleting no rows
2021-08-17Syslog integration (#1952)Sambhav Saggi
* Syslog integration, part 1 * Add protocol, make sure syslog actually logs * Make golangci-lint happy about shadow variables * Add syslog tag, wrap syslog in logLevelHook
2021-08-17Cross-signing fixes, notifications via sync, federation (#1974)Neil Alexander
* Initial work on signing key update EDUs * Fix build * Produce/consume EDUs * Producer logging * Only produce key change notifications for local users * Better naming * Try to notify sync * Enable feature * Use key change topic * Don't bother verifying signatures, validate key lengths if we can, notifier fixes * Copyright notices * Remove tests from whitelist until matrix-org/sytest#1117 * Some review comment fixes * Update to matrix-org/gomatrixserverlib@f9416ac * Remove unneeded parameter
2021-08-17Update golangci-lint (#1978)S7evinK
* Update golangci-lint * Use unconditional strings.TrimSuffix * Add error checks Signed-off-by: Till Faelligen <tfaelligen@gmail.com> * Disable lint typecheck * Fix ineffectual error assignment (#1976) Was working on another PR and noticed that golangci-lint was failing locally on `ineffassign` Signed-off-by: Devon Mizelle <dev@devon.so> * Revert "Disable lint typecheck" This reverts commit 3c76f219d3cb43e4ee9a9c319abd0b8879972cfc. Co-authored-by: Devon Mizelle <dev@devon.so>
2021-08-16Fix ineffectual error assignment (#1976)Devon Mizelle
Was working on another PR and noticed that golangci-lint was failing locally on `ineffassign` Signed-off-by: Devon Mizelle <dev@devon.so>
2021-08-11Add type field to DeviceMessage, allow fields to be nullable (#1969)Neil Alexander
2021-08-09Cross-signing signature handling (#1965)Neil Alexander
* Handle other signatures * Decorate key ID properly * Match by key IDs * Tweaks * Fixes * Fix /user/keys/query bug, review comments, update sytest-whitelist * Various wtweaks * Fix wiring for keyserver in API mode * Additional fixes
2021-08-06Cross-signing validation for self-sigs, expose signatures over ↵Neil Alexander
`/user/keys/query` and `/user/devices/{userId}` (#1962) * Enable unstable feature again * Try to verify when a device signs a key * Try to verify when a key signs a device * It's the self-signing key, not the master key * Fix error * Try to verify master key uploads * Actually we can't guarantee we can do that so nevermind * Add signatures into /devices/list request * Fix nil pointer * Reprioritise map creation * Don't skip devices that don't have signatures * Add some debug logging * Fix logic error in QuerySignatures * Fix bugs * Expose master and self-signing keys on /devices/list hopefully * maps are tedious * Expose signatures via /keys/query * Upload signatures when uploading keys * Fixes * Disable the feature again
2021-08-05Update to matrix-org/gomatrixserverlib@03e40faNeil Alexander
2021-08-04Cross-signing groundwork (#1953)Neil Alexander
* Cross-signing groundwork * Update to matrix-org/gomatrixserverlib#274 * Fix gobind builds, which stops unit tests in CI from yelling * Some changes from review comments * Fix build by passing in UIA * Update to matrix-org/gomatrixserverlib@bec8d22 * Process master/self-signing keys from devices call * nolint * Enum-ify the key type in the database * Process self-signing key too * Fix sanity check in device list updater * Fix check * Fix sytest, hopefully * Fix build
2021-08-04Ensure all create events have a snapshot NID of 0 (#1961)kegsay
Fixes #1924 for postgres users, though the underlying cause of why they aren't 0 in the first place is unresolved.
2021-08-04Cross-signing storage code (#1959)Neil Alexander
2021-08-04Fix sqlite migration issues (#1960)kegsay
* Do not store 'null' in the database for empty JSON arrays This can cause issues, though it should be noted that the majority of the time this will marshal/unmarshal just fine, see https://play.golang.org/p/Doe2NZUgv7Q * bugfix: sqlite migration should handle create events as having no 'before' snapshot The state snapshot for any given event in the roomserver represents the state _before_ the event. For the create event, this is nothing, so the state snapshot nid should be 0. In some cases this wasn't happening, resulting in a nice mix of possible options including: - A state snapshot without any state blocks `[]` or `null`. - A state snapshot with a single state block with a single event, the create event, causing a circular loop. This is incorrect as it represents the state before the event, not after. * Add state key check
2021-08-03Minimum version Go 1.15 (#1957)Neil Alexander
2021-08-03Add tracing to user API (#1948)kegsay
Use the trace version in tests so we can just implement the required API functions.
2021-08-03Update containerd dependencyNeil Alexander
2021-08-03Update dependencies (#1956)Neil Alexander
2021-08-02Read the right username field when performing account deactivation (#1954)kegsay
`Login` has 2 username fields, and we were always checking the deprecated one. Instead, check both.
2021-07-28Factor out StatementList to `sqlutil` and use it in `userapi`Kegan Dougal
It helps with the boilerplate.
2021-07-28Alias key backup endpoints onto /unstable, fix key backup bugs (#1947)Neil Alexander
* Default /unstable requests to stable endpoints if not overridden specifically with a custom route * Rewrite URL * Try something different * Fix routing manually * Fix selectLatestVersionSQL * Don't return 0 if no backup version exists * Log more useful error * fix up replace keys check * Don't enforce uniqueness on e2e_room_keys_versions_idx Co-authored-by: kegsay <kegan@matrix.org>
2021-07-27Update to neilalexander/utp@54ae7b1Neil Alexander
2021-07-27Key Backups (3/3) : Implement querying keys and various bugfixes (#1946)kegsay
* Add querying device keys Makes a bunch of sytests pass * Apparently only the current version supports uploading keys * Linting
2021-07-27Key Backups (2/3) : Add E2E backup key tables (#1945)kegsay
* Add PUT key backup endpoints and glue them to PerformKeyBackup * Add tables for storing backup keys and glue them into the user API * Don't create tables whilst still WIPing * writer on sqlite please * Linting
2021-07-27Use db writer on sqlite account table (#1944)kegsay
2021-07-27Key backups (1/2) : Add E2E session backup metadata tables (#1943)kegsay
* Initial key backup paths and userapi API * Fix unit tests * Add key backup table * Glue REST API to database * Linting * use writer on sqlite
2021-07-26Version 0.4.1v0.4.1Neil Alexander
2021-07-26Not finding the snapshot is not fatal (#1940)kegsay
2021-07-26fix:Inviting to an unsupported room version return M_BAD_JSON instead of ↵Meenal Trivedi
Incompatible_Version (#1930) * fix:Inviting to an unsupported room version return M_BAD_JSON instead of M_UNSUPPORTED_ROOM_VERSION Signed-off-by: Meenal Trivedi <meenaltrivedi6102@gmail.com> * fix Signed-off-by: Meenal Trivedi <meenaltrivedi6102@gmail.com> * fix Signed-off-by: Meenal Trivedi <meenaltrivedi6102@gmail.com> * feat: make requested changes Signed-off-by: Meenal Trivedi <meenaltrivedi6102@gmail.com> * Use error typecast from matrix-org/gomatrixserverlib#272 Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2021-07-22Don't set prev state when it is the same as the event it replaces (#1936)Neil Alexander
2021-07-22Track knocking in membership updater (#1935)Neil Alexander
* Topologically sort outliers in SendEventWithState * Knock in membership updater * Update gomatrixserverlib * Update gomatrixserverlib * Get the NID of the knock event properly for the membership updater
2021-07-22Update to matrix-org/gomatrixserverlib@b9eb787Neil Alexander
2021-07-21Update to matrix-org/gomatrixserverlib@ae88543Neil Alexander
2021-07-21Update to matrix-org/gomatrixserverlib#271Neil Alexander
2021-07-21Various alias fixes (#1934)Neil Alexander
* Generate m.room.canonical_alias instead of legacy m.room.aliases * Add omitempty tags * Add aliases endpoint to client API * Check power levels when setting aliases * Don't return null on /aliases * Don't return error if the state event fails * Update sytest-whitelist * Don't send updated m.room.canonical_alias events * Don't check PLs after all because for local aliases they are apparently irrelevant * Fix some bugs * Allow deleting a local alias with enough PL * Fix some more bugs * Update sytest-whitelist * Fix copyright notices * Review comments
2021-07-21Optimise QueryServerJoinedToRoom (#1933)Neil Alexander
* Optimise checking if a server is in a room * Fix queries * Fix queries
2021-07-21Support initial_state properly in `/createRoom` (#1932)Neil Alexander
* Refactor room creation to allow initial_state * GMSL types * Tweaks to alias * Fix ordering * Fix bugs * Fix create content * Only unmarshal create content if specified * Review comments @Kegsay
2021-07-20Update to matrix-org/gomatrixserverlib#270Neil Alexander
2021-07-20Add startup testing for Wasm Pinecone build (#1910)J. Ryan Stinnett
* Only include go-sqlite3 on the relevant binaries * The driver name is always sqlite3 now * Update to matrix-org/go-sqlite3-js@e537baa * Add initial Wasm test harness * Upgrade go-sqlite3-js This fixes an error about semicolons in single statements. * Add browser-like WebSocket API for testing * Upgrade go-sqlite3-js This upgrade includes printing panic messages next to stacks. * Run for all PRs targeting any branch * Use manual Node caching * Temporarily run for all pushes * Use npm ci instead of install * Use HTTPS auth for repo packages * Match path style from build.sh * update utp Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2021-07-20Only include go-sqlite3 on the relevant binaries (#1900)Neil Alexander
* Only include go-sqlite3 on the relevant binaries * The driver name is always sqlite3 now * Update to matrix-org/go-sqlite3-js@e537baa
2021-07-20Fixed log printing bug (closes #1885)Neil Alexander
Signed-off-by: Kilos kilosliu@workly.ai>
2021-07-20Rename Riot to Element (#1874)S7evinK
* s/riot/element/g Signed-off-by: Till Faelligen <tfaelligen@gmail.com> * fix formatting Co-authored-by: kegsay <kegan@matrix.org> Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2021-07-19Fix failing ban tests (#1884)David Spenler
* Add room membership and powerlevel checks for func SendBan * Added non-error return to func GetStateEvent when no state events with the specified state key are found * Add passing tests to whitelist * Fixed formatting * Update roomserver/storage/shared/storage.go Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com> Co-authored-by: kegsay <kegan@matrix.org> Co-authored-by: kegsay <kegsay@gmail.com>
2021-07-19Set MaxFileSizeBytes <= 0 to unlimited (#1876)S7evinK
* Revert "Set MaxFileSizeBytes <= 0 to "unlimited" (#1875)" This reverts commit 9ed044042156a9bdfafb4ae9830b3ed41225444e. * Actually allow unlimited upload Signed-off-by: Till Faelligen <tfaelligen@gmail.com> Co-authored-by: kegsay <kegan@matrix.org>
2021-07-19Metric fixesNeil Alexander
Squashed commit of the following: commit c6eb4d8bbf80320ec2b6d416c77659b0343e5e47 Author: Neil Alexander <neilalexander@users.noreply.github.com> Date: Mon Jul 19 16:52:57 2021 +0100 Fix bug commit d420966d9ac44936728960a8d38602662b58f1c3 Author: Neil Alexander <neilalexander@users.noreply.github.com> Date: Mon Jul 19 16:46:12 2021 +0100 Update metric commit 0ad6e37846e2ebbbd0e33a38274094bd15b8f11b Author: Neil Alexander <neilalexander@users.noreply.github.com> Date: Mon Jul 19 16:30:14 2021 +0100 Fix observe for calculateStateDurations
2021-07-19Set buckets for dendrite_roomserver_calculate_state_duration_microsecondsNeil Alexander
2021-07-19dendrite_roomserver_calculate_state_duration_microseconds as histogram ↵Neil Alexander
rather than summary
2021-07-19Update to matrix-org/gomatrixserverlib#269Neil Alexander