Commit graph

2728 commits

Author SHA1 Message Date
Benjamin Lee
48850605b0
changelog entry for media deletion admin commands 2024-09-17 19:31:54 -07:00
Benjamin Lee
ba7b224c38
add dry-run mode to delete-remote-media-files admin command 2024-09-17 19:31:54 -07:00
Benjamin Lee
9d14c5d461
add admin command to delete all remote media files 2024-09-17 19:31:51 -07:00
Benjamin Lee
d7087c66bb
add admin command to delete individual media files 2024-09-17 19:13:54 -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
Benjamin Lee
e2cba15ed2
factor out helper for parsing media keys
Leaving this private in `database::key_value::media` because the way
the metadata is encoded in media keys is a mess. I want to fix that in
the future, and want to limit the number of things that rely on it for
now.
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
Lambda
296824fef4 Always use local keypair instead of trying to find our own keys in cache 2024-09-13 17:02:30 +00:00
Lambda
458a7458dc Support specifying old_verify_keys in config 2024-09-13 17:02:30 +00:00
Lambda
5691cf0868 Better debugging for signing key fetching 2024-09-13 13:31:04 +00:00
Charles Hall
9e6a5e6604
update changelog 2024-09-08 14:08:32 -07: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
74589043f7
Fix weird type gymnastics 2024-09-08 09:54:04 -07:00
Lambda
5c4062742f
Log curl command line for all requests at trace 2024-09-08 09:10:40 -07:00
Lambda
b0f33207fe Add wrapper types for short IDs 2024-09-06 17:20:14 +00: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
341f4213d0 Use self instead of going through services() 2024-09-05 19:42:37 +00:00
Lambda
f52cf53931 Remove obsolete clippy #[allow]s 2024-09-05 19:42:37 +00:00
Lambda
22ce624a81 event_handler: remove AsyncRecursiveType alias, simplify signatures 2024-09-05 19:42:37 +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
Benjamin Lee
be14f5bddc
fetch signing keys on join even when no cached keys for origin
Silly mistake
2024-09-01 12:22:10 -07: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
1ccb1e572b media: add MediaFileKey wrapper
One more win in the fight against the Vec<u8>s
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
82aacdc153 Update changelog for Authenticated Media 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
Stephen D
556f2157a2 add expired keys fix to changelog 2024-08-31 23:25:54 -03:00
Stephen D
926091223d fetch keys that are expired 2024-08-31 23:25:44 -03:00
Stephen D
06fa49ac27 Update changelog to reflect key retrieval logic changes 2024-08-31 23:03:00 -03:00
Stephen D
1b13d7f7ab Fix bug when retrieving keys for an event.
It's possible for a server to have multiple associated public keys. This can happen when a Matrix server is set up on a particular domain, its key is lost, and the server continues running on the domain. Now there will be two keys associated to the domain. The old logic wouldn't fetch the new key if we already had the old key cached. The new logic will fetch any keys we don't have that we need, rather than just fetching one key per server.
2024-08-31 23:02:53 -03:00
Stephen D
2db3b18ce8 Clean up existing code in get_server_keys_from_cache. It's a little DRYer now 2024-08-31 22:25:43 -03: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
Benjamin Lee
4ad50e2708
only log banned users if they are local
This was the intent of f03b6cde29, but it
was missing the check that the user is actually local, and so was
logging *all* banned users.
2024-08-30 23:08:52 -07:00
avdb13
f03b6cde29 feat: report local users getting banned 2024-08-26 02:17:01 +02:00
Lambda
14afa1357e tracing: allow configuring service name
This is essential when consuming tracing data from multiple servers.
2024-08-24 19:31:39 +00:00
Charles Hall
c355e2ad39
ensure we don't use aliases again accidentally 2024-08-19 10:36:32 -07:00
K900
6685f8cd14
remove uses of aliases 2024-08-17 12:31:48 -07:00