mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-20 19:10:45 +03:00
no media repo == no path checks
This commit is contained in:
parent
25256f958b
commit
1d5cf66958
1 changed files with 8 additions and 2 deletions
|
@ -107,11 +107,18 @@ def parse_thumbnail_requirements(thumbnail_sizes):
|
||||||
|
|
||||||
class ContentRepositoryConfig(Config):
|
class ContentRepositoryConfig(Config):
|
||||||
def read_config(self, config):
|
def read_config(self, config):
|
||||||
|
self.enable_media_repo = config.get("enable_media_repo", True)
|
||||||
|
|
||||||
self.max_upload_size = self.parse_size(config.get("max_upload_size", "10M"))
|
self.max_upload_size = self.parse_size(config.get("max_upload_size", "10M"))
|
||||||
self.max_image_pixels = self.parse_size(config.get("max_image_pixels", "32M"))
|
self.max_image_pixels = self.parse_size(config.get("max_image_pixels", "32M"))
|
||||||
self.max_spider_size = self.parse_size(config.get("max_spider_size", "10M"))
|
self.max_spider_size = self.parse_size(config.get("max_spider_size", "10M"))
|
||||||
|
|
||||||
|
if self.enable_media_repo:
|
||||||
self.media_store_path = self.ensure_directory(config["media_store_path"])
|
self.media_store_path = self.ensure_directory(config["media_store_path"])
|
||||||
|
self.uploads_path = self.ensure_directory(config["uploads_path"])
|
||||||
|
else:
|
||||||
|
self.media_store_path = None
|
||||||
|
self.uploads_path = None
|
||||||
|
|
||||||
backup_media_store_path = config.get("backup_media_store_path")
|
backup_media_store_path = config.get("backup_media_store_path")
|
||||||
|
|
||||||
|
@ -168,7 +175,6 @@ class ContentRepositoryConfig(Config):
|
||||||
(provider_class, parsed_config, wrapper_config,)
|
(provider_class, parsed_config, wrapper_config,)
|
||||||
)
|
)
|
||||||
|
|
||||||
self.uploads_path = self.ensure_directory(config["uploads_path"])
|
|
||||||
self.dynamic_thumbnails = config.get("dynamic_thumbnails", False)
|
self.dynamic_thumbnails = config.get("dynamic_thumbnails", False)
|
||||||
self.thumbnail_requirements = parse_thumbnail_requirements(
|
self.thumbnail_requirements = parse_thumbnail_requirements(
|
||||||
config.get("thumbnail_sizes", DEFAULT_THUMBNAIL_SIZES),
|
config.get("thumbnail_sizes", DEFAULT_THUMBNAIL_SIZES),
|
||||||
|
|
Loading…
Reference in a new issue