diff options
author | Magnus Ahltorp <map@kth.se> | 2015-03-30 15:41:13 +0200 |
---|---|---|
committer | Magnus Ahltorp <map@kth.se> | 2015-03-30 15:42:40 +0200 |
commit | 63bb7bbdad8c7b21630cedaea2f2b82aa62fd59d (patch) | |
tree | cc3558bdf36b55b289448d9707dde87321be3cb1 /tools | |
parent | 2d8d55bb9b6672ebe829b185beb05d4a399167f5 (diff) |
Allow non-TLS httpnopublicssl
Closes CATLFISH-31
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/compileconfig.py | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/tools/compileconfig.py b/tools/compileconfig.py index 88d6b51..f3e858b 100755 --- a/tools/compileconfig.py +++ b/tools/compileconfig.py @@ -77,7 +77,7 @@ def get_node_config(nodename, config): sys.exit(1) return (nodetype, nodeconfig) -def gen_https_servers(nodetype, nodeconfig, bind_address, bind_publicaddress): +def gen_http_servers(nodetype, nodeconfig, bind_address, bind_publicaddress, public_https): if bind_address: (host, port) = parse_address(bind_address) else: @@ -90,12 +90,22 @@ def gen_https_servers(nodetype, nodeconfig, bind_address, bind_publicaddress): (_, publicport) = parse_address(nodeconfig["publicaddress"]) publichost = "0.0.0.0" - return [(Symbol("external_https_api"), publichost, publicport, Symbol("v1")), - (Symbol("frontend_https_api"), host, port, Symbol("frontend"))] + http_servers = [] + https_servers = [] + if public_https: + https_servers.append((Symbol("external_https_api"), publichost, publicport, Symbol("v1"))) + else: + http_servers.append((Symbol("external_http_api"), publichost, publicport, Symbol("v1"))) + https_servers.append((Symbol("frontend_https_api"), host, port, Symbol("frontend"))) + return (http_servers, + https_servers) + elif nodetype == "storagenodes": - return [(Symbol("storage_https_api"), host, port, Symbol("storage"))] + return ([], + [(Symbol("storage_https_api"), host, port, Symbol("storage"))]) elif nodetype == "signingnodes": - return [(Symbol("signing_https_api"), host, port, Symbol("signing"))] + return ([], + [(Symbol("signing_https_api"), host, port, Symbol("signing"))]) def allowed_clients_frontend(mergenodenames): return [ @@ -150,8 +160,10 @@ def gen_config(nodename, config, localconfig): configfile = open(paths["configdir"] + nodename + ".config", "w") print >>configfile, "%% catlfish configuration file (-*- erlang -*-)" + public_https = "nopublichttps" not in options + (nodetype, nodeconfig) = get_node_config(nodename, config) - https_servers = gen_https_servers(nodetype, nodeconfig, bind_address, bind_publicaddress) + (http_servers, https_servers) = gen_http_servers(nodetype, nodeconfig, bind_address, bind_publicaddress, public_https=public_https) catlfishconfig = [] plopconfig = [] @@ -163,6 +175,7 @@ def gen_config(nodename, config, localconfig): catlfishconfig += [ (Symbol("https_servers"), https_servers), + (Symbol("http_servers"), http_servers), (Symbol("https_certfile"), paths["https_certfile"]), (Symbol("https_keyfile"), paths["https_keyfile"]), (Symbol("https_cacertfile"), paths["https_cacertfile"]), |