Commit graph

1660 commits

Author SHA1 Message Date
Till Faelligen a073a21d71 Add option to disable presence 2021-08-23 12:11:34 +02:00
Till Faelligen 0973a4e346 Fix linter issues 2021-08-22 20:24:17 +02:00
Till Faelligen 41017f41f4 Add missing file 2021-08-22 20:15:19 +02:00
S7evinK 02c991ba3c
Merge branch 'master' into add-presence 2021-08-22 19:55:50 +02:00
Neil Alexander 329c9e671c
Update to matrix-org/pinecone@e692df1 2021-08-19 16:07:28 +01:00
Neil Alexander 9a2dcd6078
Update to matrix-org/pinecone@21e3b39228 2021-08-19 15:02:50 +01:00
Neil Alexander cd3823308c
Version 0.5.0rc1 2021-08-18 14:29:45 +01:00
Neil Alexander cf42ae6064
Build Docker images using Go 1.17 2021-08-18 14:13:38 +01:00
Kevin Liu fe5050c0a5
Add and use M_ROOM_IN_USE (#1972)
Signed-off-by: nivekuil <mail@nivekuil.com>

Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2021-08-18 12:41:30 +01:00
Neil Alexander 614e67280d
Delete device keys/signatures from key server when deleting devices (#1979)
* 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-18 12:07:09 +01:00
Sambhav Saggi 1bee1ae204
Syslog integration (#1952)
* 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-17 16:18:51 +01:00
Neil Alexander ff21675c5b
Cross-signing fixes, notifications via sync, federation (#1974)
* 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-17 13:44:30 +01:00
S7evinK 8a4b90b7dd
Update golangci-lint (#1978)
* 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 3c76f219d3.

Co-authored-by: Devon Mizelle <dev@devon.so>
2021-08-17 10:39:09 +01:00
Devon Mizelle c2b9ab7470
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>
2021-08-16 14:19:35 +01:00
Neil Alexander 125ea75b24
Add type field to DeviceMessage, allow fields to be nullable (#1969) 2021-08-11 09:44:14 +01:00
Till Faelligen 02bac18b91 Update sqlite query to use max(id) as new id 2021-08-10 11:11:46 +02:00
Till Faelligen 134311e067 Add Setup method to PresenceStreamProvider 2021-08-10 10:40:37 +02:00
Till Faelligen 95595636e8 Add possibilty to query current max id for presence 2021-08-10 10:40:33 +02:00
Till Faelligen 017d9fc687 Update presence table 2021-08-10 10:40:16 +02:00
Till Faelligen ca7a6c9eb9 Handle incomfing presence updates 2021-08-10 10:40:10 +02:00
Till Faelligen 598308b739 Store presence data on request 2021-08-10 10:40:02 +02:00
Till Faelligen d550acbd9d Let eduserver handle storing of presence data 2021-08-10 10:39:16 +02:00
Till Faelligen 86e387d19d Fix issue with wrong timestamp 2021-08-09 16:58:03 +02:00
Till Faelligen 2b0261cd70 Merge branch 'master' of https://github.com/matrix-org/dendrite into add-presence 2021-08-09 16:41:05 +02:00
Neil Alexander b1377d991a
Cross-signing signature handling (#1965)
* 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-09 14:35:24 +01:00
Neil Alexander e95b1fd238
Cross-signing validation for self-sigs, expose signatures over /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-06 10:13:35 +01:00
Neil Alexander 8e5a0139b5
Update to matrix-org/gomatrixserverlib@03e40fa 2021-08-05 11:48:22 +01:00
Till Faelligen 3e62a638b1 Add trace for new endpoints 2021-08-05 08:45:07 +02:00
Till Faelligen 4b94f52ce4 Merge branch 'master' of https://github.com/matrix-org/dendrite into add-presence 2021-08-05 08:38:58 +02:00
Neil Alexander eb0efa4636
Cross-signing groundwork (#1953)
* 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-04 17:56:29 +01:00
kegsay 4cc8b28b7f
Ensure all create events have a snapshot NID of 0 (#1961)
Fixes #1924 for postgres users, though the underlying cause of why
they aren't 0 in the first place is unresolved.
2021-08-04 17:48:23 +01:00
Neil Alexander 7a9a2547b3
Cross-signing storage code (#1959) 2021-08-04 17:31:18 +01:00
kegsay ed04eed441
Fix sqlite migration issues (#1960)
* 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-04 17:08:17 +01:00
Till Faelligen 642ac3e4ad Add Setup method to PresenceStreamProvider 2021-08-03 15:32:34 +02:00
Till Faelligen 7003ae501d Add possibilty to query current max id for presence 2021-08-03 15:23:37 +02:00
Neil Alexander da101469fa
Minimum version Go 1.15 (#1957) 2021-08-03 11:35:29 +01:00
kegsay e3df612953
Add tracing to user API (#1948)
Use the trace version in tests so we can just implement the required API functions.
2021-08-03 11:23:25 +01:00
Neil Alexander d4aa311c74
Update containerd dependency 2021-08-03 11:17:27 +01:00
Neil Alexander a81c499f65
Update dependencies (#1956) 2021-08-03 11:15:17 +01:00
Till Faelligen 040bce77d2 Update logging 2021-08-03 11:37:39 +02:00
kegsay a22ab3eee6
Read the right username field when performing account deactivation (#1954)
`Login` has 2 username fields, and we were always checking the
deprecated one. Instead, check both.
2021-08-02 13:11:23 +01:00
Till Faelligen f1a19e74d7 Add presence federationsender 2021-08-01 10:28:43 +02:00
S7evinK 04f85e8e50
Merge branch 'master' into add-presence 2021-07-31 20:19:35 +02:00
Till Faelligen 3e937e43ef Update go.mod.. 2021-07-31 19:40:10 +02:00
Till Faelligen dc081bb94f Update go.mod to use correct replacement 2021-07-31 19:37:20 +02:00
Till Faelligen 167c07bd6f Fix tests 2021-07-31 19:32:38 +02:00
Till Faelligen 4f204a68d1 Testing 2021-07-31 16:26:38 +02:00
Till Faelligen bdc30e57a5 Test 2021-07-31 16:26:15 +02:00
Till Faelligen 0889ceeac2 Make /sync requests work 2021-07-31 16:10:46 +02:00
Till Faelligen 9dee04c21a Test 2021-07-30 21:38:26 +02:00