More cleanups

This commit is contained in:
AaronDewes 2022-09-28 17:58:57 +00:00
parent 9c315c7e23
commit 3db161bb72
3 changed files with 4 additions and 20 deletions

View File

@ -73,7 +73,6 @@ def parse_dotenv(file_path):
exit(1)
return envVars
dotCitadelPath = os.path.join(nodeRoot, "..", ".citadel")
dotenv = {}
# Returns a list of every argument after the second one in sys.argv joined into a string by spaces
@ -84,10 +83,7 @@ def getArguments():
return arguments
def get_var(var_name):
if os.path.isfile(dotCitadelPath):
dotenv=parse_dotenv(os.path.join(nodeRoot, "..", ".env"))
else:
dotenv=parse_dotenv(os.path.join(nodeRoot, ".env"))
dotenv = parse_dotenv(os.path.join(nodeRoot, ".env"))
if var_name in dotenv:
return str(dotenv[var_name])
else:
@ -113,10 +109,7 @@ def handleAppV4(app):
yaml.dump(resultYml["spec"], dockerComposeFile)
torDaemons = ["torrc-apps", "torrc-apps-2", "torrc-apps-3"]
torFileToAppend = torDaemons[random.randint(0, len(torDaemons) - 1)]
if os.path.isfile(dotCitadelPath):
dotenv=parse_dotenv(os.path.join(nodeRoot, "..", ".env"))
else:
dotenv=parse_dotenv(os.path.join(nodeRoot, ".env"))
dotenv = parse_dotenv(os.path.join(nodeRoot, ".env"))
with open(os.path.join(nodeRoot, "tor", torFileToAppend), 'a') as f:
f.write(replace_vars(resultYml["new_tor_entries"]))
mainPort = resultYml["port"]

9
scripts/configure vendored
View File

@ -78,13 +78,6 @@ os.chdir(CITADEL_ROOT)
with open("./db/dependencies.yml", "r") as file:
dependencies = yaml.safe_load(file)
updating = False
status_dir = os.path.join(CITADEL_ROOT, 'statuses')
# Make sure to use the main status dir for updates
if os.path.isfile('../.citadel'):
status_dir = os.path.join(CITADEL_ROOT, '..', 'statuses')
updating = True
# Configure for appropriate network depending
# upon the user-supplied value of $NETWORK
# If the network is not specified, then use the mainnet
@ -377,7 +370,7 @@ with open("docker-compose.yml", "w") as stream:
if not reconfiguring:
print("Updating apps...\n")
os.system('./scripts/app --invoked-by-configure update')
elif not updating:
else:
print("Updating apps...\n")
os.system('./scripts/app --invoked-by-configure generate')
print("Configuring permissions...\n")

View File

@ -7,9 +7,7 @@ tor/*
electrs/*
logs/*
app-data/*
apps/networking.json
nginx/*
services/installed.yml
apps/sourceMap.json
apps/.updateignore
apps/*
fulcrum/*