Commit graph

158 commits

Author SHA1 Message Date
strawberry 8454773275 log rejected sendjoin, remove unnecessary clone
Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-03 20:20:25 -05:00
strawberry f62f641545 add rocksdb configurable options and tweaks, logging improvements, exp. room v11 support
split out the spinning disk focused options into a configurable option, current
conduwuit users are NVMe/SSDs anyways so those options are just hindering performance.

rocksdb logging builds up overtime with no cleanup or anything, adds support for
configuring the amount of logging, size of files, log rotate, etc.
fixes https://gitlab.com/girlbossceo/conduwuit/-/issues/1

misc conduit logging improvements for help debugging issues and maybe a future feature

experimental Room V11 support from https://gitlab.com/famedly/conduit/-/merge_requests/562

Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-12-02 21:30:06 -05:00
strawberry 56e4166ee8 never let clippy fail, use CARGO_PKG_NAME, allow issues on gh, simplify regex a tad
Signed-off-by: strawberry <strawberry@puppygock.gay>
2023-11-29 23:19:53 -05:00
strawberry 87d6a17f0a fix all the warnings!!!! (0 clippy and rustc warnings now)
too many changes to list, codebase significantly better than it was a few weeks ago though

Signed-off-by: strawberry <june@girlboss.ceo>
2023-11-29 21:36:02 -05:00
strawberry 54a3f47851 fix every clippy warning possible, remove io_uring as default feature
this project's codebase is so horrendous, im shocked that no one has ran
clippy at all. it had ~200 total lint warnings, some with performance
issues and unsoundness, and the rest just very ugly codebase. i have sat
down and fixed as many of these as possible and i am exhausted.
i haven't fixed some extremely complex ones, but i brought it down from
~200 to ~30.

i have also removed io_uring as a default feature due to it falling
under the same category as linux eBPF: major kernel attack surface for
minimal performance gains. this also makes it impossible to cross-compile
from macOS to Linux because io_uring does not exist in Darwin land.
there are far better ways to achieve better performance than io_uring on
the codebase level.

Signed-off-by: strawberry <june@girlboss.ceo>
2023-11-27 00:50:55 -05:00
strawberry 2dc1c1fdcb fix clippy performance and sus warnings, remove 1 unwrap, forgot to increment db version
Signed-off-by: strawberry <strawberry@pupbrain.dev>
2023-11-26 22:14:43 -05:00
strawberry b4e2f7ca37 log error for invalid room member events in db
Signed-off-by: strawberry <strawberry@pupbrain.dev>
2023-11-25 20:42:38 -05:00
strawberry 6958c720d0 make pdu stuff async, remove unnecessary db version check
Signed-off-by: strawberry <strawberry@pupbrain.dev>
2023-11-25 18:29:38 -05:00
strawberry 0c4604b482 bump ruma, add wrong room keys error code, tiny logging change
can't update ruma to very latest commit because of the weird JsOption thing for syncv4 that i can't wrap my head around how to use, not important anyways

Signed-off-by: strawberry <strawberry@pupbrain.dev>
2023-11-25 12:42:05 -05:00
strawberry e9cd8caaed add feature flagged support for migrating from base64 file name keys to sha256 ones
core implementation and tests from https://gitlab.com/famedly/conduit/-/merge_requests/467
feature flag, base64 encode update, and tweaks were me

Signed-off-by: strawberry <strawberry@pupbrain.dev>
2023-11-25 11:38:28 -05:00
Val Lorentz d092820699 Fetch server keys concurrently
This speeds up handling of /_matrix/federation/v1/send/:transaction_id
when more than one event contains unknown keys.

In particular, when receiving multiple PDUs with dead servers in their
auth chain, timeouts of each server accumulate and can make handling of
incoming requests take several minutes, to the point the client closes
the connection (eg. matrix.org has a 2 minute timeout), causing new
events to be dropped eventually.
2023-11-25 11:38:28 -05:00
girlbossceo 16c3a38761 remove another unnecessary unwrap/expect
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-28 23:43:08 -04:00
girlbossceo 6931f4b778 reduce more unnecessary logging and improve a tad
dead servers in rooms are not relevant to log, keep it as info/debug

Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-28 23:40:44 -04:00
girlbossceo 64084fb2d0 use a proper function for this instead of checking 200
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-28 22:36:47 -04:00
girlbossceo 03af588efb don't unwrap reqwest requests for appservice and pushers too
this is another denial of service vector, but less severe than the federation one.

Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-28 22:34:09 -04:00
girlbossceo 95187419f9 do not expect/unwrap requests
causes tokio runtime worker to panic as we attempt to convert an HTTP
Request from ruma (try_into_http_request) into a reqwest Request so the
reqwest http client on the server can execute said request. error
message is not ideal ("invalid port number") but core issue is fixed.

