Commit graph

2587 commits

Author SHA1 Message Date
Jason Volk 2a304c2b6c add some usage stats output on the mutex maps
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-13 21:20:05 +00:00
Jason Volk 271f720286 move mutex maps out of globals into respective service
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-13 21:20:05 +00:00
Jason Volk 2d251eb19c cleanup on drop for utils::mutex_map.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-13 21:20:05 +00:00
Jason Volk 01b2928d55 add make user admin command (#136)
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-13 21:20:05 +00:00
Jason Volk 50c2d2b801 add command to force join user to room (#136)
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-13 21:20:05 +00:00
Jason Volk 5dcdafe207 take local join branch when remote join would fail
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-13 21:20:05 +00:00
Jason Volk c62d653989 tweak some log levels
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-13 21:20:05 +00:00
Jason Volk 454dd43d4c fix membership route ABA's
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-13 21:20:05 +00:00
strawberry b5d4a1c1b0 drop harmless state event not found message to debug_info
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-10 22:00:46 -04:00
strawberry aa9540af21 slightly simplify send_state_event route
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-10 22:00:46 -04:00
strawberry 192c1e08da add exclude_disabled and exclude_banned room list admin cmd arguments
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-10 22:00:46 -04:00
strawberry 0fa6976d86 add client IP and user logging on join, remove unnecessary Option
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-10 22:00:46 -04:00
strawberry 93e7cf461d add client IP logging to media requests
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-10 22:00:46 -04:00
strawberry efea13a675 add access control checks for room directory publishing/removing
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-10 22:00:46 -04:00
strawberry b5ee15a216 dont skip_all tracing instrument on fetch_state
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-10 22:00:46 -04:00
strawberry 0873e18e14 remove random duplicate function
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-10 22:00:46 -04:00
strawberry 6abc4ad798 make local_aliases_for_room db iterator Send
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-10 22:00:46 -04:00
strawberry 373991a8d6 cleanup and fix backfill from server getting
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-10 22:00:46 -04:00
strawberry 83e853e7a3 add "unstable" endpoint legacy Element Android/iOS seems to call
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-10 22:00:46 -04:00
strawberry 1c453b1b55 require authentication on change password and deactivation routes
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-10 22:00:46 -04:00
strawberry 60141950f7 fix wrong deactivate-all argument comment
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-10 22:00:46 -04:00
strawberry 391bfd986e use ruma's X-Matrix to construct the sending X-Matrix header value
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-10 22:00:46 -04:00
strawberry daa5c34ea3 fix empty version string for NixOS users
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-10 22:00:46 -04:00
strawberry 3259ea08b5 use cond compilation for config check, fix docker check w/unix sockets, use our logging instead of tracing
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-10 22:00:46 -04:00
Jason Volk 158de10fe6 log erroring errors; improve inspection functors.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-09 04:09:34 +00:00
Jason Volk 4718387dbe fix wrapper macro semicolons
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-09 03:38:07 +00:00
Jason Volk a43c78e55f add RumaError to Error; encapsulate RumaResponse in api
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-09 03:38:07 +00:00
Jason Volk 7ba0777bd3 move RumaResponse out of core Error; cleanup Error conversions.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-08 22:02:10 +00:00
Jason Volk 59d86d3641 restrict clippy::string_slice
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-08 22:02:10 +00:00
Jason Volk 51df946911 de-branch duration limit statement
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-08 22:02:10 +00:00
Jason Volk 23a9055199 relax and de-clutter let_underscore_must_use
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-08 22:02:10 +00:00
Jason Volk 100c6f572b trim unused dependencies in member crates
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-08 22:02:10 +00:00
Jason Volk eb5556e74e additional tracing spans / log cleanup.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-08 22:02:10 +00:00
Jason Volk 8296e0ed67 slightly optimize command completer
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-08 22:02:10 +00:00
Jason Volk 8e3be6feb0 slightly optimize Destination::get_prefix()
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-08 22:02:09 +00:00
Jason Volk 59c4062305 set trivial/leaf spans to debug level
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-08 22:02:09 +00:00
Jason Volk 113a27c1d5 use usize for max_request_size config item
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-08 22:02:09 +00:00
Jason Volk 5af880e4f4 fix reference count on punned ColumnFamily Arc
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-08 22:02:09 +00:00
Jason Volk 5722c4ae39 fix needless collect
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-08 22:02:09 +00:00
Jason Volk dfd13780df mitigate additional cast lints
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-08 22:02:09 +00:00
Jason Volk dcd7422c45 fix as conversions
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-08 22:02:09 +00:00
Jason Volk 7397064edd fix arithmetic side-effects
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-08 22:02:09 +00:00
Jason Volk 52a561ff9e abstract expoential backoff to math utils.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-08 22:02:09 +00:00
Jason Volk 5e72d36800 add math utils; integrate checked expression macros
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-08 22:02:09 +00:00
Jason Volk 611f09829e use shorthand constraint syntax and formatting
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-08 22:02:09 +00:00
Jason Volk a388c2e06e allow clippy::enum_glob_use
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-08 22:02:09 +00:00
Jason Volk 24b37e03a0 add pretty time util
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-08 22:02:09 +00:00
Jason Volk a309ef55c9 restore signal state after channel failures
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-08 22:02:09 +00:00
Jason Volk a3638dbb15 use rwlock for command handler.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-07 06:24:08 +00:00
Jason Volk 5254eb4f72 add basic tab completion to console
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-07 06:24:08 +00:00
Jason Volk b31e81a469 add common_prefix string util
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-06 15:26:07 +00:00
Jason Volk 0e580292a6 encap admin handler init/fini in crate
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-06 15:26:07 +00:00
Jason Volk 38a24e0170 remove unused deps in member crates
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-06 15:26:07 +00:00
Jason Volk 8350aced39 add ctrl-\ quit support to admin console
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-06 15:26:07 +00:00
Jason Volk 04e3de08eb add log to error functors for Result::map_or_else
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-06 15:26:07 +00:00
Christoph Dittmann 2bc53139fa Don't send empty presence EDUs
I run a homeserver whose logs show a high number of incoming empty
presence EDUs originating from the user agent "Conduwuit/0.4.4". They
arrive at a rate of about 2 queries per second per Conduwuit server.

The empty EDUs all look the same, only with `origin_server_ts`
increasing:

```
{"origin":"example.com","origin_server_ts":1720266475601,"edus":[{"edu_type":"m.presence","content":{"push":[]}}]}
```

These updates are unnecessary because they don't do anything. They
only increase network traffic and CPU usage on both sides.

After this commit, the empty presence updates are no longer inserted
into the outgoing event queue.
2024-07-06 14:13:33 +02:00
Jason Volk 17a3ed4c56 add admin query resolver commands
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-04 22:15:54 +00:00
Jason Volk 2dd68d3fa5 add time format string util
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-04 21:06:35 +00:00
Jason Volk dc18f89c0b don't cache server name lookups indefinitely (#436)
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-04 21:06:35 +00:00
Jason Volk eaf1cf38a5 refactor resolver tuples into structs
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-04 21:06:35 +00:00
Jason Volk eeda96d94a inline analysis and symbol reduction; emits smaller than 64 bytes marked inline
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-04 21:06:35 +00:00
Jason Volk 1e8b8cce0f even more byte utils optimizations
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-04 21:06:35 +00:00
Jason Volk db46d6dd6b optimize millis_since_unix_epoch()
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-04 21:06:35 +00:00
Jason Volk 08274150e5 cork database during global counter increment
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-04 21:06:35 +00:00
Jason Volk e125af620e impl crate::Service for Service
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-04 21:06:35 +00:00
Jason Volk 177c9e8bfa add split_once_infallible string util
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-04 21:06:35 +00:00
Jason Volk 4f5c6de853 start rand utils suite
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-04 21:06:35 +00:00
Jason Volk 25c004f08c remove dead cache
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-04 21:06:35 +00:00
Jason Volk f104ced55d remove unnecessary wrapper
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-04 21:06:35 +00:00
Jason Volk 0cea64309a move PduEvent from services to core
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-04 21:06:35 +00:00
strawberry e2033fb6c1 notify users to update their build scripts if using rocksdb or sha256_media
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-03 22:12:47 -04:00
strawberry 0832c28a40 dedupe some state accessors in various places
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-03 22:12:47 -04:00
strawberry b0eec60724 add MSC3266 room summary API support
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-03 22:12:47 -04:00
strawberry deca2c52c6 switch to ruma's X-Matrix parser
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-03 11:30:16 -04:00
strawberry 1a64e42cfe add /openid/request_token and /openid/userinfo routes
heavily changed and improved by me

Co-authored-by: mikoto <avdb@keemail.me>
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-03 11:30:11 -04:00
Jason Volk 5edd391e83 support admin server restart --force
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-03 06:34:16 +00:00
Jason Volk 7658387a74 remove resolver wrapper; use std mutex
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-03 06:34:16 +00:00
Jason Volk be2d1c722b encap dep:chrono in time utils
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-03 06:34:16 +00:00
Jason Volk 8cf55c702f split time utils into unit
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-03 06:34:16 +00:00
Jason Volk 3b9fba233c split bytes utils into unit
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-03 06:34:16 +00:00
Jason Volk af81baae44 split string utils into unit
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-03 06:34:16 +00:00
Jason Volk 52d470058a split hash utils into directory
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-03 06:34:16 +00:00
Jason Volk df0328f43f split send txn handler
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-03 06:34:16 +00:00
Jason Volk 473b29d524 move remaining runtime caches into their respective service
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-03 06:34:16 +00:00
Jason Volk a2d25215a3 consolidate key/value types; consistent interface arguments
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-03 06:34:16 +00:00
Jason Volk 46423cab4f fix counter increment race
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-03 06:34:16 +00:00
Jason Volk 2e2cf08bb2 optimize increment / increment batch
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-03 06:34:16 +00:00
Jason Volk ee64fb149c optimize get w/ zero-copy ref handle
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-03 06:34:16 +00:00
Jason Volk 0522fe7d92 reimplement iterator from lowlevel
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-03 06:34:16 +00:00
Jason Volk 6dd6e4bfaf simplify cork interface related
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-03 06:34:16 +00:00
Jason Volk a1ced0a56f fix admin query timers not covering full iteration
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-03 06:34:16 +00:00
Jacob Taylor 0171262581 make pduid_pdu/eventid_outlierpdu scale with conduit_cache_capacity_modifier via cache_size(), and fix lint 2024-07-03 06:34:16 +00:00
Jason Volk 972037dcd9 optimize column family handles
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-03 06:34:16 +00:00
Jason Volk 0613140130 optimize bytes conversion utils
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-03 06:34:16 +00:00
strawberry ed3a464722 remove uselsss partial_cmp with cmp
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-02 21:21:37 -04:00
strawberry 28ac3790c2 sync upstream spaces/hierarchy federation MR
also had to fix a million clippy lints

fix(spaces): deal with hierarchy recursion
fix(spaces): properly handle max_depth
refactor(spaces): token scheme to prevent clients from modifying max_depth and suggested_only
perf(spaces): use tokens to skip to room to start populating results at
feat(spaces): request hierarchy from servers in via field of child event

Co-authored-by: Matthias Ahouansou <matthias@ahouansou.cz>
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-02 21:20:28 -04:00
strawberry 652faafe6e bump ruma
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-02 16:46:19 -04:00
strawberry bb27f21ac1 simplify getting join_authorized_via_users_server for make/send_join, remove unnecessary async
Co-authored-by: Matthias Ahouansou <matthias@ahouansou.cz>
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-02 15:32:40 -04:00
strawberry 339a1fc4e8 only sign /send_join events if restricted join via room version and join_authorised_via_users_server
Co-authored-by: Matthias Ahouansou <matthias@ahouansou.cz>
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-02 15:01:11 -04:00
strawberry 75731671d1 use RoomMemberEventContent for send_join/send_leave
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-02 14:46:53 -04:00
Jason Volk 20aab1792b fix version format regression 3a51e18ce6
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-01 23:35:04 +00:00
strawberry 792d4aa6ce fix nightly clippy lint
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-01 00:14:16 -04:00
strawberry 6c461025e5 use proper redacts field
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-01 00:14:16 -04:00
Jason Volk 9d1db7d171 rename fsck to check
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:02:16 +00:00
Jason Volk 2387f7f955 move tester command under debug
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:02:16 +00:00
Jason Volk 5805394ca5 add tester timer stub
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:02:16 +00:00
Jason Volk 3301cde8e7 add timer around admin command processing
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:02:16 +00:00
Jason Volk b28d216e00 improve debug get-room-state; use RoomOrAliasId
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:02:16 +00:00
Jason Volk f127987c7a add convenience alias resolver to interface
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:02:16 +00:00
Jason Volk fa02d7b7e3 diffuse get_alias_helper into services::rooms::alias
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:02:16 +00:00
Jason Volk 96a16190c5 mute dev_release_log_level from --all-features for now
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:02:16 +00:00
Jason Volk d9054f5364 add backreference to layer in capture data struct
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:02:16 +00:00
Jason Volk db288b169e add config option for tokio_console runtime enablement
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:02:16 +00:00
Jason Volk bc50034173 idiomize various expressions
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:02:16 +00:00
Jason Volk 20fe84379c rename log::Server to log::Log
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:02:16 +00:00
Jason Volk 06f01d384f simplify argon init
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:02:16 +00:00
Jason Volk bd19fac4c5 split tracing init into unit
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:02:16 +00:00
Jason Volk 703c275266 split sentry init; add user-agent, trace hooks.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:02:16 +00:00
Jason Volk c05f00661b use extern namespace in log wrapper macros
convert use tracing statements

Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:02:16 +00:00
Jason Volk 0e46b750a0 default to jemalloc when both hardened_malloc and jemalloc enabled.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:02:16 +00:00
Jason Volk 3a51e18ce6 pre-format version strings
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:02:16 +00:00
Jason Volk 7638bbc49c keep column list lexically sorted
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:02:16 +00:00
Jason Volk 35049c94de simplify db ThreadMode typedef
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:02:16 +00:00
Jason Volk 7db8478dc0 hoist iterator modes; group fns
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:02:16 +00:00
Jason Volk dc633100da hoist read_options/write_options instances
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:02:16 +00:00
Jason Volk 0f1432f448 improve appservice::Data interface encap
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:02:16 +00:00
Jason Volk 30b5ad3870 de-feature rocksdb 2024-06-30 18:02:16 +00:00
Jason Volk cb48e25783 refactor dyn KvTree out of services
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:02:16 +00:00
Jason Volk 57acc4f655 fix needless pass by value
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:02:16 +00:00
Jason Volk 875d9e8b07 fix complex types
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:02:16 +00:00
Jason Volk de21f7442a devirtualize database
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:02:14 +00:00
Jason Volk 7ad7badd60 devirtualize service Data traits
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:01:20 +00:00
Jason Volk a6edaad6fc error enum cleanup
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:01:20 +00:00
Jason Volk fbcdb3860a eliminate dep:rust-rocksdb et al from admin crate
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:01:20 +00:00
Jason Volk 01f4455ceb convert rocksdb errors locally; remove from Error.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:01:20 +00:00
Jason Volk c1712d4d8b optimize increment
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:01:20 +00:00
Jason Volk 3480074f61 sha256_media integration
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:01:20 +00:00
Jason Volk efbdced535 cleanup migration function a bit
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:01:20 +00:00
Paul Robertson 19d8f0b27e
dont use any for a single feature check 2024-06-30 10:40:54 -04:00
Paul Robertson 73b85372d6
drop parking_lot feature 2024-06-29 11:20:48 -04:00
Paul Robertson 5e6b9ec1cf
drop thread_local feature 2024-06-29 11:20:48 -04:00
Paul Robertson 65177d237a
drop the sqlite feature from core 2024-06-29 11:20:48 -04:00
Paul Robertson 325f1c0bd2
drop the sqlite feature from database 2024-06-29 11:20:45 -04:00
Paul Robertson 68f1b4789a
drop the sqlite feature from main 2024-06-29 11:05:33 -04:00
Paul Robertson 624cd2acfa
remove sqlite code 2024-06-29 11:05:33 -04:00
Jason Volk d875e0c1c0 fix handling of empty admin command lines
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-23 09:52:16 -04:00
Jason Volk 2dae3052e2 remove unnecessary html render
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-22 21:22:56 +00:00
Jason Volk 2f84bc895d Improve additional command outputs containing codeblocks.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-22 21:22:56 +00:00
Jason Volk 3b34e72456 improve output scheme for admin query commands
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-22 21:22:56 +00:00
Jason Volk 7eee88160a truncate other span names and fields
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-22 21:22:56 +00:00
strawberry 5f46623371 redaction fixes 2024-06-22 21:22:56 +00:00
Jason Volk 14dcc8db15 truncate MatchedPath for span field
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-18 10:56:19 +00:00
Jason Volk 213a6d441f shorten several request span names.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-18 10:56:19 +00:00
Jason Volk 98d96b89a5 minor reductions
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-18 10:56:19 +00:00
Jason Volk 1c0ed91f6f rename ruma_wrapper to router
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-17 05:04:00 +00:00
Jason Volk 64705fa27d rename router to routes
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-17 05:04:00 +00:00
Jason Volk 8affdc43a6 additional termimad config
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-17 02:10:27 +00:00
Jason Volk 1ccdba8921 use markdown for list-database-files command
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-17 02:10:27 +00:00
Jason Volk 50ce87161b refactor admin command visibilities and use statements
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-17 02:10:27 +00:00
Jason Volk c6f4b20e17 add server restart support w/ admin command
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-17 02:10:27 +00:00
Jason Volk 2cb31275f0 fix missing command response; use non-empty command responses
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-17 02:10:27 +00:00
Jason Volk 5aee03d14a switch to crate rustyline_async
improve console signal and interrupt stack

Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-17 02:10:27 +00:00
Jason Volk 959fd2e6c4 split main signal handler to unit
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-17 02:10:27 +00:00
strawberry 9e9b256b83 temp: comment out hardened_malloc code
sorry but this is just non-functional in our build system,
i haven't had time to figure out why nix doesn't like what
i'm doing with it, and i haven't heard anyone using this

(the user who i anticipated would use this has not updated
their conduwuit in many months)

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-16 15:20:57 -04:00
Jason Volk a22524496d console command interruption
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-16 08:02:14 +00:00
Jason Volk 1d1b1644e9 add admin debug echo command
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-16 08:02:14 +00:00
Jason Volk 483f0a9c86 add admin command for admin room notices
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-16 08:02:14 +00:00
Jason Volk 3d3d63fdf4 admin commands for shutdown/reload
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-16 07:24:51 +00:00
Jason Volk 08f2b8579c abstract shutdown/reload functionality.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-16 07:24:51 +00:00
Jason Volk 30e7298dd7 fix doc-lazy-continuation
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-16 07:24:51 +00:00
Jason Volk 3872ae80f7 fix PanicInfo deprecation
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-16 07:24:51 +00:00
Jason Volk 0923b6f428 fix use std::mem related lint
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-16 07:24:51 +00:00
Jason Volk 48d9677959 rustfmt nightly/stable compats
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-16 03:07:59 +00:00
Jason Volk 02bd67dc4b admin command path simplifications; fix message to room
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-16 03:07:59 +00:00
Jason Volk 3813628acd log full custom edu rather than just content
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-16 03:07:59 +00:00
strawberry 03c04ce0a1 dont allow "remote admins" to run public escaped cmds on behalf of others
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-14 23:46:07 -04:00
Jason Volk 08bf074cbb reduce roomid_mutex_state
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-14 22:09:55 +00:00
Jason Volk 539aa27815 reduce roomid_mutex_federation
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-14 22:09:55 +00:00
Jason Volk 22272bdc16 reduce roomid_mutex_insert
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-14 22:09:55 +00:00
Jason Volk 8b68d6306c add MutexMap to utils
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-14 22:09:55 +00:00
Jason Volk d4775f0763 add server-side command escape w/ public echo for admins
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-14 06:40:47 +00:00
Jason Volk 571ab6ac2b admin terminal console
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-13 03:33:24 +00:00
Jason Volk 5df7443437 add log suppression tool
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-13 02:16:46 +00:00
Jason Volk e76e604771 add MxidError to our Error
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-12 21:06:09 +00:00
Jason Volk 1f9225e4d1 add markdown log format for capture
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-12 21:06:09 +00:00
Jason Volk c914a4fd91 capture logs for resolve-true-destination admin cmd
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-12 18:52:39 +00:00
Jason Volk aa34021b27 tracing capture interface
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-12 18:25:27 +00:00
Jason Volk 1bb4021b90 add format util to log suite
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-12 18:25:27 +00:00
Jason Volk 877c04de52 add color utils to log suite
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-12 18:25:27 +00:00
Jason Volk 029e1c630a split core log into directory
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-12 18:25:27 +00:00
Jason Volk 39110ebc3c add fmt::Error as core Error source
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-12 18:25:27 +00:00
Jason Volk 2ab3231ea6 add tracing_subscriber::filter::ParseError to amalgam
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-12 18:25:27 +00:00
strawberry d0069cc100 log out any sessions when the server emergency password is unset
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-12 14:04:47 -04:00
Matthias Ahouansou 556e78214a fix: only allow the server user to set the admin alias
Should make it safer to move the alias if the admin room broke on a public server.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-12 14:04:47 -04:00
strawberry 8fff7ea706 cleanup+refactor admin room alias and server account accessing to globals
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-12 14:04:47 -04:00
Matthias Ahouansou f712c0cefb fix: restrict who can remove aliases
Previously, anyone could remove any local alias, meaning that someone could re-route a popular alias elsewhere
Now, only the creator of the alias, users who can set canonical aliases for the room, server admins and the server user can delete aliases

added some additional changes/fixes to adapt to our codebase

Co-authored-by: strawberry <strawberry@puppygock.gay>
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-12 14:04:47 -04:00
Matthias Ahouansou 26d103d314 fix: only process admin commands if server user is in the room
Should prevent some edge cases with a misconfigured admin room

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-12 14:04:47 -04:00
Benjamin Lee 0688a96c37 drop redacted events from search results
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-12 14:04:47 -04:00
Benjamin Lee eb73d8c669 fix: de-index pdus when redacted
bit of code dedupe as well

Co-authored-by: strawberry <strawberry@puppygock.gay>
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-12 14:04:47 -04:00
Benjamin Lee 20a54aacd6 factor search tokenization out into a function
This ensures that the tokenization algorithm will remain in sync between
querying, indexing, and deindexing. The existing code had slightly
different behavior for querying, because it did not discard words with
>50 bytes. This was inconsequential, because >50 byte tokens are never
present in the index.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-12 14:04:47 -04:00
Benjamin Lee 81cd677b4e fix dropped events in search
The previous code would drop some events entirely if any events between
`skip` and `skip + limit` were not visible to the user. This would cause
the set of events skipped by the `skip(skip)` method to extend past
`skip` in the raw result set, because `skip(skip)` was being called
*after* filtering out invisible events.

This bug will become much more severe with a full filtering
implementation, because it will be more likely for events to be filtered
out. Currently, it is only possible to trigger with rooms that have
history visibility set to "invited" or "joined".

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-12 14:04:47 -04:00
Benjamin Lee 73da353e52 fix missing next_batch for search
The previous code would fail to return next_batch if any of the events
in the window were not visible to the user. It would also return an
unnecessary next_batch when no more results are available if the total
number of results is exactly `skip + limit`.

This bug will become much more severe with a full filtering
implementation, because we will be more likely to trigger it by
filtering out events in a search call. Currently, it is only possible to
trigger with rooms that have history visibility set to "invited" or
"joined".

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-12 14:04:47 -04:00
strawberry 01a77f8a71 add replaces_state and prev_sender in unsigned for membership changes
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-11 13:03:32 -04:00
strawberry ea03a50e21 remove pfps/avatars and display names upon deactivation
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-11 01:19:18 -04:00
strawberry 25d44cad31 slightly dedupe pfp/displayname updates, update blurhash in PDUs too
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-11 01:19:18 -04:00
strawberry 91519959ed mark account as deactivated before leaving rooms
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-11 01:19:18 -04:00
strawberry 305dfc3b42 adminroom: cmds to view room topic and room members
this will be extended more

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-10 23:38:03 -04:00
strawberry 65fbb80145 adminroom: leave all rooms by default on manual deactivations
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-10 21:14:18 -04:00
strawberry f1d90e5df6 log client/remote IP address on various routes tracing calls
this uses InsecureClientIp as this is purely for informational
and logging purposes

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-10 21:04:51 -04:00
strawberry 74b29ce067 adminroom: improved room list outputs, add counts
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-10 19:45:04 -04:00
strawberry 0e7c3cb338 adminroom: simplify codeblock checks
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-10 19:45:04 -04:00
strawberry 14a3471fcb adminroom: fix function typo
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-10 19:45:04 -04:00
strawberry c834e86e67 adminroom: user cmds to put/get/delete room account data
primarily useful for inserting `m.server_notice` user account data
onto the admin room

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-10 19:45:04 -04:00
strawberry b4f0a8a8b5 adminroom: clean up and optimise user commands
`deactivate-all` was terrible and incredibly inefficient

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-10 19:45:04 -04:00
strawberry 9bb90213e1 adminroom: add user ID parsing utils
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-10 19:45:04 -04:00
strawberry fcdf1463ef refactor get_room_topic into 1 single function
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-10 19:45:04 -04:00
strawberry 88d038ffec refactor getting room's canonical alias into 1 function
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-10 19:45:04 -04:00
strawberry 4b4c0952a2 refactor guest_can_join into 1 single function
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-10 19:45:04 -04:00
strawberry 016270b33b adminroom: add server_in_room state cache accessor
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-10 19:45:04 -04:00
strawberry d2063013b4 adminroom: add various state_cache db accessors
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-10 19:45:04 -04:00
strawberry 03ba9bde29 admin cmd to force download and use a server's room state
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-10 19:45:04 -04:00
strawberry 1287a86c05 client-api: export validate_and_add_event_id
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-10 19:45:04 -04:00
strawberry 8210e8c42e slightly adjust sliding sync code for ruma bump
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-10 17:20:59 -04:00
strawberry cb03654dc1 fix broken federated room invites/joins
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-10 14:53:26 -04:00
Jason Volk f0557e3303 split migrations function
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-09 20:56:41 +00:00
Jason Volk f52acd9cdf Fix idiomatic let if
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-09 20:06:50 +00:00
Jason Volk eae41fc411 Fix use-self
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-09 20:06:50 +00:00
Jason Volk c3c91e9d80 Fix suboptimal flops
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-09 20:06:50 +00:00
Jason Volk a8de5d1e60 Fix futures not Send
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-09 20:06:50 +00:00
Jason Volk 7688d67870 Fix needless pass by ref mut
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-09 20:06:50 +00:00
Jason Volk 89d7d48324 Fix equatable if let
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-09 20:06:50 +00:00
Jason Volk b525031a25 Fix derive partial eq without eq
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-09 20:06:50 +00:00
Jason Volk 67f4285504 Fix branches sharing code
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-09 20:06:50 +00:00
Jason Volk b65f05ce19 simplify lifetime parameters
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-09 20:06:50 +00:00
Jason Volk db2c9f28b6 split admin room moderation commands
prior stack frame allocated 170 KiB

Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-09 20:06:50 +00:00
Jason Volk fc1b8326e6 split join_room_by_id_helper into local and remote
prior stack frame allocated 180 KiB

Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-09 20:06:50 +00:00
Jason Volk 6e50b07bf5 Fix large future
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-09 20:06:50 +00:00
strawberry ccf9f95cc9 retroactively fix bad data in roomuserid_joined, remove pointless prefix scans
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-09 03:55:04 -04:00
strawberry 0524e6ed52 remove unnecessary active_local_joined_users_in_room state_cache accessor
the underlying bug has been fixed

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-08 17:32:04 -04:00
strawberry 7f5b59afbb add conduwuit-specific db migration fixing double split db entries
for a few months now we accidentally had double 0xFF splits being
inserted into `roomuserid_joined` cf when membership counts and such
are being updated.

this is a conduwuit-specific db migration and does NOT break conduit
compatibility.

`fix_bad_double_separator_in_state_cache`

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-08 16:58:24 -04:00
strawberry ab5db37851 fix bad double split insert on roomuserid_joined cf
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-08 16:57:48 -04:00
strawberry c0c7f23a05 services(timeline): use self instead of services()
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-07 15:10:00 -04:00
strawberry 14ec41c211 services(state_cache): use self instead of services()
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-07 15:10:00 -04:00
strawberry 2230bc7339 services(state): use self instead of services()
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-07 15:10:00 -04:00
strawberry 0ebabba971 services(pdu_metadata): use self instead of services()
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-07 15:10:00 -04:00
strawberry 3ed561cb31 service(globals): use self instead of services()
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-07 15:10:00 -04:00
strawberry a061644b2d service(event_handler): use self instead of services()
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-07 15:10:00 -04:00
strawberry 82ac6b01b2 service(auth_chain): use self instead of services()
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-07 15:10:00 -04:00
strawberry a04ff7d4af fix(fed): dont reject /state_ids/ on world readable rooms
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-07 15:10:00 -04:00
strawberry 10dfbf6420 fix(fed): dont reject /state/ on world readable rooms
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-07 15:10:00 -04:00