Commit graph

3000 commits

Author SHA1 Message Date
Jason Volk
865b5d7241 reorganize database crate.
split database Cork into unit.

split database migrations from mod.rs

Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-09 15:26:45 -04:00
Jason Volk
fe91ce0601 add conf items for rocksdb repair and read-only modes.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-09 15:26:45 -04:00
Jason Volk
5f11d68616 tracing instruments for ruma state res
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-09 15:26:45 -04:00
strawberry
d92e8e170f list max cache capacity in memory-usage admin cmd
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-09 15:26:45 -04:00
strawberry
72d983d2ec add admin command to fetch /.well-known/matrix/support from server
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-09 15:26:45 -04:00
strawberry
39946beda8 add server-side support for /.well-known/matrix/support
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-09 15:26:45 -04:00
Matthias Ahouansou
c946352e7f fix(sync): send phoney leave event where room state is unknown on invite rejection
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-09 15:26:45 -04:00
Matthias Ahouansou
3b5794b5bd fix(membership): check if server is in room to decide whether to do remote leaves
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-09 15:26:45 -04:00
Matthias Ahouansou
6078b5ee9d fixup! feat: support /make_join and /send_join for restricted rooms
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-09 15:26:45 -04:00
Matthias Ahouansou
d8949d55c4 refactor(state_accessor): add method to check if a user can invite another user
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-09 15:26:45 -04:00
strawberry
70ce9c299e bump ruma and cargo.lock
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-09 15:26:45 -04:00
strawberry
2516d44cb1 dont 404 and respond+update with default push rules if non-existent
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry
e4a987cf80 bump ruma and declare support for unstable MSC3026 (busy presence state)
a938640491

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry
db8e7e5382 TEMP: remove user_is_invited stuff
this is clearly unfinished right now

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
Matthias Ahouansou
f0b91461a0 refactor(state_accessor): add method to check if a user can invite another user
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
renovate[bot]
a8452f3ae1 chore(deps): update nixos/nix docker tag to v2.21.2 2024-04-05 22:15:16 -04:00
Matthias Ahouansou
321a6ca0fe feat(membership): check if user already has the membership that is requested to be set
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry
0307cdf2b2 bump ruma
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry
1ccc777532 bump conduwuit version to 0.1.13
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
Jason Volk
ebb71b7d7c add contains_url filter to /messages; also split out visibility filter.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-05 22:15:16 -04:00
Jason Volk
cde06125b8 immutable cache-control for media
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-05 22:15:16 -04:00
strawberry
bfd91c93e0 enable presence by default, remove presence warning
it is now very very good

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry
1b84f5a855 resolve wildcard_imports and checked_conversations lints
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry
f0a0704a93 slight adjustments, remove some explicit annotations
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
Jason Volk
9cc4f3e929 split main
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-05 22:15:16 -04:00
Jason Volk
7f6c19f066 fix using same federation reqwest pool after sender deduplication.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-05 22:15:16 -04:00
Jason Volk
ca1c77d76b refactor presence to not involve rooms.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-05 22:15:16 -04:00
Jason Volk
885224ab76 add tools for user-to-server and user-to-user visibility
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-05 22:15:16 -04:00
strawberry
3c2e8a5250 fix spaces test lints
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
Jason Volk
568136296f add granular conf items for all memory caches
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-05 22:15:16 -04:00
Matthias Ahouansou
5c30d2b2b0 fix(membership): perform stricter checks when choosing an authorized user
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
Matthias Ahouansou
68e64392f0 fix(membership): remove join_authorized_via_users_server field on state update
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
Matthias Ahouansou
172d71e365 check if user is joined in the room in user_can_invite
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry
c803891634 better event_type checks for send_state_event_for_key_helper
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry
0214caeaea always allow count to be filled in search response
i fail to see any reason why we would always want
this to be None

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry
a2ee6b410e add another element_hacks feature check
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry
ab0182ace4 check if user is allowed to invite for join_authorized_via_users_server in join_room_by_id_helper
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry
b9e442b694 use map_or in user_can_invite
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry
ddcf43f1b8 replace ErrorKind::Forbidden with forbidden() non-exhaustive constructor
917584e0ca

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry
13cd9c4c38 bump cargo.lock due to RUSTSEC-2024-0332, and bump ruma
https://rustsec.org/advisories/RUSTSEC-2024-0332

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
Matthias Ahouansou
49eb418786 feat: support /make_join and /send_join for restricted rooms
from https://gitlab.com/famedly/conduit/-/merge_requests/618

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
Matthias Ahouansou
ed960f41ac feat: recurse relationships (and fix some lints)
from https://gitlab.com/famedly/conduit/-/merge_requests/613

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry
661dba688a add trivially_copy_pass_by_ref lint
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry
3efb3a93ca sync hierarchy over federation MR
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-05 22:15:16 -04:00
strawberry
bd69d9b565 move invalid 200 response log to info
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-03 12:52:46 -04:00
strawberry
6800f91949 remove some services() usage on startup for accessing config
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-03 12:52:46 -04:00
strawberry
bd117bdf0d use config.allow_local_presence instead of services()
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-03 12:52:46 -04:00
strawberry
d6651ab422 remove unused import
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-03 12:52:46 -04:00
K900
8134dd9151 Reduce number of separate sources of truth for presence disabled-ness
Instead of checking if we should update every time we want to update,
call the updater every time and decide internally.
2024-04-03 12:52:46 -04:00
strawberry
34fe7b7369 drop /hierarchy requests to debug
this is not helpful informational logging

```
2024-04-02T04:40:52.590444Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Asking thomcat.rocks for /hierarchy
2024-04-02T04:40:52.628248Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Asking hackingfor.eu for /hierarchy
2024-04-02T04:40:52.808526Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Asking matrix.org for /hierarchy
2024-04-02T04:40:52.920936Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Asking matrix.org for /hierarchy
2024-04-02T04:40:52.959362Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Got response from matrix.org for /hierarchy
Response { children: [], inaccessible_children: [], room: SpaceHierarchyParentSummary { canonical_alias: Some("#cybersec-whonix:matrix.org"), name: Some("Whonix"), num_joined_members: 329, room_id: "!OJFkLJksWastbfdRuf:matrix.org", topic: Some("| Part of the Cybersec matrix.org community (#cyber-space:matrix.org) | RULES: https://cybersec-rules.thomcat.rocks | Whonix-focused room | Off-topic chat is fine. Keep it brief and/or move it to #cybersec-offtopic:matrix.org"), world_readable: true, guest_can_join: false, avatar_url: Some("mxc://matrix.org/DMJtrQdhQHKxeODrSibtrczX"), join_rule: "public", room_type: None, children_state: [], allowed_room_ids: [] } }
2024-04-02T04:40:52.959762Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Asking matrix.org for /hierarchy
2024-04-02T04:40:53.109611Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Got response from matrix.org for /hierarchy
Response { children: [], inaccessible_children: [], room: SpaceHierarchyParentSummary { canonical_alias: Some("#lockpicking:matrix.org"), name: Some("Lockpicking"), num_joined_members: 284, room_id: "!uEYjSxQOZnHEkiurTP:matrix.org", topic: Some("| Part of the Cybersec matrix.org community (#cyber-space:matrix.org) | RULES: https://cybersec-rules.thomcat.rocks | Off-topic chat is fine. Keep it brief and/or move it to #cybersec-offtopic:matrix.org"), world_readable: false, guest_can_join: false, avatar_url: Some("mxc://thomcat.rocks/cSeFfMLUdjymKdkUmXtIQTjf"), join_rule: "public", room_type: None, children_state: [], allowed_room_ids: [] } }
2024-04-02T04:40:53.109880Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Asking matrix.org for /hierarchy
2024-04-02T04:40:53.261581Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Got response from matrix.org for /hierarchy
Response { children: [], inaccessible_children: [], room: SpaceHierarchyParentSummary { canonical_alias: Some("#cybersec-rss:matrix.org"), name: Some("Cybersecurity-RSS"), num_joined_members: 347, room_id: "!IVHnAZkhJOhdZxlHRA:matrix.org", topic: Some("|   Part of the Cybersec matrix.org community (#cyber-space:matrix.org)   |   Suggestions to our RSS feed list welcome at #cybersecurity:matrix.org"), world_readable: true, guest_can_join: false, avatar_url: Some("mxc://thomcat.rocks/ugdubBloOkVCYxqFzdVoPwcV"), join_rule: "public", room_type: None, children_state: [], allowed_room_ids: [] } }
2024-04-02T04:40:53.305166Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Got response from matrix.org for /hierarchy
Response { children: [], inaccessible_children: [], room: SpaceHierarchyParentSummary { canonical_alias: Some("#cybersec-whonix:matrix.org"), name: Some("Whonix"), num_joined_members: 329, room_id: "!OJFkLJksWastbfdRuf:matrix.org", topic: Some("| Part of the Cybersec matrix.org community (#cyber-space:matrix.org) | RULES: https://cybersec-rules.thomcat.rocks | Whonix-focused room | Off-topic chat is fine. Keep it brief and/or move it to #cybersec-offtopic:matrix.org"), world_readable: true, guest_can_join: false, avatar_url: Some("mxc://matrix.org/DMJtrQdhQHKxeODrSibtrczX"), join_rule: "public", room_type: None, children_state: [], allowed_room_ids: [] } }
2024-04-02T04:40:53.323257Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Asking thomcat.rocks for /hierarchy
2024-04-02T04:40:53.323672Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Asking matrix.org for /hierarchy
2024-04-02T04:40:53.369721Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Asking matrix.org for /hierarchy
2024-04-02T04:40:53.529250Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Got response from matrix.org for /hierarchy
Response { children: [], inaccessible_children: [], room: SpaceHierarchyParentSummary { canonical_alias: None, name: None, num_joined_members: 1463, room_id: "!aBXqGDWIxVYeYxVbRu:matrix.org", topic: Some("| Part of the Cybersec matrix.org community (#cyber-space:matrix.org) | The room needs urgent attention? @ all the mods! | RULES: https://cybersec-rules.thomcat.rocks | \"you seem to be completely in lack of basic knowledge of how a computer or any programming language operates, to the point that any attempt of discussing any security measures is a complete waste of time\""), world_readable: false, guest_can_join: false, avatar_url: Some("mxc://thomcat.rocks/DjRWzuYjLkScQYPySYNedlFr"), join_rule: "public", room_type: None, children_state: [], allowed_room_ids: [] } }
2024-04-02T04:40:53.546581Z  INFO http_request{path=/_matrix/client/v1/rooms/:room_id/hierarchy}: conduit::service::rooms::spaces: Got response from matrix.org for /hierarchy
Response { children: [], inaccessible_children: [], room: SpaceHierarchyParentSummary { canonical_alias: None, name: None, num_joined_members: 1463, room_id: "!aBXqGDWIxVYeYxVbRu:matrix.org", topic: Some("| Part of the Cybersec matrix.org community (#cyber-space:matrix.org) | The room needs urgent attention? @ all the mods! | RULES: https://cybersec-rules.thomcat.rocks | \"you seem to be completely in lack of basic knowledge of how a computer or any programming language operates, to the point that any attempt of discussing any security measures is a complete waste of time\""), world_readable: false, guest_can_join: false, avatar_url: Some("mxc://thomcat.rocks/DjRWzuYjLkScQYPySYNedlFr"), join_rule: "public", room_type: None, children_state: [], allowed_room_ids: [] } }
```

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-03 12:52:46 -04:00