mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:26:09 -04:00
Limit the size of images that are thumbnailed serverside. Limit the size of file that a server will download from a remote server
This commit is contained in:
parent
ead8fc5e38
commit
d80d505b1f
4 changed files with 43 additions and 6 deletions
|
@ -20,6 +20,7 @@ class ContentRepositoryConfig(Config):
|
|||
def __init__(self, args):
|
||||
super(ContentRepositoryConfig, self).__init__(args)
|
||||
self.max_upload_size = self.parse_size(args.max_upload_size)
|
||||
self.max_image_pixels = self.parse_size(args.max_image_pixels)
|
||||
self.media_store_path = self.ensure_directory(args.media_store_path)
|
||||
|
||||
def parse_size(self, string):
|
||||
|
@ -41,3 +42,7 @@ class ContentRepositoryConfig(Config):
|
|||
db_group.add_argument(
|
||||
"--media-store-path", default=cls.default_path("media_store")
|
||||
)
|
||||
db_group.add_argument(
|
||||
"--max-image-pixels", default="32M",
|
||||
help="Maximum number of pixels that will be thumbnailed"
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue