summary refs log tree commit diff
path: root/synapse/media (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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