2021-02-06 04:52:46 +00:00
|
|
|
# System import
|
2021-02-07 06:43:36 +00:00
|
|
|
import os, secrets
|
2021-02-06 04:52:46 +00:00
|
|
|
from datetime import timedelta
|
|
|
|
|
|
|
|
|
|
|
|
# Lib imports
|
|
|
|
|
|
|
|
|
|
|
|
# Apoplication imports
|
|
|
|
|
|
|
|
|
|
|
|
# Configs
|
2021-09-04 04:51:17 +00:00
|
|
|
APP_NAME = 'WebFM'
|
2021-02-06 04:52:46 +00:00
|
|
|
ROOT_FILE_PTH = os.path.dirname(os.path.realpath(__file__))
|
|
|
|
|
|
|
|
|
|
|
|
class Config(object):
|
|
|
|
TITLE = APP_NAME
|
|
|
|
DEBUG = False
|
|
|
|
TESTING = False
|
2021-02-13 11:33:17 +00:00
|
|
|
THREADED = True
|
2021-09-04 04:51:17 +00:00
|
|
|
SECRET_KEY = "2A#GQafbREoblgMSQYomZSxbaPE6dt#"
|
|
|
|
# SECRET_KEY = secrets.token_hex(32)
|
2021-02-06 04:52:46 +00:00
|
|
|
|
|
|
|
PERMANENT_SESSION_LIFETIME = timedelta(days = 7).total_seconds()
|
2021-02-08 04:49:38 +00:00
|
|
|
SQLALCHEMY_DATABASE_URI = "sqlite:///static/db/webfm.db"
|
2021-02-06 04:52:46 +00:00
|
|
|
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
|
|
|
|
2021-02-08 20:04:32 +00:00
|
|
|
LOGIN_PATH = "OIDC" # Value can be OIDC or FLASK_LOGIN
|
2021-02-06 04:52:46 +00:00
|
|
|
OIDC_TOKEN_TYPE_HINT = 'access_token'
|
2021-02-08 20:04:32 +00:00
|
|
|
APP_REDIRECT_URI = "https%3A%2F%2Fwww.webfm.com%2F" # This path is submitted as the redirect URI in certain code flows
|
2022-06-14 02:51:51 +00:00
|
|
|
OIDC_CLIENT_SECRETS = f'{ROOT_FILE_PTH}/client_secrets.json'
|
2021-02-06 04:52:46 +00:00
|
|
|
OIDC_ID_TOKEN_COOKIE_SECURE = True
|
2021-02-08 20:04:32 +00:00
|
|
|
OIDC_REQUIRE_VERIFIED_EMAIL = False
|
2021-02-06 04:52:46 +00:00
|
|
|
OIDC_USER_INFO_ENABLED = True
|
|
|
|
OIDC_VALID_ISSUERS = [
|
2021-02-08 20:04:32 +00:00
|
|
|
'http://www.ssoapps.com/auth/realms/apps',
|
|
|
|
'https://www.ssoapps.com/auth/realms/apps'
|
2021-02-06 04:52:46 +00:00
|
|
|
]
|
|
|
|
|
2022-06-14 02:51:51 +00:00
|
|
|
STATIC_FPTH = f"{ROOT_FILE_PTH}/static"
|
2021-02-07 06:43:36 +00:00
|
|
|
REL_THUMBS_PTH = "static/imgs/thumbnails" # Used for flask thumbnail return
|
|
|
|
|
2021-09-04 04:51:17 +00:00
|
|
|
# We are overiding some of the the shellmen view settings with these to make it all work with flask.
|
|
|
|
# These are passed along to the shellmen view from the Routes file upon the window controller creation.
|
2022-06-14 02:51:51 +00:00
|
|
|
ABS_THUMBS_PTH = f"{STATIC_FPTH}/imgs/thumbnails" # Used for thumbnail generation
|
|
|
|
REMUX_FOLDER = f"{STATIC_FPTH}/remuxs" # Remuxed files folder
|
|
|
|
FFMPG_THUMBNLR = f"{STATIC_FPTH}/ffmpegthumbnailer" # Thumbnail generator binary
|
2021-09-04 04:51:17 +00:00
|
|
|
|
2021-02-07 06:43:36 +00:00
|
|
|
|
2021-02-06 04:52:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ProductionConfig(Config):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class DevelopmentConfig(Config):
|
2021-02-10 19:19:39 +00:00
|
|
|
DEBUG = True
|
|
|
|
USE_RELOADER = True
|
2021-02-06 04:52:46 +00:00
|
|
|
OIDC_ID_TOKEN_COOKIE_SECURE = False
|
|
|
|
OIDC_REQUIRE_VERIFIED_EMAIL = False
|
|
|
|
|
|
|
|
|
|
|
|
class TestingConfig(Config):
|
|
|
|
TESTING = True
|