summary refs log tree commit diff
path: root/docker/start.py
diff options
context:
space:
mode:
author*=0=1=4=* <21157384+f35f0ef9d0e827dae86552d3899f78fc@users.noreply.github.com>2019-04-25 08:47:22 -0500
committerRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2019-04-25 14:47:22 +0100
commit4a9a118a94748ce287741f207f2077c6595ff178 (patch)
treef346ac4797b26752808cb25b128a6c595e039868 /docker/start.py
parentConfig option for verifying federation certificates (MSC 1711) (#4967) (diff)
downloadsynapse-4a9a118a94748ce287741f207f2077c6595ff178.tar.xz
Fix handling of SYNAPSE_NO_TLS in docker image (#5005)
Diffstat (limited to 'docker/start.py')
-rwxr-xr-xdocker/start.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/docker/start.py b/docker/start.py
index 941d9996a8..2da555272a 100755
--- a/docker/start.py
+++ b/docker/start.py
@@ -59,6 +59,18 @@ else:
         if not os.path.exists("/compiled"): os.mkdir("/compiled")
 
         config_path = "/compiled/homeserver.yaml"
+        
+        # Convert SYNAPSE_NO_TLS to boolean if exists
+        if "SYNAPSE_NO_TLS" in environ:
+            tlsanswerstring = str.lower(environ["SYNAPSE_NO_TLS"])
+            if tlsanswerstring in ("true", "on", "1", "yes"):
+                environ["SYNAPSE_NO_TLS"] = True
+            else:
+                if tlsanswerstring in ("false", "off", "0", "no"):
+                    environ["SYNAPSE_NO_TLS"] = False
+                else:
+                    print("Environment variable \"SYNAPSE_NO_TLS\" found but value \"" + tlsanswerstring + "\" unrecognized; exiting.")
+                    sys.exit(2)
 
         convert("/conf/homeserver.yaml", config_path, environ)
         convert("/conf/log.config", "/compiled/log.config", environ)