updating configuration

This commit is contained in:
Your Name
2021-03-30 22:50:08 +00:00
parent 1c99d2a6ba
commit 067e9317ff
8 changed files with 109 additions and 1 deletions
+28
View File
@@ -0,0 +1,28 @@
import pyotp
import os
user = os.getenv('USERNAME')
password = os.getenv('PASSWORD')
secret = os.getenv('SECRET')
if user == "":
print("USERNAME not specified")
os.exit(-1)
if password == "":
print("PASSWORD not specified")
os.exit(-1)
if secret == "":
print("SECRET not specified")
os.exit(-1)
totp = pyotp.TOTP(secret)
token = totp.now()
f = open("/auth.txt", "w")
f.write("{}\n".format(user))
f.write('{}{}\n'.format(password, token))
f.close()
print("Generated OTP token for user ({}): {}".format(user,token))