@@ -10,6 +10,10 @@ from io import BytesIO #Needed for base64 encoding of the image
fromPILimportImage#Needed for QR generation
importjson#used for github oauth
fromhtmlimportescape#This is used to escape characters, if they are send in the url
fromitsdangerousimportURLSafeSerializer#used for signing the cookies
importrandom#used for signing the cookies
importstring#used for signing the cookies
app=Flask(__name__)
domain_to_index={}
...
...
@@ -83,6 +87,17 @@ try:
except:
cookieNotice=True
try:
secretKey=open("db/secretKey.txt","r").read()
except:
secretKey=''.join(random.choice(string.ascii_lowercase)foriinrange(100))#If we can't find the secret key(first run) we generate it in this step and write it to a file
print("generated secret Key. Key is: "+secretKey)
f=open("db/secretKey.txt","w")
f.write(secretKey)
f.close()
secretKey=open("db/secretKey.txt","r").read()
s=URLSafeSerializer(secretKey)
index=0
domain_prepared=""
fordomainsindomain:#Make from every domnain a entry for the select box later
...
...
@@ -144,7 +159,7 @@ def grecaptcha_verify(request): #This function is used to verify the google reca