Use 0.0.0.0 by default for server host. Fixes https://github.com/GNS3/gns3-server/issues/1663

pull/1681/head
grossmj 5 years ago
parent 1b845225b2
commit 9d47050dff

@ -116,7 +116,7 @@ def parse_arguments(argv):
config = Config.instance().get_section_config("Server") config = Config.instance().get_section_config("Server")
defaults = { defaults = {
"host": config.get("host", "localhost"), "host": config.get("host", "0.0.0.0"),
"port": config.get("port", 3080), "port": config.get("port", 3080),
"ssl": config.getboolean("ssl", False), "ssl": config.getboolean("ssl", False),
"certfile": config.get("certfile", ""), "certfile": config.get("certfile", ""),

@ -118,7 +118,7 @@ class Route(object):
if not user: if not user:
log.error("HTTP authentication is enabled but no username is configured") log.error("HTTP authentication is enabled but no username is configured")
else: else:
log.error("Invalid authentication for username '{}'".format(user)) log.error("Invalid HTTP authentication for username '{}'".format(user))
response = Response(request=request, route=route) response = Response(request=request, route=route)
response.set_status(401) response.set_status(401)

@ -71,7 +71,7 @@ def test_parse_arguments(capsys, tmpdir):
assert "optional arguments" in out assert "optional arguments" in out
assert run.parse_arguments(["--host", "192.168.1.1"]).host == "192.168.1.1" assert run.parse_arguments(["--host", "192.168.1.1"]).host == "192.168.1.1"
assert run.parse_arguments([]).host == "localhost" assert run.parse_arguments([]).host == "0.0.0.0"
server_config["host"] = "192.168.1.2" server_config["host"] = "192.168.1.2"
assert run.parse_arguments(["--host", "192.168.1.1"]).host == "192.168.1.1" assert run.parse_arguments(["--host", "192.168.1.1"]).host == "192.168.1.1"
assert run.parse_arguments([]).host == "192.168.1.2" assert run.parse_arguments([]).host == "192.168.1.2"

Loading…
Cancel
Save