From 35b35d24b2de05ba9246f2dae69cd5f520c3ed21 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Mon, 8 Jan 2024 01:37:07 +1100 Subject: [PATCH] feat: Update readme --- README.md | 3 ++- cert.py | 17 +++++++++++++---- token | 1 + 3 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 token diff --git a/README.md b/README.md index cf8b406..b6a2951 100644 --- a/README.md +++ b/README.md @@ -11,12 +11,13 @@ Nathan will then add your IP to the domain which will let you create a certifica ## Install script Contact Nathan.Woodburn/ to get an Auth token. -Edit the cert.py file and add your Auth token. +Replace the token file with the token provided (this is case sensitive and must be exact). This token is used to get a certificate for the domain. ```sh git clone https://git.woodburn.au/nathanwoodburn/hns_doh_loadbalancer.git cd hns_doh_loadbalancer +echo "TOKEN FROM NATHAN" > token sudo ./install.sh ``` diff --git a/cert.py b/cert.py index 00362b4..7bd4aab 100644 --- a/cert.py +++ b/cert.py @@ -5,10 +5,19 @@ import requests import sys import time -### EDIT THESE: Configuration values ### -# CONTACT NATHAN FOR AUTH -AUTH = "your-auth-here" -### DO NOT EDIT BELOW THIS POINT ### +AUTH = "" +# Check if token file exists +if os.path.isfile("token"): + print("ERROR: Token file not found") + +# Read token from file +with open("token", "r") as fh: + AUTH = fh.read().strip() + +# Check if token is empty +if len(AUTH) == 0: + print("ERROR: Token is empty") + exit(1) diff --git a/token b/token new file mode 100644 index 0000000..b8b6bd9 --- /dev/null +++ b/token @@ -0,0 +1 @@ +enter-your-token \ No newline at end of file