summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/compileconfig.py21
-rwxr-xr-xtools/merge_backup.py2
-rwxr-xr-xtools/merge_fetch.py2
-rwxr-xr-xtools/merge_sth.py5
-rwxr-xr-xtools/submitcert.py1
5 files changed, 17 insertions, 14 deletions
diff --git a/tools/compileconfig.py b/tools/compileconfig.py
index 25518ee..777a12f 100755
--- a/tools/compileconfig.py
+++ b/tools/compileconfig.py
@@ -88,7 +88,7 @@ def get_address(bind_address, nodeconfig):
host = "0.0.0.0"
return (host, port)
-def gen_http_servers(nodetype, nodeconfig, bind_address, bind_publicaddress, bind_publichttpaddress):
+def gen_http_servers(nodetype, nodeconfig, bind_addresses, bind_publicaddress, bind_publichttpaddress):
http_servers = []
https_servers = []
@@ -97,7 +97,7 @@ def gen_http_servers(nodetype, nodeconfig, bind_address, bind_publicaddress, bin
sys.exit(1)
if "frontendnodes" in nodetype:
- (host, port) = get_address(bind_address, nodeconfig["frontendnodes"])
+ (host, port) = get_address(bind_addresses["frontend"], nodeconfig["frontendnodes"])
if bind_publicaddress:
(publichost, publicport) = parse_address(bind_publicaddress)
else:
@@ -110,13 +110,13 @@ def gen_http_servers(nodetype, nodeconfig, bind_address, bind_publicaddress, bin
https_servers.append((Symbol("external_https_api"), publichost, publicport, Symbol("v1")))
https_servers.append((Symbol("frontend_https_api"), host, port, Symbol("frontend")))
if "storagenodes" in nodetype:
- (host, port) = get_address(bind_address, nodeconfig["storagenodes"])
+ (host, port) = get_address(bind_addresses["storage"], nodeconfig["storagenodes"])
https_servers.append((Symbol("storage_https_api"), host, port, Symbol("storage")))
if "signingnodes" in nodetype:
- (host, port) = get_address(bind_address, nodeconfig["signingnodes"])
+ (host, port) = get_address(bind_addresses["signing"], nodeconfig["signingnodes"])
https_servers.append((Symbol("signing_https_api"), host, port, Symbol("signing")))
if "mergenodes" in nodetype:
- (host, port) = get_address(bind_address, nodeconfig["mergenodes"])
+ (host, port) = get_address(bind_addresses["merge"], nodeconfig["mergenodes"])
https_servers.append((Symbol("frontend_https_api"), host, port, Symbol("frontend")))
if nodetype - set(["frontendnodes", "storagenodes", "signingnodes", "mergenodes"]):
print >>sys.stderr, "unknown nodetype", nodetype
@@ -196,8 +196,13 @@ def parse_ratelimit((type, description)):
def gen_config(nodename, config, localconfig):
print "generating config for", nodename
paths = localconfig["paths"]
- bind_address = localconfig.get("addresses", {}).get(nodename)
- bind_publicaddress = localconfig.get("publicaddresses", {}).get(nodename)
+ bind_addresses = {
+ "frontend": localconfig.get("frontendaddresses", {}).get(nodename),
+ "storage": localconfig.get("storageaddresses", {}).get(nodename),
+ "signing": localconfig.get("signingaddresses", {}).get(nodename),
+ "merge": localconfig.get("mergeaddresses", {}).get(nodename),
+ }
+ bind_publicaddress = localconfig.get("ctapiaddresses", {}).get(nodename)
bind_publichttpaddress = localconfig.get("publichttpaddresses", {}).get(nodename)
options = localconfig.get("options", [])
@@ -205,7 +210,7 @@ def gen_config(nodename, config, localconfig):
print >>configfile, "%% catlfish configuration file (-*- erlang -*-)"
(nodetype, nodeconfig) = get_node_config(nodename, config)
- (http_servers, https_servers) = gen_http_servers(nodetype, nodeconfig, bind_address, bind_publicaddress, bind_publichttpaddress=bind_publichttpaddress)
+ (http_servers, https_servers) = gen_http_servers(nodetype, nodeconfig, bind_addresses, bind_publicaddress, bind_publichttpaddress=bind_publichttpaddress)
catlfishconfig = []
plopconfig = []
diff --git a/tools/merge_backup.py b/tools/merge_backup.py
index 48ac133..ac16a6a 100755
--- a/tools/merge_backup.py
+++ b/tools/merge_backup.py
@@ -154,7 +154,7 @@ def merge_backup(args, config, localconfig, secondaries):
backuppath = mergedb + "/verified." + nodename
backupdata = {"tree_size": tree_size,
"sha256_root_hash": hexencode(root_hash)}
- print >>sys.stderr, "DEBUG: writing to", backuppath, ":", backupdata
+ #print >>sys.stderr, "DEBUG: writing to", backuppath, ":", backupdata
write_file(backuppath, backupdata)
if args.timing:
diff --git a/tools/merge_fetch.py b/tools/merge_fetch.py
index bb1e17e..8a52c9e 100755
--- a/tools/merge_fetch.py
+++ b/tools/merge_fetch.py
@@ -114,7 +114,7 @@ def main():
while True:
logsize, last_hash = merge_fetch(args, config, localconfig)
currentsize = {"index": logsize - 1, "hash": hexencode(last_hash)}
- print >>sys.stderr, "DEBUG: writing to", currentsizefile, ":", currentsize
+ #print >>sys.stderr, "DEBUG: writing to", currentsizefile, ":", currentsize
write_file(currentsizefile, currentsize)
if args.interval is None:
break
diff --git a/tools/merge_sth.py b/tools/merge_sth.py
index cf1e994..28ad34f 100755
--- a/tools/merge_sth.py
+++ b/tools/merge_sth.py
@@ -46,7 +46,7 @@ def merge_sth(args, config, localconfig):
tree = {'tree_size': 0, "sha256_root_hash": ''}
trees.append(tree)
trees.sort(key=lambda e: e['tree_size'], reverse=True)
- print >>sys.stderr, "DEBUG: trees:", trees
+ #print >>sys.stderr, "DEBUG: trees:", trees
if backupquorum > len(trees) - 1:
print >>sys.stderr, "backup quorum > number of secondaries:", \
@@ -54,8 +54,7 @@ def merge_sth(args, config, localconfig):
return
tree_size = trees[backupquorum]['tree_size']
root_hash = hexdecode(trees[backupquorum]['sha256_root_hash'])
- print >>sys.stderr, "DEBUG: tree size candidate at backupquorum", \
- backupquorum, ":", tree_size
+ #print >>sys.stderr, "DEBUG: tree size candidate at backupquorum", backupquorum, ":", tree_size
cur_sth = get_sth(sthfile)
if tree_size < cur_sth['tree_size']:
diff --git a/tools/submitcert.py b/tools/submitcert.py
index 3b14912..7719dc2 100755
--- a/tools/submitcert.py
+++ b/tools/submitcert.py
@@ -13,7 +13,6 @@ import struct
import hashlib
import itertools
from certtools import *
-from certtools import *
from precerttools import *
import os
import signal