Skip to content
Snippets Groups Projects
Commit be91816a authored by Josh Brooks's avatar Josh Brooks
Browse files

Fix bug in generation script

parent ecb04501
No related branches found
No related tags found
2 merge requests!68Master merge,!59Make backup package
......@@ -8,9 +8,9 @@ logLevel: 0
logPath: "results/client-registrar.log"
# Public address, used in NDF it gives to client
publicAddress: "0.0.0.0:20111"
publicAddress: "0.0.0.0:20121"
# The listening port of this server
port: 20111
port: 20121
# === REQUIRED FOR ENABLING TLS ===
# Path to the registration server private key file
......
......@@ -16,10 +16,10 @@ loglevel: 2
log: "results/gateways/gateway-1.log"
# The public IP address and port of the node associated with this gateway
cmixAddress: "0.0.0.0:10110"
cmixAddress: "0.0.0.0:10120"
# The listening port of this gateway
Port: 1110
Port: 1120
# The public IPv4 address of the Gateway, as reported to the network, to use
# instead of dynamically looking up Gateway's own IP address. If a port is not
......
......@@ -16,10 +16,10 @@ loglevel: 2
log: "results/gateways/gateway-2.log"
# The public IP address and port of the node associated with this gateway
cmixAddress: "0.0.0.0:10111"
cmixAddress: "0.0.0.0:10121"
# The listening port of this gateway
Port: 1111
Port: 1121
# The public IPv4 address of the Gateway, as reported to the network, to use
# instead of dynamically looking up Gateway's own IP address. If a port is not
......
......@@ -16,10 +16,10 @@ loglevel: 2
log: "results/gateways/gateway-3.log"
# The public IP address and port of the node associated with this gateway
cmixAddress: "0.0.0.0:10112"
cmixAddress: "0.0.0.0:10122"
# The listening port of this gateway
Port: 1112
Port: 1122
# The public IPv4 address of the Gateway, as reported to the network, to use
# instead of dynamically looking up Gateway's own IP address. If a port is not
......
......@@ -16,10 +16,10 @@ loglevel: 2
log: "results/gateways/gateway-4.log"
# The public IP address and port of the node associated with this gateway
cmixAddress: "0.0.0.0:10113"
cmixAddress: "0.0.0.0:10123"
# The listening port of this gateway
Port: 1113
Port: 1123
# The public IPv4 address of the Gateway, as reported to the network, to use
# instead of dynamically looking up Gateway's own IP address. If a port is not
......
......@@ -16,10 +16,10 @@ loglevel: 2
log: "results/gateways/gateway-5.log"
# The public IP address and port of the node associated with this gateway
cmixAddress: "0.0.0.0:10114"
cmixAddress: "0.0.0.0:10124"
# The listening port of this gateway
Port: 1114
Port: 1124
# The public IPv4 address of the Gateway, as reported to the network, to use
# instead of dynamically looking up Gateway's own IP address. If a port is not
......
localhost:1110
localhost:1120
# This is the network configuration file. The top line of this file,
# when not set via command line, is used to determine to which network
# the integration test will be run against.
......
......@@ -9,7 +9,7 @@ loglevel: 2
logPath: "results/permissioning.log"
# The listening port of this server
port: 20110
port: 20120
# Database connection information
dbUsername: ""
......@@ -48,7 +48,7 @@ updateIdPath: "results/updateId.txt"
# Public address used in NDF to give to client
registrationAddress: "0.0.0.0:20111"
registrationAddress: "0.0.0.0:20121"
# Path to whitelisted IPs for client ratelimiting
whitelistedIpAddressesPath: "whitelist.txt"
......@@ -70,7 +70,7 @@ signedPartialNDFOutputPath: "results/permissions-ndfoutput-partial.json"
udbCertPath: "../keys/cmix.rip.crt"
# "Location of the user discovery contact file.
udContactPath: "results/udbContact.bin"
udbAddress: "127.0.0.1:30110"
udbAddress: "127.0.0.1:30120"
# Time interval (in minutes) in which the database is
# checked for banned nodes
......
[{"RegCode": "qxkv", "Order": "CR"},{"RegCode": "bsms", "Order": "CR"},{"RegCode": "axcv", "Order": "CR"},{"RegCode": "vkgs", "Order": "CR"},{"RegCode": "qwuw", "Order": "CR"}]
\ No newline at end of file
[{"RegCode": "enkf", "Order": "CR"},{"RegCode": "ozxl", "Order": "CR"},{"RegCode": "qgby", "Order": "CR"},{"RegCode": "llhb", "Order": "CR"},{"RegCode": "umks", "Order": "CR"}]
\ No newline at end of file
......@@ -71,7 +71,7 @@ fi
echo "NETWORK: $NETWORKENTRYPOINT"
if [ "$NETWORKENTRYPOINT" == "localhost:1090" ]
if [ "$NETWORKENTRYPOINT" == "localhost:1120" ]
then
source network.sh
......@@ -80,7 +80,7 @@ else
echo $NETWORKENTRYPOINT > results/startgwserver.txt
fi
echo "localhost:1090" > results/startgwserver.txt
echo "localhost:1120" > results/startgwserver.txt
echo "DONE LETS DO STUFF"
......@@ -177,7 +177,7 @@ for C in $(ls -1 $CLIENTCLEAN | grep -v client11[01]); do
done
GOLDOUTPUT=clients.goldoutput
if [ "$NETWORKENTRYPOINT" != "localhost:1090" ]
if [ "$NETWORKENTRYPOINT" != "localhost:1120" ]
then
rm -fr clients.net_goldoutput || true
GOLDOUTPUT=clients.net_goldoutput
......@@ -200,7 +200,7 @@ fi
set +x
diff -aru $GOLDOUTPUT $CLIENTCLEAN
if [ "$NETWORKENTRYPOINT" == "localhost:1090" ]
if [ "$NETWORKENTRYPOINT" == "localhost:1120" ]
then
#cat $CLIENTOUT/* | strings | grep -ae "ERROR" -e "FATAL" > results/client-errors || true
......
# START YAML ===
registrationCode: "qxkv"
registrationCode: "enkf"
useGPU: false
devMode: true
rawPermAddr: true
......@@ -18,7 +18,7 @@ cmix:
log: "results/servers/server-1.log"
errOutput: "results/servers/server-1.err"
ipListOutput: "results/servers/iplist-1.txt"
port: "10110"
port: "10120"
overridePublicIP: "127.0.0.1"
database:
name: "cmix_server"
......@@ -34,7 +34,7 @@ scheduling:
# Path to the self signed TLS cert used by the permissioning. Provided by xx network
cert: "../keys/cmix.rip.crt"
# IP Address of the permissioning server, provided by xx network
address: "0.0.0.0:20110"
address: "0.0.0.0:20120"
metrics:
# location of stored metrics data. Modification to set to permissioning
# server instead of saving will be made at a later date
......
# START YAML ===
registrationCode: "bsms"
registrationCode: "ozxl"
useGPU: false
devMode: true
rawPermAddr: true
......@@ -18,7 +18,7 @@ cmix:
log: "results/servers/server-2.log"
errOutput: "results/servers/server-2.err"
ipListOutput: "results/servers/iplist-1.txt"
port: "10111"
port: "10121"
overridePublicIP: "127.0.0.1"
database:
name: "cmix_server"
......@@ -34,7 +34,7 @@ scheduling:
# Path to the self signed TLS cert used by the permissioning. Provided by xx network
cert: "../keys/cmix.rip.crt"
# IP Address of the permissioning server, provided by xx network
address: "0.0.0.0:20110"
address: "0.0.0.0:20120"
metrics:
# location of stored metrics data. Modification to set to permissioning
# server instead of saving will be made at a later date
......
# START YAML ===
registrationCode: "axcv"
registrationCode: "qgby"
useGPU: false
devMode: true
rawPermAddr: true
......@@ -18,7 +18,7 @@ cmix:
log: "results/servers/server-3.log"
errOutput: "results/servers/server-3.err"
ipListOutput: "results/servers/iplist-1.txt"
port: "10112"
port: "10122"
overridePublicIP: "127.0.0.1"
database:
name: "cmix_server"
......@@ -34,7 +34,7 @@ scheduling:
# Path to the self signed TLS cert used by the permissioning. Provided by xx network
cert: "../keys/cmix.rip.crt"
# IP Address of the permissioning server, provided by xx network
address: "0.0.0.0:20110"
address: "0.0.0.0:20120"
metrics:
# location of stored metrics data. Modification to set to permissioning
# server instead of saving will be made at a later date
......
# START YAML ===
registrationCode: "vkgs"
registrationCode: "llhb"
useGPU: false
devMode: true
rawPermAddr: true
......@@ -18,7 +18,7 @@ cmix:
log: "results/servers/server-4.log"
errOutput: "results/servers/server-4.err"
ipListOutput: "results/servers/iplist-1.txt"
port: "10113"
port: "10123"
overridePublicIP: "127.0.0.1"
database:
name: "cmix_server"
......@@ -34,7 +34,7 @@ scheduling:
# Path to the self signed TLS cert used by the permissioning. Provided by xx network
cert: "../keys/cmix.rip.crt"
# IP Address of the permissioning server, provided by xx network
address: "0.0.0.0:20110"
address: "0.0.0.0:20120"
metrics:
# location of stored metrics data. Modification to set to permissioning
# server instead of saving will be made at a later date
......
# START YAML ===
registrationCode: "qwuw"
registrationCode: "umks"
useGPU: false
devMode: true
rawPermAddr: true
......@@ -18,7 +18,7 @@ cmix:
log: "results/servers/server-5.log"
errOutput: "results/servers/server-5.err"
ipListOutput: "results/servers/iplist-1.txt"
port: "10114"
port: "10124"
overridePublicIP: "127.0.0.1"
database:
name: "cmix_server"
......@@ -34,7 +34,7 @@ scheduling:
# Path to the self signed TLS cert used by the permissioning. Provided by xx network
cert: "../keys/cmix.rip.crt"
# IP Address of the permissioning server, provided by xx network
address: "0.0.0.0:20110"
address: "0.0.0.0:20120"
metrics:
# location of stored metrics data. Modification to set to permissioning
# server instead of saving will be made at a later date
......
......@@ -3,8 +3,8 @@ log: "./results/udb.log"
sessionPath: "./results/udbsession"
sessionPass: "hello"
certPath: "../keys/cmix.rip.crt"
port: "30110"
port: "30120"
keyPath: "../keys/cmix.rip.key"
permCertPath: "../keys/cmix.rip.crt"
permAddress: "0.0.0.0:20110"
permAddress: "0.0.0.0:20120"
devMode: true
\ No newline at end of file
......@@ -5,6 +5,7 @@ import os
import string
import random
import argparse
import re
from collections.abc import Sequence
# Generates a random string
def random_string(stringLength=4):
......@@ -34,7 +35,7 @@ def create_ports_list(offset, manualOffset=0):
while regCode in node_regCodes:
regCode = random_string()
node_regCodes.append(regCode)
permissioningPort = 20000 + 10 * offset
udbPort = 30000 + 10 * offset
......@@ -120,13 +121,13 @@ def generate_server_side_config(offset: int, newPackage: string):
reg_json = ""
with open("gen/registration.json") as f:
reg_json = f.read()
# Open udb proto file
udb_proto = ""
with open("gen/udbProto.json") as f:
udb_proto = f.read()
# Create package
# Create package
if not os.path.exists(newPackage):
os.makedirs(newPackage)
......@@ -196,7 +197,7 @@ def generate_server_side_config(offset: int, newPackage: string):
.replace("{udb_port}", str(udbPort))\
.replace("{registration_port}", str(perm_port+1))
f.write(reg_template)
# Generate registration configs
with open("{}/registration.json".format(newPackage), "w") as f:
f.write(reg_json)
......@@ -204,7 +205,7 @@ def generate_server_side_config(offset: int, newPackage: string):
with open("{}/client-registrar.yaml".format(newPackage), "w") as f:
client_reg_template = client_reg_template.replace("{registration_port}", str(perm_port+1))
f.write(client_reg_template)
with open("{}/noerrors.txt".format(newPackage), "w") as f:
f.write(no_errors)
......@@ -213,6 +214,14 @@ def generate_server_side_config(offset: int, newPackage: string):
run_template = run_template.replace("{entry_point}", str(gateway_ports[0]))
f.write(run_template)
else:
with open("{}/run.sh".format(newPackage), "r") as f:
filedata = f.read()
newdata = re.sub(r"(localhost:)(\d+)", f"localhost:{str(gateway_ports[0])}", filedata)
with open("{}/run.sh".format(newPackage), "w") as f:
f.write(newdata)
# Set the executable permissions on the bash script file
os.chmod("{}/run.sh".format(newPackage), 0o755)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment