Commit graph

2967 commits

Author SHA1 Message Date
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
strawberry
667db8e8a3 output error if sending to trusted key server failed
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-03 12:52:46 -04:00
strawberry
935202eaa3 move panic = "abort" to release-high-perf build profile
i don't really want to do this but broken dependencies
are making this unavoidable

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
strawberry
a20b071a8a add manual_let_else lint
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
Matthias Ahouansou
c31fb7134a fix: do not expect that all http requests are valid reqwest requests
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
Jason Volk
93a43a0eda add conf item for exact amount of startup netburst.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-02 00:32:41 -04:00
Jason Volk
0ba8d1318d move presence up two levels out of rooms.edus and rooms.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-02 00:32:41 -04:00
Jason Volk
9790477b0e move typing feature up one level out of rooms.edus.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-02 00:32:41 -04:00
Jason Volk
89a919ce75 move read_receipt feature up one level out of rooms.edus.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-02 00:32:41 -04:00
Jason Volk
22b123de7b improve tracing attributes in sending stack.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-02 00:32:41 -04:00
Jason Volk
a87e7d8e17 split out, dedup, cleanup sending service methods
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-02 00:32:41 -04:00
Jason Volk
3c09313f79 move and reorganize sending codepaths; no functional changes
Signed-off-by: Jason Volk <jason@zemos.net>
2024-04-02 00:32:41 -04:00
strawberry
a72ea54d11 update differences.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
strawberry
e75fb17899 ci: dont run docker stuff if not a PR *and* both env variables are not empty
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
strawberry
ed5be58f9f ci: only run dockerhub steps if username and token are not empty
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
strawberry
95ca7bc3e4 move complement dir to tests dir
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
Matthias Ahouansou
2a48e562e6 fix: return error when trying to unregister unknown appservice id
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
strawberry
51afde9e98 admin cmd to send a request/ping to /_matrix/federation/v1/version
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
strawberry
738878f6ff bump conduwuit version to 0.1.12
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
strawberry
fec4b3c953 delete conduit_bin feature
i dont know what's the point of this

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
strawberry
a0ad911688 stop sending make_join requests after 50 failures
this is a very generous number

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
strawberry
af6c72fa84 stop sending make_join if 15 servers responded with unsupported/invalid room version
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
strawberry
ce414023a4 default to None room topic if invalid/redacted for spaces too
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
Matthias Ahouansou
c61aee4f1c fix: reject /register requests when there is no token and the type is appservice
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
strawberry
7a1a271518 dont allow m.call.invite timeline events in public rooms
also simplifies the encrypted event check (we dont
need to convert anything here)

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
renovate[bot]
71cea1c567 fix(deps): update rust crate image to 0.25.1 2024-04-02 00:32:41 -04:00
strawberry
ff3bc3fb09 on new room creations: only allow moderators to call public rooms
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
strawberry
72b60c4770 add lockdown_public_room_directory config option
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-02 00:32:41 -04:00
strawberry
00ddc1c88e generalise and cleanup docs a bit
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
Jason Volk
114324e26c remove write_lock around rocksdb
Signed-off-by: Jason Volk <jason@zemos.net>
2024-03-30 22:06:18 -04:00
strawberry
141a6bc73e dont panic when failing to create admin room response/PDU
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry
712cdef6c7 drop url_preview_max_spider_size to 384KB
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry
9cd25db955 list resolver caches in memory-usage admin cmd
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00
strawberry
89e3d17e65 update differences.md
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-03-30 22:06:18 -04:00