summary refs log tree commit diff
path: root/synapse/config/repository.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2017-10-13 16:11:31 +0100
committerGitHub <noreply@github.com>2017-10-13 16:11:31 +0100
commitdb3d84f46c69a22ba5e9dc80c3717eade80b3638 (patch)
tree980fee53a8dfdc689ae7c3c37c5c3e34f9ddfdb8 /synapse/config/repository.py
parentoops (diff)
parentAdd try/finally block to close t_byte_source (diff)
downloadsynapse-db3d84f46c69a22ba5e9dc80c3717eade80b3638.tar.xz
Merge pull request #2538 from matrix-org/erikj/media_backup
 Basic implementation of backup media store
Diffstat (limited to 'synapse/config/repository.py')
-rw-r--r--synapse/config/repository.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/synapse/config/repository.py b/synapse/config/repository.py
index 2c6f57168e..6baa474931 100644
--- a/synapse/config/repository.py
+++ b/synapse/config/repository.py
@@ -70,7 +70,19 @@ 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.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 +127,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"