summary refs log tree commit diff
path: root/synapse/media (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Support MSC3916 by adding a federation `/download` endpoint" (#17325)Andrew Morgan2024-06-184-326/+18
|
* Support MSC3916 by adding a federation `/download` endpoint (#17172)Shay2024-06-074-18/+326
|
* Ratelimiting of remote media downloads (#17256)Shay2024-06-052-7/+42
|
* Ensure we delete media if we reject due to spam check (#17246)Erik Johnston2024-05-302-32/+32
| | | | | | | | Fixes up #17239 We need to keep the spam check within the `try/except` block. Also makes it so that we don't enter the top span twice. Also also ensures that we get the right thumbnail length.
* Fix slipped logging context when media rejected (#17239)Erik Johnston2024-05-293-77/+40
| | | | | | | When a module rejects a piece of media we end up trying to close the same logging context twice. Instead of fixing the existing code we refactor to use an async context manager, which is easier to write correctly.
* Support MSC3916 by adding unstable media endpoints to `_matrix/client` (#17213)Shay2024-05-241-1/+485
| | | | | | | | | | [MSC3916](https://github.com/matrix-org/matrix-spec-proposals/blob/rav/authentication-for-media/proposals/3916-authentication-for-media.md) adds new media endpoints under `_matrix/client`. This PR adds the `/preview_url`, `/config`, and `/thumbnail` endpoints. `/download` will be added in a follow-up PR once the work for the federation `/download` endpoint is complete (see https://github.com/element-hq/synapse/pull/17172). Should be reviewable commit-by-commit.
* Bump black from 23.10.1 to 24.2.0 (#16936)dependabot[bot]2024-03-131-3/+3
|
* Bump lxml-stubs from 0.4.0 to 0.5.1 (#16885)dependabot[bot]2024-02-062-5/+3
|
* Correctly mention previous copyright (#16820)Erik Johnston2024-01-239-0/+14
| | | | | During the migration the automated script to update the copyright headers accidentally got rid of some of the existing copyright lines. Reinstate them.
* Merge remote-tracking branch 'gitlab/clokep/license-license' into new_developErik Johnston2023-12-139-95/+144
|\
| * Update license headersPatrick Cloke2023-11-219-95/+144
| |
* | Request & follow redirects for /media/v3/download (#16701)Patrick Cloke2023-11-291-13/+4
|/ | | | | | Implement MSC3860 to follow redirects for federated media downloads. Note that the Client-Server API doesn't support this (yet) since the media repository in Synapse doesn't have a way of supporting redirects.
* Asynchronous Uploads (#15503)Sumner Evans2023-11-152-14/+212
| | | Support asynchronous uploads as defined in MSC2246.
* Return attrs for more media repo APIs. (#16611)Patrick Cloke2023-11-092-36/+45
|
* Remove more usages of cursor_to_dict. (#16551)Patrick Cloke2023-10-261-4/+1
| | | Mostly to improve type safety.
* Handle content types with parameters. (#16440)Patrick Cloke2023-10-111-1/+3
|
* Return ThumbnailInfo in more places (#16438)Patrick Cloke2023-10-062-1/+4
| | | | Improves type hints by using concrete types instead of dictionaries.
* Register media servlets via regex. (#16419)Patrick Cloke2023-10-062-45/+13
| | | | | This converts the media servlet URLs in the same way as (most) of the rest of Synapse. This will give more flexibility in the versions each endpoint exists under.
* Support rendering some media downloads as inline (#15988)Will Hunt2023-09-291-2/+40
| | | | | Use an `inline` Content-Disposition header when the media is "safe" to display inline (some known text, image, video, audio formats).
* Update ruff config (#16283)Patrick Cloke2023-09-081-3/+1
| | | Enable additional checks & clean-up unneeded configuration.
* Gracefully handle failing to thumbnail images (#16211)Erik Johnston2023-08-301-1/+4
|
* Bump ruff from 0.0.277 to 0.0.286 (#16198)dependabot[bot]2023-08-292-2/+2
| | | | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Make the media `/upload` tracing less ambiguous (#15888)Eric Eastwood2023-07-102-42/+61
| | | | | | | | | | A lot of the functions have the same name in this space like `store_file`, and we also do it multiple times for different reasons (main media repo, other storage providers, thumbnails, etc) so it's good to differentiate them so your head doesn't explode. Follow-up to https://github.com/matrix-org/synapse/pull/15850 Tracing instrumentation to media `/upload` code paths to investigate https://github.com/matrix-org/synapse/issues/15841
* Add tracing to media `/upload` endpoint (#15850)Eric Eastwood2023-07-054-0/+20
| | | Add tracing instrumentation to media `/upload` code paths to investigate https://github.com/matrix-org/synapse/issues/15841
* use Image.LANCZOS instead of Image.ANTIALIAS for thumbnail resize (#15876)an0nfunc2023-07-051-1/+1
| | | | | Image.ANTIALIAS is not defined in current pillow releases. Since ANTIALIAS was just using LANCZOS anyways, this is just a cosmetic change, but makes synapse work with most recent pillow releases. Signed-off-by: Giovanni Harting <539@idlegandalf.com>
* Fix unsafe hotserving behaviour for non-multimedia uploads. (#15680)Josh Qou2023-06-151-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix unsafe hotserving behaviour for non-multimedia uploads. * invert disposition assert * test_media_storage.py: run lint * test_base.py: /inline/attachment/s * Only return attachment for disposition type, update tests * Update synapse/media/_base.py Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> * Update changelog.d/15680.bugfix Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> * add attribution * Update changelog. --------- Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
* Add stubs package for lxml. (#15697)Patrick Cloke2023-05-312-36/+75
| | | | | | | The stubs have some issues so this has some generous cast and ignores in it, but it is better than not having stubs. Note that confusing that Element is a function which creates _Element instances (and similarly for Comment).
* Rename blacklist/whitelist internally. (#15620)Patrick Cloke2023-05-191-8/+8
| | | | Avoid renaming configuration settings for now and rename internal code to use blocklist and allowlist instead.
* Apply url_preview_url_blacklist to oEmbed and pre-cached images (#15601)Patrick Cloke2023-05-161-46/+75
| | | | | | | | There are two situations which were previously not properly checked: 1. If the requested URL was replaced with an oEmbed URL, then the oEmbed URL was not checked against url_preview_url_blacklist. 2. Follow-up URLs (either via autodiscovery of oEmbed or to pre-cache images) were not checked against url_preview_url_blacklist.
* Add config option to prevent media downloads from listed domains. (#15197)Travis Ralston2023-05-091-0/+9
| | | | | | | This stops media (and thumbnails) from being accessed from the listed domains. It does not delete any already locally cached media, but will prevent accessing it. Note that admin APIs are unaffected by this change.
* Move Spam Checker callbacks to a dedicated file (#15453)Andrew Morgan2023-04-181-4/+3
|
* Separate HTTP preview code and URL previewer. (#15269)Patrick Cloke2023-03-201-0/+833
| | | Separates REST layer code from the actual URL previewing.
* Refactor media modules. (#15146)Patrick Cloke2023-02-278-0/+3469
| | | | | | | * Removes the `v1` directory from `test.rest.media.v1`. * Moves the non-REST code from `synapse.rest.media.v1` to `synapse.media`. * Flatten the `v1` directory from `synapse.rest.media`, but leave compatiblity with 3rd party media repositories and spam checkers.
* Move rest APIs back under the rest directoryMark Haines2015-01-2211-1248/+0
|
* make our JPEG thumbnail quality less horrifically uglyMatthew Hodgson2015-01-081-1/+1
|
* Change error message for missing pillow libs.Kegan Dougal2015-01-071-2/+4
|
* Merge branch 'master' into developMark Haines2015-01-061-0/+1
|\
| * Return the argument passed to the callback in a deferred callback, otherwise ↵Mark Haines2014-12-291-0/+1
| | | | | | | | twisted will replace the deferred result with 'None'
* | SYN-32 Use the ANTIALIAS resize method for thumbnailing imagesMark Haines2015-01-061-3/+3
| |
* | Update copyright noticesMark Haines2015-01-069-9/+23
| |
* | SYN-208/SYN-228: Add runtime checks on startup to enforce that JPEG/PNG ↵Kegan Dougal2015-01-061-0/+29
| | | | | | | | support is included when installing pillow.
* | SYN-229: Include Content-Length when downloading filesMark Haines2015-01-063-7/+23
|/
* SYN-203: Handle requests for thunbnails for images that are smallMark Haines2014-12-191-5/+14
|
* clean up coding style a bitMark Haines2014-12-161-0/+1
|
* Update media_repository.pyKegsay2014-12-151-1/+1
| | | _ not -
* Update docs in media_repositoryMark Haines2014-12-151-2/+2
|
* return an mxc uri rather than a content_token.Mark Haines2014-12-151-1/+3
|
* Fix typo in media repository doc stringMark Haines2014-12-111-1/+1
|
* Fix media repository doc string to include server_nameMark Haines2014-12-111-3/+3
|
* Allow only one download for a given image at a time, so that we don't end up ↵Mark Haines2014-12-113-20/+29
| | | | downloading the same image twice if two clients request a remote image at the same time
* Limit the size of images that are thumbnailed serverside. Limit the size of ↵Mark Haines2014-12-111-0/+18
| | | | file that a server will download from a remote server
* doc the thumbnail methodsMark Haines2014-12-111-2/+11
|
* Make sure we pass a tuple to string '%' formattingMark Haines2014-12-111-2/+2
|
* import Image as PIL.Image.Mark Haines2014-12-101-1/+1
|
* Get the code actually workingMark Haines2014-12-105-46/+53
|
* Thumbnail uploaded and cached imagesMark Haines2014-12-106-169/+581
|
* Add a class for generating thumbnails using PILMark Haines2014-12-051-0/+78
|
* Implement download support for media_repositoryMark Haines2014-12-043-4/+203
|
* Fix pyflakes and pep8 warningsMark Haines2014-12-022-1/+3
|
* Get uploads working with new media repoMark Haines2014-12-026-23/+16
|
* Write the upload portion of version 1 of the media repositoryMark Haines2014-12-024-0/+447