Commit Graph

74 Commits

Author SHA1 Message Date
Erik Johnston 1f881e0746
Merge pull request #2791 from matrix-org/erikj/media_storage_refactor
Ensure media is in local cache before thumbnailing
2018-02-05 11:28:52 +00:00
Matthew Hodgson ab9f844aaf
Add federation_domain_whitelist option (#2820)
Add federation_domain_whitelist

gives a way to restrict which domains your HS is allowed to federate with.
useful mainly for gracefully preventing a private but internet-connected HS from trying to federate to the wider public Matrix network
2018-01-22 19:11:18 +01:00
Erik Johnston 8ff6726c0d
Merge pull request #2812 from matrix-org/erikj/media_storage_provider_config
Make storage providers configurable
2018-01-18 18:33:57 +00:00
Erik Johnston 0af5dc63a8 Make storage providers more configurable 2018-01-18 14:07:21 +00:00
Erik Johnston 4a53f3a3e8 Ensure media is in local cache before thumbnailing 2018-01-18 12:00:46 +00:00
Erik Johnston 05f98a2224 Keep track of last access time for local media 2018-01-17 10:24:43 +00:00
Erik Johnston d728c47142 Add docstring 2018-01-17 10:06:14 +00:00
Erik Johnston d863f68cab Use local vars 2018-01-16 16:24:15 +00:00
Erik Johnston 6368e5c0ab Change _generate_thumbnails to take media_type 2018-01-16 16:17:38 +00:00
Erik Johnston 0a90d9ede4 Move setting of file_id up to caller 2018-01-16 16:03:05 +00:00
Erik Johnston 307f88dfb6 Fix up log lines 2018-01-16 13:53:52 +00:00
Erik Johnston 9795b9ebb1 Correctly use server_name/file_id when generating/fetching remote thumbnails 2018-01-16 12:02:06 +00:00
Erik Johnston c5b589f2e8 Log when we respond with 404 2018-01-16 12:01:40 +00:00
Erik Johnston a4c5e4a645 Fix thumbnailing remote files 2018-01-16 11:37:50 +00:00
Erik Johnston 694f1c1b18 Fix up comments 2018-01-12 15:02:46 +00:00
Erik Johnston 1e4edd1717 Remove unnecessary condition 2018-01-12 11:28:32 +00:00
Erik Johnston 4d88958cf6 Make class var local 2018-01-12 11:23:54 +00:00
Erik Johnston 227c491510 Comments 2018-01-12 11:22:41 +00:00
Erik Johnston 8f03aa9f61 Add StorageProvider concept 2018-01-09 16:16:12 +00:00
Erik Johnston 2442e9876c Make PreviewUrlResource use MediaStorage 2018-01-09 16:15:07 +00:00
Erik Johnston 9d30a7691c Make ThumbnailResource use MediaStorage 2018-01-09 16:15:07 +00:00
Erik Johnston 9e20840e02 Use MediaStorage for remote media 2018-01-09 16:15:07 +00:00
Erik Johnston dd3092c3a3 Use MediaStorage for local files 2018-01-09 16:15:07 +00:00
Richard van der Hoff eaaabc6c4f replace 'except:' with 'except Exception:'
what could possibly go wrong
2017-10-23 15:52:32 +01:00
Erik Johnston bd5718d0ad Fix typo in thumbnail generation 2017-10-19 10:27:18 +01:00
Krombel a6245478c8 fix thumbnailing (#2548)
in commit 0e28281a the code for thumbnailing got refactored and the
renaming of this variables was not done correctly.

Signed-Off-by: Matthias Kesler <krombel@krombel.de>
2017-10-17 12:45:33 +02:00
Erik Johnston 1b6b0b1e66 Add try/finally block to close t_byte_source 2017-10-13 15:34:08 +01:00
Erik Johnston 6b725cf56a Remove old comment 2017-10-13 15:23:41 +01:00
Erik Johnston 2b24416e90 Don't reuse source but instead copy from primary media store to backup 2017-10-13 14:11:34 +01:00
Erik Johnston b92a8e6e4a PEP8 2017-10-13 13:58:57 +01:00
Erik Johnston 31aa7bd8d1 Move type into key 2017-10-13 13:47:38 +01:00
Erik Johnston ad1911bbf4 Comment 2017-10-13 13:47:05 +01:00
Erik Johnston c021c39cbd Remove spurious addition 2017-10-13 13:46:53 +01:00
Erik Johnston 4d7e1dde70 Remove unnecessary diff 2017-10-13 11:36:32 +01:00
Erik Johnston 9732ec6797 s/write_to_file/write_to_file_and_backup/ 2017-10-13 11:34:41 +01:00
Erik Johnston 0e28281a02 Fix up 2017-10-13 11:33:49 +01:00
Erik Johnston 505371414f Fix up thumbnailing function 2017-10-13 11:23:53 +01:00
Erik Johnston e3428d26ca Fix typo 2017-10-13 10:39:59 +01:00
Erik Johnston 35332298ef Fix up comments 2017-10-13 10:39:32 +01:00
Erik Johnston 64db043a71 Move makedirs to thread 2017-10-13 10:25:01 +01:00
Erik Johnston b60859d6cc Use make_deferred_yieldable 2017-10-13 10:24:19 +01:00
Erik Johnston 4ae85ae121 Don't close prematurely.. 2017-10-12 17:57:31 +01:00
Erik Johnston cc505b4b5e getvalue closes buffer 2017-10-12 17:52:30 +01:00
Erik Johnston 1259a76047 Get len before close 2017-10-12 17:39:23 +01:00
Erik Johnston 802ca12d05 Don't close file prematurely 2017-10-12 17:37:21 +01:00
Erik Johnston e283b555b1 Copy everything to backup 2017-10-12 17:31:24 +01:00
Erik Johnston b77a13812c Typo 2017-10-12 15:32:32 +01:00
Erik Johnston 6dfde6d485 Remove dead code 2017-10-12 15:30:26 +01:00
Erik Johnston c8eeef6947 Fix typos 2017-10-12 15:28:24 +01:00
Erik Johnston 67cb89fbdf Fix typo 2017-10-12 15:23:41 +01:00