Travis Ralston
fe742653ff
Add an API to list changes to quarantine state of media ( #19558 )
...
Fixes https://github.com/element-hq/synapse/issues/19352
(See issue for history of this feature and previous PRs)
> First, a [naive
implementation](https://github.com/element-hq/synapse/pull/19268 ) of the
endpoint was introduced, but it quickly ran into [performance issues on
query](https://github.com/element-hq/synapse/pull/19312 ) and [long
startup times](https://github.com/element-hq/synapse/issues/19349 ),
leading to its
[removal](https://github.com/element-hq/synapse/pull/19351 ). It also
didn't actually work, and would fail to expose media when it was
"unquarantined", so a [partial
fix](https://github.com/element-hq/synapse/pull/19308 ) was attempted,
where the suggested direction is to use a
[stream](https://element-hq.github.io/synapse/latest/development/synapse_architecture/streams.html#cheatsheet-for-creating-a-new-stream )
instead of a timestamp column.
This PR re-introduces the API building on the previous feedback:
* Adds a stream which tracks when media becomes (un)quarantined.
* Runs a background update to capture already-quarantined media.
* Adds a new admin API to return rows from the stream table.
We track both quarantine and unquarantine actions in the stream to allow
downstream consumers to process the records appropriately. Namely, to
allow our Synapse exchange in HMA to remove hashes for unquarantined
media (use case further explained in the
[issue](https://github.com/element-hq/synapse/issues/19352 )).
**Note**: This knowingly does not capture all cases of media being
quarantined. Other call sites are lower priority for T&S, and can be
addressed in a future PR. ~~An issue will be created after this PR is
merged to track those sites.~~
https://github.com/element-hq/synapse/issues/19672
### Pull Request Checklist
<!-- Please read
https://element-hq.github.io/synapse/latest/development/contributing_guide.html
before submitting your pull request -->
* [x] Pull request is based on the develop branch
* [x] Pull request includes a [changelog
file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog ).
The entry should:
- Be a short description of your change which makes sense to users.
"Fixed a bug that prevented receiving messages from other servers."
instead of "Moved X method from `EventStore` to `EventWorkerStore`.".
- Use markdown where necessary, mostly for `code blocks`.
- End with either a period (.) or an exclamation mark (!).
- Start with a capital letter.
- Feel free to credit yourself, by adding a sentence "Contributed by
@github_username." or "Contributed by [Your Name]." to the end of the
entry.
* [x] [Code
style](https://element-hq.github.io/synapse/latest/code_style.html ) is
correct (run the
[linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters ))
---------
Co-authored-by: turt2live <1190097+turt2live@users.noreply.github.com >
Co-authored-by: Eric Eastwood <madlittlemods@gmail.com >
Co-authored-by: Eric Eastwood <erice@element.io >
2026-04-09 11:41:31 -06:00
Devon Hudson
987b61a92b
Revert "Add an Admin API endpoint for listing quarantined media ( #19268 )" ( #19351 )
...
Fixes #19349
This reverts commit 3f636386a6
(https://github.com/element-hq/synapse/pull/19268 ) as the DB migration
was taking too long and blocking media access while it happened.
See https://github.com/element-hq/synapse/issues/19349 for further
information.
### Pull Request Checklist
<!-- Please read
https://element-hq.github.io/synapse/latest/development/contributing_guide.html
before submitting your pull request -->
* [X] Pull request is based on the develop branch
* [X] Pull request includes a [changelog
file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog ).
The entry should:
- Be a short description of your change which makes sense to users.
"Fixed a bug that prevented receiving messages from other servers."
instead of "Moved X method from `EventStore` to `EventWorkerStore`.".
- Use markdown where necessary, mostly for `code blocks`.
- End with either a period (.) or an exclamation mark (!).
- Start with a capital letter.
- Feel free to credit yourself, by adding a sentence "Contributed by
@github_username." or "Contributed by [Your Name]." to the end of the
entry.
* [X] [Code
style](https://element-hq.github.io/synapse/latest/code_style.html ) is
correct (run the
[linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters ))
---------
Co-authored-by: Travis Ralston <travpc@gmail.com >
2026-01-06 21:37:23 +00:00
Travis Ralston
0f2b29511f
Allow admins to bypass the quarantine check on media downloads ( #19275 )
...
Co-authored-by: turt2live <1190097+turt2live@users.noreply.github.com >
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com >
2025-12-15 17:23:33 +00:00
Travis Ralston
3f636386a6
Add an Admin API endpoint for listing quarantined media ( #19268 )
...
Co-authored-by: turt2live <1190097+turt2live@users.noreply.github.com >
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com >
2025-12-12 13:30:21 +00:00
Shay
35c9cbb09d
Add an Admin API to query a piece of local or cached remote media by ID ( #18911 )
2025-09-23 16:25:56 -05:00
Will Hunt
02eed668b8
Document media hashing changes ( #18296 )
...
Essentially document the change in behaviour in #18277
### Pull Request Checklist
<!-- Please read
https://element-hq.github.io/synapse/latest/development/contributing_guide.html
before submitting your pull request -->
* [x] Pull request is based on the develop branch
* [x] Pull request includes a [changelog
file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog ).
The entry should:
- Be a short description of your change which makes sense to users.
"Fixed a bug that prevented receiving messages from other servers."
instead of "Moved X method from `EventStore` to `EventWorkerStore`.".
- Use markdown where necessary, mostly for `code blocks`.
- End with either a period (.) or an exclamation mark (!).
- Start with a capital letter.
- Feel free to credit yourself, by adding a sentence "Contributed by
@github_username." or "Contributed by [Your Name]." to the end of the
entry.
* [x] [Code
style](https://element-hq.github.io/synapse/latest/code_style.html ) is
correct
(run the
[linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters ))
2025-04-01 12:43:05 +02:00
Patrick Cloke
d22c1c862c
Respond correctly to unknown methods on known endpoints ( #14605 )
...
Respond with a 405 error if a request is received on a known endpoint,
but to an unknown method, per MSC3743.
2023-02-09 13:04:24 -05:00
reivilibre
4eb2f4e02b
Fix broken links in the Synapse documentation. ( #14744 )
...
* Fix stale external links
* Fix some internal links
* Fix URLs without trailing / where needed
* Fix more links
* Newsfile
Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org >
* Reapply docs/openid.md fix after conflict
Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org >
2023-01-05 18:18:00 +00:00
Andrew Morgan
409573f6d0
Fix reference to the wrong symbol in the media admin api docs ( #12715 )
2022-05-12 09:29:37 +01:00
Dirk Klimpel
65ef21b1c7
Clarify that users' media are also preview images ( #11862 )
2022-02-04 14:39:14 +00:00
Dirk Klimpel
0da2301b21
Consolidate the access_token information in the admin api ( #11861 )
...
Co-authored-by: reivilibre <olivier@librepush.net >
2022-01-31 16:24:29 +00:00
Dirk Klimpel
7eb198ddc8
Remove not needed old table of contents in documentation ( #11860 )
2022-01-31 14:40:20 +00:00
Aaron R
2c61a318cc
Show error when timestamp in seconds is provided to the /purge_media_cache API ( #11101 )
2021-10-20 14:41:48 +00:00
Dirk Klimpel
915b37e5ef
Admin API to delete media for a specific user ( #10558 )
2021-08-11 19:29:59 +00:00
Richard van der Hoff
189652b2fe
Fix a broken link in the admin api docs ( #10322 )
...
* Fix a broken link in the admin api docs
* Rename 10321.doc to 10321.docs
* Rename 10321.docs to 10322.doc
2021-07-07 12:54:57 +01:00
Dirk Klimpel
0adc2882c1
Fix broken links in documentation ( #10180 )
...
* Fix broken links in documentation
* newsfile
2021-06-16 13:15:52 +01:00
Andrew Morgan
fd9856e4a9
Compile and render Synapse's docs into a browsable, mobile-friendly and searchable website ( #10086 )
2021-06-03 17:20:40 +01:00
Dirk Klimpel
0284d2a297
Add new admin APIs to remove media by media ID from quarantine. ( #10044 )
...
Related to: #6681 , #5956 , #10040
Signed-off-by: Dirk Klimpel dirk@klimpel.org
2021-06-02 18:50:35 +01:00
Dirk Klimpel
65e6c64d83
Add an admin API for unprotecting local media from quarantine ( #10040 )
...
Signed-off-by: Dirk Klimpel dirk@klimpel.org
2021-05-26 11:19:47 +01:00
Andrew Morgan
e9df3f496b
Link to the List user's media admin API from media Admin API docs ( #9571 )
...
Earlier [I was convinced](https://github.com/matrix-org/synapse/issues/9565 ) that we didn't have an Admin API for listing media uploaded by a user. Foolishly I was looking under the Media Admin API documentation, instead of the User Admin API documentation.
I thought it'd be helpful to link to the latter so others don't hit the same dead end :)
2021-03-09 15:15:52 +00:00
Patrick Cloke
3e4cdfe5d9
Add an admin API endpoint to protect media. ( #9086 )
...
Protecting media stops it from being quarantined when
e.g. all media in a room is quarantined. This is useful
for sticker packs and other media that is uploaded by
server administrators, but used by many people.
2021-01-15 11:18:09 -05:00
Dirk Klimpel
43bf3c5178
Combine related media admin API docs ( #8839 )
...
Related: #8810
Also a few small improvements.
Signed-off-by: Dirk Klimpel dirk@klimpel.org
2020-12-09 16:19:57 +00:00
Dirk Klimpel
b08dc7effe
Clarify documentation of the admin list media API ( #8795 )
...
Clarify that the list media API only shows media from unencrypted events.
2020-11-24 09:04:51 -05:00
Dirk Klimpel
49d72dea2a
Add an admin api to delete local media. ( #8519 )
...
Related to: #6459 , #3479
Add `DELETE /_synapse/admin/v1/media/<server_name>/<media_id>` to delete
a single file from server.
2020-10-26 17:02:28 +00:00
Richard van der Hoff
1bc00fd76d
Clarifications to the admin api documentation ( #7647 )
...
* Clarify how to authenticate
* path params are not the same thing as query params
* Fix documentation for `/_synapse/admin/v2/users/<user_id>`
2020-06-05 17:31:05 +01:00
Andrew Morgan
1177d3f3a3
Quarantine media by ID or user ID ( #6681 )
2020-01-13 18:10:43 +00:00
Richard van der Hoff
620f98b65b
write some docs for the quarantine_media api ( #6458 )
2019-12-03 18:20:39 +00:00
Richard van der Hoff
8e9ca83537
Move admin API to a new prefix
2019-05-01 15:44:30 +01:00
Travis Ralston
3af53c183a
Add admin api documentation for list media endpoint
...
Signed-off-by: Travis Ralston <travpc@gmail.com >
2018-01-31 08:15:59 -07:00