summary refs log tree commit diff
path: root/docker/start.py
diff options
context:
space:
mode:
authorMichael Kaye <1917473+michaelkaye@users.noreply.github.com>2019-09-19 22:29:47 +0100
committerRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2019-09-19 22:29:47 +0100
commit2def5ea0da4b8134384adcd48e1e312f2f7e65c9 (patch)
treef3c0e1f6e893a60fc63e4a51a6765a001a16f1b5 /docker/start.py
parentUse unstable prefix for 3PID unbind API (#6062) (diff)
downloadsynapse-2def5ea0da4b8134384adcd48e1e312f2f7e65c9.tar.xz
Docker: support SYNAPSE_WORKER envvar (#6058)
* Allow passing SYNAPSE_WORKER envvar

* changelog.d

* Document SYNAPSE_WORKER.

Attempting to imply that you don't need to change this default
unless you're in worker mode.

Also aware that there's a bigger problem of attempting to document
a complete working configuration of workers using docker, as we
currently only document to use `synctl` for worker mode, and synctl
doesn't work that way in docker.
Diffstat (limited to 'docker/start.py')
-rwxr-xr-xdocker/start.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/docker/start.py b/docker/start.py
index 260f2d9943..e41ea20e70 100755
--- a/docker/start.py
+++ b/docker/start.py
@@ -182,6 +182,7 @@ def main(args, environ):
     mode = args[1] if len(args) > 1 else None
     desired_uid = int(environ.get("UID", "991"))
     desired_gid = int(environ.get("GID", "991"))
+    synapse_worker = environ.get("SYNAPSE_WORKER", "synapse.app.homeserver")
     if (desired_uid == os.getuid()) and (desired_gid == os.getgid()):
         ownership = None
     else:
@@ -245,7 +246,7 @@ def main(args, environ):
 
     log("Starting synapse with config file " + config_path)
 
-    args = ["python", "-m", "synapse.app.homeserver", "--config-path", config_path]
+    args = ["python", "-m", synapse_worker, "--config-path", config_path]
     if ownership is not None:
         args = ["su-exec", ownership] + args
         os.execv("/sbin/su-exec", args)