Commit Graph

3854 Commits

Author SHA1 Message Date
Jason Volk dd49b3c3a1 fix/simplify emergency access initialization
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-06 18:21:40 +00:00
Jason Volk b2e56777af fix missing toolchain in cargo smoketest run invocation.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-06 18:21:40 +00:00
Jason Volk f32380772f rename api::client_server to api::client
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-06 18:21:40 +00:00
strawberry 8428f43c78 add legacy element hack for UIAA using invalid `user` field
see:
- e9302a9556
- https://github.com/element-hq/element-android/issues/8043
- https://github.com/element-hq/element-ios/issues/7405

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-06 10:57:00 -04:00
Jason Volk 3af153f5ae split s2s into units
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-06 04:41:27 -04:00
strawberry 38238c309f appservices: remove unnecessary `services()` call for `self`
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-06-05 18:18:08 -04:00
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