From bb51fb99162277e964e90da46e4fa8fff43ed501 Mon Sep 17 00:00:00 2001
From: jonasled <jonas@jonasled.de>
Date: Fri, 21 Feb 2020 11:15:09 +0100
Subject: [PATCH] added some comments

---
 main.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/main.py b/main.py
index 4378e55..818f380 100644
--- a/main.py
+++ b/main.py
@@ -23,7 +23,7 @@ app = Flask(__name__)
 domain_to_index = {}
 
 try:
-    domain = os.environ["domains"].split(";") #Get the domains from the enviorement variable. If no enviorement variable is set set it to 127.0.0.1:5000 (for testing)
+    domain = os.environ["domains"].split(";") #Get the domains from the enviorement variable. If no enviorement variable is set it will be set to 127.0.0.1:5000 (for testing)
 except:
     domain = ["localhost:5000", "127.0.0.1:5000"]
 
@@ -74,7 +74,7 @@ try:
 except:
     host="127.0.0.1"
 
-try:
+try: #Try to get the oauth keys, if it fails, abort and print a message to console
     GITHUB_CLIENT_ID = os.environ['GITHUB_CLIENT_ID']
     GITHUB_CLIENT_SECRET = os.environ['GITHUB_CLIENT_SECRET']
     GOOGLE_CLIENT_ID = os.environ['GOOGLE_CLIENT_ID']
@@ -83,7 +83,7 @@ except:
     print("please set the oauth keys and run again.")
     exit()
 
-try:
+try: #check, if admin wants to show a cookie notice to the user. 
     if(os.environ["cookieNotice"] == 1):
         cookieNotice = True
     else:
@@ -91,7 +91,7 @@ try:
 except:
     cookieNotice = True
 
-try:
+try: #The secret key is used to crypt the auth cookie. There will be a seccond key to make the api key.
     secretKey = open("db/secretKey.txt", "r").read()
 except:
     secretKey = ''.join(random.choice(string.ascii_lowercase) for i in range(100)) #If we can't find the secret key(first run) we generate it in this step and write it to a file
-- 
GitLab