Commit graph

2325 commits

Author SHA1 Message Date
strawberry
e2ec2a98ba make rooms alias list command more nicer
room IDs in conduit have a server name attached to them already
outputting the server name again just makes it look incorrect

also add codeblock to the internal room ID portion

Signed-off-by: strawberry <june@girlboss.ceo>
2023-11-27 01:25:20 -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
tezlm
19d1b484e0 split out room info into its own function 2023-11-26 22:16:38 -05:00
tezlm
c2b103514b Make commands plural 2023-11-26 22:16:38 -05:00
tezlm
5fc5076517 Room directory admin commands 2023-11-26 22:16:32 -05:00
tezlm
b30884c7ac reply to messages 2023-11-26 22:14:59 -05:00
tezlm
ebb94341c8 Admin room alias commands
- room alias set
- room alias remove
- room alias which
- room alias list
2023-11-26 22:14:59 -05:00
tezlm
6fdeec1108 Add appservice show command to show config 2023-11-26 22:14:59 -05:00
tezlm
562eaa1dea Allow using languages in code blocks.
```yaml
This works now
```
2023-11-26 22:14:59 -05:00
tezlm
3e9c564209 Rework admin commands to use subcommands.
This commit doesn't add, remove, or change any
commands, it only organizes them
2023-11-26 22:14:59 -05:00
strawberry
5106203d67 drop iouring, add 2 info logs, silence clippy warning
iouring falls into the same category as eBPF and is a major source of kernel vulnerabilities. the benefits gained here are too minimal to bother keeping this enabled, and makes cross-compiling from macOS impossible

Signed-off-by: strawberry <june@girlboss.ceo>
2023-11-26 22:14:59 -05:00
strawberry
dd544fad29 use cache_capacity_modifier for spaces/hierarchy cache
Signed-off-by: strawberry <strawberry@pupbrain.dev>
2023-11-26 22:14:59 -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
AndSDev
d13e3827ce feat: send push notification on invite to invited user and etc 2023-11-25 20:28:25 -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
4d7b5eb759 add version argument, move import to test body
Signed-off-by: strawberry <strawberry@pupbrain.dev>
2023-11-25 15:53:33 -05:00
strawberry
8fffb6ea04 fix compilation with no zstd, use correct key, bump 2 deps
Signed-off-by: strawberry <strawberry@pupbrain.dev>
2023-11-25 15:46:03 -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
strawberry
87d1040386 bump various deps (except for the HTTP libs currently), use my
rust-rocksdb fork, add optional opt-in zstd response body compression
config, add webp support for images

cant upgrade things like axum, http, tower, hyper, etc due to the 1.0
release of http which are breaking all of these libs

Signed-off-by: strawberry <strawberry@pupbrain.dev>
2023-11-25 11:36:55 -05:00
girlbossceo
3533645959 bump rust-argon2
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-11-10 20:50:36 -05:00
girlbossceo
65b682c841 bump rocksdb
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-11-10 20:47:09 -05:00
girlbossceo
af1f7404f1 add notification_push_path global
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-28 23:43:41 -04: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
9bb1dca5f1 mark unused variables as unusued
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-28 22:34:50 -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
8b95399387 add support for modifying the default notification pusher path
this is not officially in spec yet, but who cares? matrix team certainly doesn't care.

Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-28 22:31:11 -04:00
girlbossceo
b8acacfb3e use light owasp defs instead of argon2 defs
the ones now used by default in rust-argon2 are extremely aggressive and
resource intensive. owasp's 2nd default is very reasonable with the same
security.

Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-28 22:15:36 -04:00
tezlm
23ec725923 remove unnecessary config overwrite
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-28 22:14:21 -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
girlbossceo
8b28225af9 add lz4 to rocksdb features
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-23 22:22:42 -04:00
Rohan Kumar
d08beada62
Stop using default features for rocksdb
We only need zstd and snappy
2023-10-21 21:18:45 -07: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
a3d219e401 tweak rocksdb, use direct io
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-21 12:18:41 -04:00
girlbossceo
c223f8284c bump deps, update rocksdb
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-10-21 12:18:07 -04:00
girlbossceo
e486c35faa don't skip tracing for event_handler
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-09-24 13:01:54 -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
0390d19b56 log state res error
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-09-24 10:17:06 -04:00
girlbossceo
28b63e913f unix sockets
Signed-off-by: girlbossceo <june@girlboss.ceo>
2023-09-13 21:49:53 -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