Charles Hall
c24f79b79b
update rust deps except rocksdb and otel clownery
...
* OTel v0.25.0 requires downgrading Tokio to 1.38 [0]
* They have a fix for this but aren't cutting a release just for release
schedule reasons [1]
* Prometheus support (at least for server-pull) was dropped at OTel
v0.23 and isn't planned to be picked up again until OTel v1 [2]
* No real reasoning was provided for this decision AFAICT [3] [4]
* So many compiler errors
* Unhelpful changelogs
The last two points are what made me give up on trying to upgrade to
OTel v0.24 too.
RocksDB isn't updated because we'd need to update our nixpkgs too but
that causes other problems, such as an upstream bug in liburing when
building for musl.
[0]: https://github.com/open-telemetry/opentelemetry-rust/issues/2094
[1]: https://github.com/open-telemetry/opentelemetry-rust/issues/2094#issuecomment-2346834030
[2]: https://docs.rs/opentelemetry-prometheus/0.17.0/opentelemetry_prometheus/index.html
[3]: https://github.com/open-telemetry/opentelemetry-rust/pull/1792
[4]: https://github.com/open-telemetry/opentelemetry-rust/pull/1792#issuecomment-2121514344
2024-09-23 14:22:55 -07:00
Lambda
ca6bc74074
Fix X-Matrix signature validation for incoming requests
...
For HTTP/1 requests, an inbound Request's URI contains only the path and
query parameters, since there's no way to synthesize the authority part.
This is exactly what we need for the X-Matrix "uri" field.
HTTP/2 requests however can contain the :authority pseudo-header, which
is used to populate the Request's URI. Using a URL that includes an
authority breaks the signature check.
Largely inspired by conduit MR !631
(https://gitlab.com/famedly/conduit/-/merge_requests/631 ).
Co-authored-by: strawberry <strawberry@puppygock.gay>
2024-09-19 16:25:23 +00:00
Charles Hall
b9ee898920
require client base_url, rename from authority
...
The previous code used `server_name` as a fallback but in reality there
is no real relationship between `server_name` and the location clients
are supposed to make requests to.
Additionally, the `insecure` option is gone, because we now allow users
to control the entire URL, so they're free to choose the scheme.
2024-09-18 13:03:49 -07:00
Benjamin Lee
7672cc8473
use OwnedMxcUri in media service
...
Not using `MxcData` because it borrows it's fields, and so we wouldn't
be able to return an owned `MxcData` from functions that read the db.
2024-09-15 00:32:17 -07:00
Lambda
3bb4a25c1d
Include old verify keys in _matrix/key/v2/server response
2024-09-13 17:02:30 +00:00
Charles Hall
449c27642c
hide sliding sync behind explicit option
...
We want to make sure users know this sliding sync impl is pretty buggy
before they attempt to use it.
2024-09-08 14:08:32 -07:00
Charles Hall
806cc0cb28
serve well-known client and server config
...
This way users can have a simpler time configuring this stuff and we can
worry about the spec compliance parts and specifying the same thing over
and over parts.
2024-09-08 13:35:38 -07:00
Lambda
3a55684623
Update MSRV to 1.81.0
...
Plus a "__CARGO_FIX_YOLO=1 cargo clippy --fix"
2024-09-08 09:54:08 -07:00
Lambda
5c4062742f
Log curl command line for all requests at trace
2024-09-08 09:10:40 -07:00
Lambda
f1642c92d1
Take iterator in calculate_hash()
...
Avoids unnecessary allocations.
2024-09-06 17:20:14 +00:00
Lambda
cce83beedb
Properly type stored EDUs
2024-09-06 17:20:14 +00:00
Lambda
26322d5a95
Add PduId wrapper struct
...
Death to Vec<u8>
2024-09-06 17:20:14 +00:00
Lambda
542e097cdf
server_server: use non-deprecated create_join_event types
...
Instead of working with v1 types and converting them to v2 as required,
do it the other way around. Allows us to remove a very broad
#[allow(deprecated)].
2024-09-05 19:42:37 +00:00
Lambda
b4fecbc517
client/media: work around matrix-media-repo bug
...
It rejects Authenticated Media requests if X-Matrix values aren't
unnecessarily quoted:
https://github.com/t2bot/matrix-media-repo/issues/609
2024-09-01 09:42:45 +00:00
Lambda
3fe0110649
media: convert allow_remote to enum
2024-09-01 09:42:45 +00:00
Lambda
a4b7df1b3a
media: use FileMeta instead of tuples
2024-09-01 09:42:45 +00:00
Lambda
84850a163d
Factor content out of FileMeta
...
That's not what *meta*data means
2024-09-01 09:42:45 +00:00
Lambda
a06c8db996
Fetch and thumbnail original media if fetching thumbnail fails
...
E.g. because the remote server's thumbnail endpoint is broken in
hilarious ways: https://github.com/element-hq/synapse/issues/17518
2024-09-01 09:42:45 +00:00
Lambda
d3b6718812
server_server: implement authenticated media endpoints
2024-09-01 09:42:45 +00:00
Lambda
79053ad052
client_server: use and provide authenticated media API
2024-09-01 09:42:45 +00:00
Lambda
7f6ab63752
client_server: factor out width/height conversion
2024-09-01 09:42:45 +00:00
Lambda
edfaa83405
server_server: make outbound requests using spec v1.11
...
This is required for authenticated media requests, which are otherwise
performed using the unstable endpoint.
2024-09-01 09:42:45 +00:00
Lambda
94204415ee
Add MxcData helper
2024-09-01 09:42:45 +00:00
Lambda
64b3c357dd
media: put old API behind legacy_media import
2024-09-01 09:42:45 +00:00
Lambda
5a5bea3217
cargo update ruma httparse
...
This adds authenticated media APIs.
2024-09-01 09:42:45 +00:00
Lambda
006ea0eb94
Fix appservice users getting invited over federation
...
Invites are magic sauce, we need to manually send it off to the
appservice if it's for an appservice user.
2024-08-31 10:18:29 +00:00
avdb13
00b77144c1
chore: deprecate support for unstable room versions
2024-08-12 06:18:28 +02:00
Benjamin Lee
91739899e7
changelog entry for remote device key query logging
2024-08-11 16:39:08 -07:00
Benjamin Lee
141c60e4a3
log more detailed backoff state for remote device key requests
2024-08-11 16:39:08 -07:00
Benjamin Lee
1551833501
log failed remote device key requests
2024-08-11 16:39:08 -07:00
Lambda
dd24a44112
Use TokenSet for roomid_mutex_federation
2024-07-22 18:07:03 +00:00
Lambda
4893c54f4f
Use TokenSet for roomid_mutex_insert
2024-07-22 18:07:03 +00:00
Lambda
34ccb2cd06
Use TokenSet for roomid_mutex_state
2024-07-22 18:07:03 +00:00
Lambda
aea6019c0a
upgrade_room_route: fix state lock
...
This was using the lock for the replacement room to send events to the
original room, which may or may not cause problems.
2024-07-22 18:06:11 +00:00
Lambda
ef1b6fe111
upgrade_room_route: give more descriptive names to locks
...
This makes the next commit, which is an actual fix, much easier to read.
2024-07-22 18:06:11 +00:00
tranquillity-codes
c70cfd3d25
Return 504 when a file is missing to be by-spec
...
The spec defines that the media endpoints should return 504 when a file
is not-yet-uploaded, which has been interpreted to include when a file
was deleted. Modifies the /media/v3/download/ and /media/r0/thumbnail
endpoints.
2024-07-21 20:42:07 -07:00
Charles Hall
ee95b6be3c
fix api/client_server/sync events
...
Some duplicated-ish code from src/database/key_value/rooms/timeline.rs
about handling errors from `pdus_since`/`pdus_until`, it seems like the
error message was actually directly copy-pasted from there because it
referred to the wrong function lol
2024-07-16 11:16:08 -07:00
Charles Hall
dacb2ae7dd
fix api/client_server/context events
2024-07-16 11:12:08 -07:00
Charles Hall
4b9c6a754c
fix api/client_server/room events
2024-07-16 11:12:08 -07:00
Charles Hall
196c923a5a
fix api/client_server/account events
2024-07-16 11:12:08 -07:00
Charles Hall
60b89aba78
fix api/client_server/session events
...
And also add a new event for logging out to match the one for logging in
because why not.
2024-07-16 11:12:08 -07:00
Charles Hall
0aef00c58b
fix api/client_server/keys events
2024-07-16 11:12:08 -07:00
Charles Hall
9d8e1a1490
fix api/server_server events
2024-07-16 11:12:07 -07:00
Charles Hall
db666fe903
fix api/client_server/directory events
2024-07-16 11:12:07 -07:00
Charles Hall
b6cba0c4ae
extract closure into a function
...
This was mostly written by using rust-analyzer's "extract to function"
and "extract to variable" functionality.
2024-07-16 11:12:07 -07:00
Charles Hall
e49fe04f10
fix api/appservice_server events
2024-07-16 11:12:07 -07:00
Charles Hall
f5e10f5a8f
fix api/ruma_wrapper/axum events
2024-07-16 11:12:07 -07:00
Charles Hall
ca4f780c93
fix api/client_server/membership events
2024-07-16 11:12:07 -07:00
Charles Hall
cb036593ea
refactor send_request in api/server_server
...
Seriously, what is going on with the control flow in this codebase?
2024-06-24 12:43:28 -07:00
Charles Hall
e83a30af4b
reduce duplicate events
...
I hate `log_error`. A better way to do this would be to not reuse the
same error type literally everywhere, so you could distinguish, in
`crate::service::sending::Service::handle_response`, whether to emit an
event based on which function created the error. Fixing that is a lot
more work, though.
2024-06-24 12:40:59 -07:00