summary refs log tree commit diff
path: root/synapse/config
diff options
context:
space:
mode:
authorAndrew Morgan <1342360+anoadragon453@users.noreply.github.com>2019-01-29 20:08:18 +0000
committerGitHub <noreply@github.com>2019-01-29 20:08:18 +0000
commit03b086647f3ccdcf1fdeb54ac19677e89a63e1d1 (patch)
tree940faaa9003333801c853cdce055fb14b7a20d98 /synapse/config
parentRelax requirement for a content-type on .well-known (#4511) (diff)
parentAdd changelog (diff)
downloadsynapse-03b086647f3ccdcf1fdeb54ac19677e89a63e1d1.tar.xz
Merge pull request #4512 from matrix-org/anoa/consent_dir
Check consent dir path on startup
Diffstat (limited to 'synapse/config')
-rw-r--r--synapse/config/consent_config.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/synapse/config/consent_config.py b/synapse/config/consent_config.py
index f193a090ae..9f2e85342f 100644
--- a/synapse/config/consent_config.py
+++ b/synapse/config/consent_config.py
@@ -13,6 +13,10 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+from os import path
+
+from synapse.config import ConfigError
+
 from ._base import Config
 
 DEFAULT_CONFIG = """\
@@ -85,7 +89,15 @@ class ConsentConfig(Config):
         if consent_config is None:
             return
         self.user_consent_version = str(consent_config["version"])
-        self.user_consent_template_dir = consent_config["template_dir"]
+        self.user_consent_template_dir = self.abspath(
+            consent_config["template_dir"]
+        )
+        if not path.isdir(self.user_consent_template_dir):
+            raise ConfigError(
+                "Could not find template directory '%s'" % (
+                    self.user_consent_template_dir,
+                ),
+            )
         self.user_consent_server_notice_content = consent_config.get(
             "server_notice_content",
         )