diff options
author | Andrew Morgan <andrew@amorgan.xyz> | 2020-04-13 14:02:34 +0100 |
---|---|---|
committer | Andrew Morgan <andrew@amorgan.xyz> | 2020-04-13 14:02:34 +0100 |
commit | ff195965ce1c83611e4b81bf0571b881ac506cc8 (patch) | |
tree | c6504391661bc61ab6f1073f487eb83a4da28c5d | |
parent | typos (diff) | |
download | synapse-github/anoa/unsecure_port.tar.xz |
Unsecure -> insecure github/anoa/unsecure_port anoa/unsecure_port
-rw-r--r-- | synapse/config/server.py | 36 | ||||
-rw-r--r-- | tests/config/test_server.py | 4 |
2 files changed, 20 insertions, 20 deletions
diff --git a/synapse/config/server.py b/synapse/config/server.py index 28e2a031fb..627a9a8dcc 100644 --- a/synapse/config/server.py +++ b/synapse/config/server.py @@ -459,11 +459,11 @@ class ServerConfig(Config): } ) - unsecure_port = config.get("unsecure_port", bind_port - 400) - if unsecure_port: + insecure_port = config.get("insecure_port", bind_port - 400) + if insecure_port: self.listeners.append( { - "port": unsecure_port, + "port": insecure_port, "bind_addresses": [bind_host], "tls": False, "type": "http", @@ -515,10 +515,10 @@ class ServerConfig(Config): ): _, bind_port = parse_and_validate_server_name(server_name) if bind_port is not None: - unsecure_port = bind_port - 400 + insecure_port = bind_port - 400 else: bind_port = 8448 - unsecure_port = 8008 + insecure_port = 8008 pid_file = os.path.join(data_dir_path, "homeserver.pid") @@ -526,7 +526,7 @@ class ServerConfig(Config): # default config string default_room_version = DEFAULT_ROOM_VERSION secure_listeners = [] - unsecure_listeners = [] + insecure_listeners = [] private_addresses = ["::1", "127.0.0.1"] if listeners: for listener in listeners: @@ -541,19 +541,19 @@ class ServerConfig(Config): if not open_private_ports: listener.setdefault("bind_addresses", private_addresses) - unsecure_listeners.append(listener) + insecure_listeners.append(listener) secure_http_bindings = indent( yaml.dump(secure_listeners), " " * 10 ).lstrip() - unsecure_http_bindings = indent( - yaml.dump(unsecure_listeners), " " * 10 + insecure_http_bindings = indent( + yaml.dump(insecure_listeners), " " * 10 ).lstrip() - if not unsecure_listeners: - unsecure_http_bindings = ( - """- port: %(unsecure_port)s + if not insecure_listeners: + insecure_http_bindings = ( + """- port: %(insecure_port)s tls: false type: http x_forwarded: true""" @@ -561,11 +561,11 @@ class ServerConfig(Config): ) if not open_private_ports: - unsecure_http_bindings += ( + insecure_http_bindings += ( "\n bind_addresses: ['::1', '127.0.0.1']" ) - unsecure_http_bindings += """ + insecure_http_bindings += """ resources: - names: [client, federation] @@ -573,10 +573,10 @@ class ServerConfig(Config): if listeners: # comment out this block - unsecure_http_bindings = "#" + re.sub( + insecure_http_bindings = "#" + re.sub( "\n {10}", lambda match: match.group(0) + "#", - unsecure_http_bindings, + insecure_http_bindings, ) if not secure_listeners: @@ -790,13 +790,13 @@ class ServerConfig(Config): # %(secure_http_bindings)s - # Unsecure HTTP listener: for when matrix traffic passes through a reverse proxy + # Insecure HTTP listener: for when matrix traffic passes through a reverse proxy # that unwraps TLS. # # If you plan to use a reverse proxy, please see # https://github.com/matrix-org/synapse/blob/master/docs/reverse_proxy.md. # - %(unsecure_http_bindings)s + %(insecure_http_bindings)s # example additional_resources: # diff --git a/tests/config/test_server.py b/tests/config/test_server.py index a10d017120..4b03b806da 100644 --- a/tests/config/test_server.py +++ b/tests/config/test_server.py @@ -32,7 +32,7 @@ class ServerConfigTestCase(unittest.TestCase): self.assertFalse(is_threepid_reserved(config, user3)) self.assertFalse(is_threepid_reserved(config, user1_msisdn)) - def test_unsecure_listener_no_listeners_open_private_ports_false(self): + def test_insecure_listener_no_listeners_open_private_ports_false(self): conf = yaml.safe_load( ServerConfig().generate_config_section( "che.org", "/data_dir_path", False, None @@ -52,7 +52,7 @@ class ServerConfigTestCase(unittest.TestCase): self.assertEqual(conf["listeners"], expected_listeners) - def test_unsecure_listener_no_listeners_open_private_ports_true(self): + def test_insecure_listener_no_listeners_open_private_ports_true(self): conf = yaml.safe_load( ServerConfig().generate_config_section( "che.org", "/data_dir_path", True, None |