Co-authored-by: infamous <ehuff007@gmail.com>
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-28 09:05:23 -04:00
Jakub Kubík 58a83f06b1 feat(presence): add granular allow configuration 2023-10-21 22:31:16 -04:00
Jakub Kubík ba03edfae9 feat(presence): implement presence functionality 2023-10-21 22:31:06 -04:00
girlbossceo 22eff2d29c clean up few unnecessary warnings
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-21 16:15:42 -04:00
girlbossceo 05c08c8529 fix device name federation control
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-21 12:19:21 -04:00
girlbossceo 6e46f56929 error log thing
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-21 12:18:59 -04:00
girlbossceo f72fd67a71 remove dbg's, update rocksdb, use iouring
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-09-24 10:17:26 -04:00
girlbossceo fda30f5602 fix: add destination field authorization handler (not my commit)
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-09-13 21:47:37 -04:00
girlbossceo ebd2ec45b1 fix: Do not allow fetching cached remote users' profiles over federation (nyaaori)
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-09-13 21:47:37 -04:00
girlbossceo 1b75d384d7 option to control federating device display names
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-09-13 21:47:35 -04:00
girlbossceo 81e8df3102 options to control public room directory visibility
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-09-13 21:46:43 -04:00
girlbossceo 76c00283de woof woof
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-09-13 21:46:41 -04:00
girlbossceo 618036dc31 support querying _matrix-fed and _matrix
_matrix-fed is the new IANA registered SRV record service name
per MSC4040. _matrix is now considered deprecated in Matrix 1.8.
see 3.3 and 3.4 of https://spec.matrix.org/v1.8/server-server-api/#resolving-server-names

Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-09-13 20:36:03 -04:00
girlbossceo 87c527ad79 remove unused trace
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-09-13 20:36:03 -04:00
Timo Kösters 75c80df271
Sliding sync improvements and redaction fixes 2023-09-13 20:54:53 +02:00
Timo Kösters f73a657a23
fix: ACL error shouldn't break the whole request 2023-08-11 20:29:22 +02:00
Timo Kösters 11103a92ed
Do not show "Invalid room version" errors when server is not in room 2023-08-11 10:48:48 +02:00
Timo Kösters c028e0553c
feat: registration tokens 2023-08-09 18:27:30 +02:00
Timo Kösters 3e518773e2 Merge branch 'improvements' into 'next'
cross signing fixes

See merge request famedly/conduit!532
2023-08-07 16:11:11 +00:00
Timo Kösters d82c26f0a9
Avatars for sliding sync DMs 2023-08-07 17:54:08 +02:00
Timo Kösters c1e2ffc0cd
improvement: maybe cross signing really works now 2023-08-07 13:55:44 +02:00
girlbossceo fbd8090b0b log room ID for invalid room topic event errors
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-08-03 08:54:47 -10:00
June 5a7bade476 update base64 to 0.21.2
Signed-off-by: June <june@girlboss.ceo>
2023-08-01 14:48:50 -10:00
Timo Kösters d2bfcb018e Merge branch 'error-leak-fix' into 'next'
sanitise potentially sensitive errors

See merge request famedly/conduit!523
2023-08-01 11:25:06 +00:00
Timo Kösters acfe381dd3
fix: threads get updated properly
Workaround for element web while waiting for https://github.com/matrix-org/matrix-js-sdk/pull/3635
2023-07-31 16:18:23 +02:00
girlbossceo 83805c66e5 sanitise potentially sensitive errors
prevents errors like DB or I/O errors from leaking filesystem paths

Co-authored-by: infamous <ehuff007@gmail.com>
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-07-30 17:30:16 +00:00
girlbossceo e2c914cc11 fix: s/ok_or/ok_or_else in relevant places
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-07-29 19:17:12 +00:00
girlbossceo d7061e6984 cargo fmt
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-07-29 14:30:48 +00:00
girlbossceo cc5dcceacc Log the room ID, event ID, PDU, and event type where possible
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-07-29 14:29:26 +00:00
girlbossceo 863103450c Log the unknown login type in warning level
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-07-29 14:29:26 +00:00
girlbossceo 1f867a2c86 Only print raw malformed JSON body in debug level
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-07-29 14:29:26 +00:00
Tobias Tom 7990822f72 It's ok not being able to find a .well-known response. 2023-07-28 16:26:40 +01:00
Timo Kösters 90a10c84ef Merge branch 'slidingfixes' into 'next'
Better sliding sync

See merge request famedly/conduit!511
2023-07-24 08:48:27 +00:00
Timo Kösters d220641d64
Sliding sync subscriptions, e2ee, to_device messages 2023-07-24 10:42:52 +02:00
Timo Kösters caddc656fb
slightly better sliding sync 2023-07-24 10:42:47 +02:00