mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Fix handling of SYNAPSE_NO_TLS in docker image (#5005)
This commit is contained in:
parent
6824ddd93d
commit
4a9a118a94
1
changelog.d/5005.misc
Normal file
1
changelog.d/5005.misc
Normal file
@ -0,0 +1 @@
|
|||||||
|
Convert SYNAPSE_NO_TLS Docker variable to boolean for user friendliness. Contributed by Gabriel Eckerson.
|
@ -102,8 +102,9 @@ when ``SYNAPSE_CONFIG_PATH`` is not set.
|
|||||||
* ``SYNAPSE_SERVER_NAME`` (mandatory), the server public hostname.
|
* ``SYNAPSE_SERVER_NAME`` (mandatory), the server public hostname.
|
||||||
* ``SYNAPSE_REPORT_STATS``, (mandatory, ``yes`` or ``no``), enable anonymous
|
* ``SYNAPSE_REPORT_STATS``, (mandatory, ``yes`` or ``no``), enable anonymous
|
||||||
statistics reporting back to the Matrix project which helps us to get funding.
|
statistics reporting back to the Matrix project which helps us to get funding.
|
||||||
* ``SYNAPSE_NO_TLS``, set this variable to disable TLS in Synapse (use this if
|
* `SYNAPSE_NO_TLS`, (accepts `true`, `false`, `on`, `off`, `1`, `0`, `yes`, `no`]): disable
|
||||||
you run your own TLS-capable reverse proxy).
|
TLS in Synapse (use this if you run your own TLS-capable reverse proxy). Defaults
|
||||||
|
to `false` (ie, TLS is enabled by default).
|
||||||
* ``SYNAPSE_ENABLE_REGISTRATION``, set this variable to enable registration on
|
* ``SYNAPSE_ENABLE_REGISTRATION``, set this variable to enable registration on
|
||||||
the Synapse instance.
|
the Synapse instance.
|
||||||
* ``SYNAPSE_ALLOW_GUEST``, set this variable to allow guest joining this server.
|
* ``SYNAPSE_ALLOW_GUEST``, set this variable to allow guest joining this server.
|
||||||
|
@ -59,6 +59,18 @@ else:
|
|||||||
if not os.path.exists("/compiled"): os.mkdir("/compiled")
|
if not os.path.exists("/compiled"): os.mkdir("/compiled")
|
||||||
|
|
||||||
config_path = "/compiled/homeserver.yaml"
|
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/homeserver.yaml", config_path, environ)
|
||||||
convert("/conf/log.config", "/compiled/log.config", environ)
|
convert("/conf/log.config", "/compiled/log.config", environ)
|
||||||
|
Loading…
Reference in New Issue
Block a user