summary refs log tree commit diff
path: root/synapse/config
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-10-12 15:20:59 +0100
committerErik Johnston <erik@matrix.org>2017-10-12 15:20:59 +0100
commitbf4fb1fb400daad23702bc0b3231ec069d68e87e (patch)
treed5ec655d0abb781bfe968c3d1ba218f3b4922253 /synapse/config
parentlog when we get an exception handling replication updates (diff)
downloadsynapse-bf4fb1fb400daad23702bc0b3231ec069d68e87e.tar.xz
Basic implementation of backup media store
Diffstat (limited to 'synapse/config')
-rw-r--r--synapse/config/repository.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/synapse/config/repository.py b/synapse/config/repository.py
index 2c6f57168e..e3c83d56fa 100644
--- a/synapse/config/repository.py
+++ b/synapse/config/repository.py
@@ -70,7 +70,17 @@ class ContentRepositoryConfig(Config):
         self.max_upload_size = self.parse_size(config["max_upload_size"])
         self.max_image_pixels = self.parse_size(config["max_image_pixels"])
         self.max_spider_size = self.parse_size(config["max_spider_size"])
+
         self.media_store_path = self.ensure_directory(config["media_store_path"])
+
+        self.backup_media_store_path = config.get("backup_media_store_path")
+        if self.backup_media_store_path:
+            self.ensure_directory(self.backup_media_store_path)
+
+        self.synchronous_backup_media_store = config.get(
+            "synchronous_backup_media_store", False
+        )
+
         self.uploads_path = self.ensure_directory(config["uploads_path"])
         self.dynamic_thumbnails = config["dynamic_thumbnails"]
         self.thumbnail_requirements = parse_thumbnail_requirements(
@@ -115,6 +125,14 @@ class ContentRepositoryConfig(Config):
         # Directory where uploaded images and attachments are stored.
         media_store_path: "%(media_store)s"
 
+        # A secondary directory where uploaded images and attachments are
+        # stored as a backup.
+        # backup_media_store_path: "%(media_store)s"
+
+        # Whether to wait for successful write to backup media store before
+        # returning successfully.
+        # synchronous_backup_media_store: false
+
         # Directory where in-progress uploads are stored.
         uploads_path: "%(uploads_path)s"