small cleanup and improvements to standardization
This commit is contained in:
parent
64ba2cea1d
commit
a1ea0a07d1
|
@ -19,7 +19,7 @@ REDIRECT_LINK = "http%3A%2F%2Flocalhost%3A6969%2F"
|
||||||
class FileGroups:
|
class FileGroups:
|
||||||
videos = ('.mkv', '.avi', '.flv', '.mov', '.m4v', '.mpg', '.wmv', '.mpeg', '.mp4', '.webm')
|
videos = ('.mkv', '.avi', '.flv', '.mov', '.m4v', '.mpg', '.wmv', '.mpeg', '.mp4', '.webm')
|
||||||
office = ('.doc', '.docx', '.xls', '.xlsx', '.xlt', '.xltx', '.xlm', '.ppt', 'pptx', '.pps', '.ppsx', '.odt', '.rtf')
|
office = ('.doc', '.docx', '.xls', '.xlsx', '.xlt', '.xltx', '.xlm', '.ppt', 'pptx', '.pps', '.ppsx', '.odt', '.rtf')
|
||||||
images = ('.png', '.jpg', '.jpeg', '.gif', '.ico', '.tga')
|
images = ('.png', '.jpg', '.jpeg', '.gif', '.ico', '.tga', '.webp')
|
||||||
text = ('.txt', '.text', '.sh', '.cfg', '.conf')
|
text = ('.txt', '.text', '.sh', '.cfg', '.conf')
|
||||||
music = ('.psf', '.mp3', '.ogg', '.flac', '.m4a')
|
music = ('.psf', '.mp3', '.ogg', '.flac', '.m4a')
|
||||||
pdf = ('.pdf')
|
pdf = ('.pdf')
|
||||||
|
@ -38,7 +38,7 @@ class Config(object):
|
||||||
LOGIN_PATH = "FLASK_LOGIN" # Value can be OIDC or FLASK_LOGIN
|
LOGIN_PATH = "FLASK_LOGIN" # Value can be OIDC or FLASK_LOGIN
|
||||||
OIDC_TOKEN_TYPE_HINT = 'access_token'
|
OIDC_TOKEN_TYPE_HINT = 'access_token'
|
||||||
APP_REDIRECT_URI = REDIRECT_LINK
|
APP_REDIRECT_URI = REDIRECT_LINK
|
||||||
OIDC_CLIENT_SECRETS = ROOT_FILE_PTH + '/client_secrets.json'
|
OIDC_CLIENT_SECRETS = f'{ROOT_FILE_PTH}/client_secrets.json'
|
||||||
OIDC_ID_TOKEN_COOKIE_SECURE = True
|
OIDC_ID_TOKEN_COOKIE_SECURE = True
|
||||||
OIDC_REQUIRE_VERIFIED_EMAIL = True
|
OIDC_REQUIRE_VERIFIED_EMAIL = True
|
||||||
OIDC_USER_INFO_ENABLED = True
|
OIDC_USER_INFO_ENABLED = True
|
||||||
|
@ -47,7 +47,7 @@ class Config(object):
|
||||||
'https://localhost:443/auth/realms/apps'
|
'https://localhost:443/auth/realms/apps'
|
||||||
]
|
]
|
||||||
|
|
||||||
STATIC_FPTH = ROOT_FILE_PTH + "/static"
|
STATIC_FPTH = f"{ROOT_FILE_PTH}/static"
|
||||||
FILEGROUPS = FileGroups
|
FILEGROUPS = FileGroups
|
||||||
VEXTENSION = FileGroups.videos
|
VEXTENSION = FileGroups.videos
|
||||||
OEXTENSION = FileGroups.office
|
OEXTENSION = FileGroups.office
|
||||||
|
|
|
@ -20,11 +20,6 @@ def oidc_register():
|
||||||
if _form.validate_on_submit():
|
if _form.validate_on_submit():
|
||||||
# TODO: Create...
|
# TODO: Create...
|
||||||
# NOTE: Do a requests api here maybe??
|
# NOTE: Do a requests api here maybe??
|
||||||
|
|
||||||
# hashed_password = bcrypt.generate_password_hash(_form.password.data).decode("utf-8")
|
|
||||||
# user = User(username=_form.username.data, password=hashed_password)
|
|
||||||
# db.session.add(user)
|
|
||||||
# db.session.commit()
|
|
||||||
flash("Account created successfully!", "success")
|
flash("Account created successfully!", "success")
|
||||||
return redirect("/login")
|
return redirect("/login")
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ class Logger:
|
||||||
|
|
||||||
if createFile:
|
if createFile:
|
||||||
folder = "logs"
|
folder = "logs"
|
||||||
file = folder + "/flask-application.log"
|
file = f"{folder}/flask-application.log"
|
||||||
|
|
||||||
if not os.path.exists(folder):
|
if not os.path.exists(folder):
|
||||||
os.mkdir(folder)
|
os.mkdir(folder)
|
||||||
|
|
|
@ -10,5 +10,5 @@ class MessageHandler:
|
||||||
print("MessageHandler initialized...")
|
print("MessageHandler initialized...")
|
||||||
|
|
||||||
|
|
||||||
def createMessageJSON(self, type, text):
|
def create_JSON_message(self, type, text):
|
||||||
return '{"message": { "type": "' + type + '", "text": "' + text + '" } }'
|
return '{"message": { "type": "' + type + '", "text": "' + text + '" } }'
|
||||||
|
|
Loading…
Reference in New Issue