fix: Use a better env name
All checks were successful
Build Docker / BuildImage (push) Successful in 36s

This commit is contained in:
Nathan Woodburn 2024-10-03 14:06:44 +10:00
parent 1f2dbe0e99
commit d30aa6e427
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -81,13 +81,14 @@ def renew():
return jsonify({"error": "No domain provided"}), 400 return jsonify({"error": "No domain provided"}), 400
# Get path from env # Get path from env
path = os.getenv("PATH") path = os.getenv("SCRIPT_PATH")
wallet = os.getenv("WALLET") wallet = os.getenv("WALLET")
apiKEY = os.getenv("API_KEY") apiKEY = os.getenv("API_KEY")
if not path: if not path:
return jsonify({"error": "No HS-ANYONE found"}), 400 return jsonify({"error": "No HS-ANYONE found"}), 400
# Run the renewal # Run the renewal
print(f"Command: node {path} renew {domain} --wallet {wallet} --network main --broadcast true --apikey {apiKEY}")
output = subprocess.run(["node", path, "renew", domain, "--wallet", wallet, "--network", "main", "--broadcast", "true", "--apikey", apiKEY], capture_output=True, text=True) output = subprocess.run(["node", path, "renew", domain, "--wallet", wallet, "--network", "main", "--broadcast", "true", "--apikey", apiKEY], capture_output=True, text=True)
return jsonify({"output": output.stdout,"error": output.stderr}), 200 return jsonify({"output": output.stdout,"error": output.stderr}), 200