Commit Graph

3948 Commits

Author SHA1 Message Date
strawberry 0857fe7907 abstract+add more "users in room" accessors, check membership state on `active_local_joined_users_in_room`
`roomuserid_joined` cf seems unreliable, so in the mean time we need to check
membership state (or maybe this is a more reliable check anyways)

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-05 18:18:08 -04:00
strawberry c738c119f8 delete unnecessary `real_users_cache`, fix overwriting push_target iter, add proper function for getting local active users in room
this `real_users_cache` cache seems weird, and i have no idea what
prompted its creation upstream. perhaps they did this because
sqlite was very slow and their rocksdb setup is very poor, so
a "solution" was to stick member counts in memory.
slow iterators, scanning, etc do not apply to conduwuit where
our rocksdb is extremely tuned, and i seriously doubt something
like this would have any real world net-positive performance impact.

also for some reason, there is suspicious logic where we
overwrite the entire push target collection.

both of these things could be a potential cause for receiving
notifications in rooms we've left.

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-05 18:18:08 -04:00
strawberry c1227340b3 update complement results
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-05 18:17:46 -04:00
strawberry bf10ff65a4 media: ignore Content-Type params, use binary_search
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-05 17:28:51 -04:00
strawberry b781771a9b media: drop Content-Type detection support
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-05 16:33:53 -04:00
strawberry df8ba04e31 media: trust client Content-Type again
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-05 16:33:53 -04:00
strawberry 19926ba00d sort `ALLOWED_INLINE_CONTENT_TYPES`
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-05 16:33:53 -04:00
strawberry 893cc50570 csp: set `form-action 'none'`
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-05 16:33:53 -04:00
strawberry c9fbbdce1c csp: remove unusual directives, slight security improvement
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-05 02:50:44 -04:00
Jason Volk 732e8b82aa Abstract password hashing into util.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-05 03:00:23 +00:00
Tom Black 282c2feca8 Clarify purpose and temporary muting 2024-06-04 17:13:21 +01:00
strawberry 919735b4ce remove usages of `&String` and `&Owned[..]`
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-03 14:17:42 -04:00
strawberry 2e83e56a07 remove deleted config options and update `address` example option
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-03 14:17:42 -04:00
strawberry ff7dfec74c slightly cleanup update check
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-03 14:17:42 -04:00
strawberry 84290bd668 update deps, remove unnecessary zstd crate, pin rust-rocksdb rev
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-03 14:17:32 -04:00
strawberry b29a8791de admincmd: leave all rooms if deactivating all users with `--force`
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-03 00:10:28 -04:00
strawberry 83220b43a2 use saturating_add and vec with_capacity in even more places
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-03 00:10:28 -04:00
strawberry 4ea7af5780 ci(engage): use all-features devshell for cargo doc / rustdoc --all-features
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-03 00:10:28 -04:00
strawberry 79fb8091dc ci(engage): use all-features direnv devshell for clippy/all
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-03 00:10:28 -04:00
strawberry f6fa2a4f65 use `swap_remove` instead of `remove` in a few places
`swap_remove` is faster if we don't care about the order (O(1))

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-03 00:10:28 -04:00
strawberry b63937af0b ci(engage): add cargo test default, use all-features devshell for cargo test --all-features
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-03 00:10:28 -04:00
strawberry 3c4e325036 nix(bin): cache `default` devshell on top of `all-features` devshell
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-03 00:10:28 -04:00
strawberry 023fb41c49 load .env file before initializing flake to use `DIRENV_DEVSHELL` in .env
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-03 00:10:28 -04:00
strawberry 9a5f1dac57 drop unnecessarily verbose get_alias_helper logging
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-03 00:10:28 -04:00
strawberry 173ff26eb6 disable URL previews by default upon admin room creation
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-03 00:10:28 -04:00
strawberry 45e3fdba69 admin room: add `get-latest-pdu` and `get-first-pdu` commands
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-03 00:10:24 -04:00
strawberry 9f359e0550 make `resolve_state` public to resolve new forced compressed room state
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-02 23:53:31 -04:00
strawberry ffdf47d1ea add `latest_pdu_in_room` timeline function
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-02 23:53:31 -04:00
strawberry 1af65e695d media: return application/octet-stream if no content-type was provided
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-02 23:53:31 -04:00
strawberry b1886583d9 csp: fix typo, add base-uri none
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-02 23:53:31 -04:00
strawberry f11103b43b media: check detected content-type against MSC2702
only return `inline` if the detected content-type is an allowed
inline content-type as defined by MSC2702

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-02 23:53:31 -04:00
strawberry 9b096cc67b fix: check if you've left the room before forgetting it
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-02 23:53:31 -04:00
strawberry 1ac72ab914 init a few state hashmaps using with_capacity
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-02 23:53:31 -04:00
strawberry f0533e07ef fed: remove unnecessary mutables, use with_capacity in couple more places
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-02 23:53:31 -04:00
strawberry 68f42f5a2f fed: relax read receipt EDU check
so in theory: guest users, peaking over federation,
and world readable rooms should be allowed to send
read receipts even if they're not joined.

relaxing this check to only allow the read receipt if
the server has at least 1 member in the room makes
some of this still work

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-02 23:53:31 -04:00
strawberry 884cbab135 ci: comment out hardened_malloc clippy check for now
i need to either fix static linking, or just make it
dynamic always (but then kinda useless idk)

https://gitlab.com/conduwuit/conduwuit/-/jobs/6953419673#L3155

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-02 23:53:31 -04:00
strawberry 4aead5de7a reflax a couple restrictions on custom room IDs and aliases
🙃

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-02 23:53:31 -04:00
strawberry aef25ea1f7 enable tracing feature for axum
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-02 23:53:31 -04:00
Jason Volk 1a4736d40b support configuring multiple bind hosts; default to dual localhost.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-03 01:17:58 +00:00
strawberry f09e0dc137 add conduwuit community code of conduct
this is a code of conduct that the moderation team made up,
specific to conduwuit's community spaces such as the matrix rooms.

the matrix foundation and contributor's covenant still apply, but
having conduwuit-specific additional guidelines help

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-02 21:02:38 -04:00
strawberry de79b66cea misc docs changes
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-02 21:02:38 -04:00
strawberry 95ca9d00a2 nix: get all features from main crate 2024-06-02 23:01:12 +00:00
Jason Volk 887496d040 consolidate default cargo features
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-02 23:01:12 +00:00
Jason Volk c2586737ae accept receipts prior to events
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-02 23:01:12 +00:00
Jason Volk 7d2f510cc3 single-source for defaulty log filter string
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-02 23:01:12 +00:00
Jason Volk 102bd1b4a6 use debug_warn for parse_incoming_pdu err results.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-02 23:01:12 +00:00
Jason Volk 89ab687f16 move signal handling out to main
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-02 23:01:12 +00:00
Jason Volk 1108235c63 misc simplifications and cleanup
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-02 20:17:45 +00:00
Jason Volk 90d9a997a5 split / cleanup core utils.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-02 20:17:45 +00:00
Jason Volk 5fe5ab279c split RouterExt impl related into ruma_wrapper unit.
slightly restrict client_server mod index.

Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-02 20:17:45 +00:00