diff options
author | Richard van der Hoff <richard@matrix.org> | 2019-06-21 13:46:39 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2019-06-24 14:15:34 +0100 |
commit | 3f8a252dd86fecff6cdda58043aaba7b79436e01 (patch) | |
tree | 43d2d1aae8587e180d7d7dd3df949fe18f43eeb0 /synapse/config/_base.py | |
parent | Add --data-directory commandline argument (diff) | |
download | synapse-3f8a252dd86fecff6cdda58043aaba7b79436e01.tar.xz |
Add "--open-private-ports" cmdline option
This is helpful when generating a config file for running synapse under docker.
Diffstat (limited to 'synapse/config/_base.py')
-rw-r--r-- | synapse/config/_base.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/synapse/config/_base.py b/synapse/config/_base.py index 8654b0f4a1..965478d8d5 100644 --- a/synapse/config/_base.py +++ b/synapse/config/_base.py @@ -150,6 +150,7 @@ class Config(object): server_name, generate_secrets=False, report_stats=None, + open_private_ports=False, ): """Build a default configuration file @@ -173,6 +174,9 @@ class Config(object): report_stats (bool|None): Initial setting for the report_stats setting. If None, report_stats will be left unset. + open_private_ports (bool): True to leave private ports (such as the non-TLS + HTTP listener) open to the internet. + Returns: str: the yaml config file """ @@ -185,6 +189,7 @@ class Config(object): server_name=server_name, generate_secrets=generate_secrets, report_stats=report_stats, + open_private_ports=open_private_ports, ) ) @@ -298,6 +303,14 @@ class Config(object): " stored. Defaults to the current working directory." ), ) + generate_group.add_argument( + "--open-private-ports", + action="store_true", + help=( + "Leave private ports (such as the non-TLS HTTP listener) open to the" + " internet. Do not use this unless you know what you are doing." + ), + ) config_args, remaining_args = config_parser.parse_known_args(argv) @@ -351,6 +364,7 @@ class Config(object): server_name=server_name, report_stats=(config_args.report_stats == "yes"), generate_secrets=True, + open_private_ports=config_args.open_private_ports, ) if not cls.path_exists(config_dir_path): |