188 lines
7.9 KiB
Python
188 lines
7.9 KiB
Python
# Configuration file for this Flask app.
|
|
import os
|
|
|
|
|
|
# ### ### #
|
|
|
|
|
|
## Builtin Python Flask configuration options
|
|
|
|
# General Flask options
|
|
FLASK_ENV = 'development' # None, 'backup', 'default', 'development', 'production', 'testing'
|
|
ENV = 'development' # None, 'backup', 'default', 'development', 'production', 'testing'
|
|
|
|
DEBUG = True
|
|
TESTING = True
|
|
|
|
SECRET_KEY = '\x08}\xe1q?\xb2\x16o9\xf1\x1d\xc7\xa8\xfb!\xff' # Generate a new key with: # python -c 'import os; print(os.urandom(16))'
|
|
|
|
# SESSION_COOKIE_NAME = 'session'
|
|
# SESSION_COOKIE_DOMAIN = '.onesky.com'
|
|
# SESSION_COOKIE_PATH = None
|
|
# SESSION_COOKIE_HTTPONLY = True
|
|
# SESSION_COOKIE_SECURE = False
|
|
# SESSION_COOKIE_SAMESITE = None
|
|
# SESSION_REFRESH_EACH_REQUEST = True
|
|
|
|
# Client browser session options
|
|
# 3600 is 1 hour, 28800 is 8 hours
|
|
# 86400 is 24 hours, 172800 is 48 hours
|
|
# 1209600 is 14 days, 2678400 is 31 days
|
|
# 7862400 is 91 days or 13 weeks (.25 year)
|
|
# 31536000 is 365 days
|
|
# 33868800 is 9408 hours or 392 days
|
|
PERMANENT_SESSION_LIFETIME = 3600
|
|
SESSION_REFRESH_EACH_REQUEST = True
|
|
|
|
# Files and caching
|
|
# SERVER_NAME = ''
|
|
|
|
# UPLOAD_FOLDER = ''
|
|
MAX_CONTENT_LENGTH = 5120 * 1024 * 1024 # 5 GB
|
|
|
|
SEND_FILE_MAX_AGE_DEFAULT = 3 # default 43200 (in seconds), 1800 = 30 minutes
|
|
|
|
CACHE_TYPE = 'SimpleCache'
|
|
CACHE_DEFAULT_TIMEOUT = 1
|
|
|
|
JSONIFY_PRETTYPRINT_REGULAR = True
|
|
|
|
## MySQL and SQL Alchemy
|
|
# pool_size is set to 100. The default is 5 connections
|
|
# pool_recyle after 10 minutes (600 seconds). MySQL is set to timeout after 15 minutes (900 seconds)
|
|
# SQLALCHEMY_ENGINE_OPTIONS = {'pool_size' : 100, 'pool_recycle' : 120, 'pool_pre_ping': True}
|
|
|
|
POOL_SIZE = 25
|
|
POOL_RECYCLE = 60
|
|
POOL_PRE_PING = True
|
|
ECHO = False
|
|
ECHO_POOL = False
|
|
ISOLATION_LEVEL = 'READ COMMITTED'
|
|
|
|
|
|
# ### ### #
|
|
|
|
|
|
### Aether configration options
|
|
AETHER_CFG = {}
|
|
|
|
## General Aether configuration options
|
|
AETHER_CFG['id'] = os.getenv('AE_CFG_ID', None) # Aether config ID
|
|
|
|
## Aether Flask app (not a specific browser client) configuration (pull from "cfg_flask" table)
|
|
AETHER_CFG['app'] = {}
|
|
AETHER_CFG['app']['id'] = os.getenv('AE_APP_CFG_ID', None) # Flask app config ID
|
|
AETHER_CFG['app']['name']: str = "Aether App (Flask)" # Not set in DB???
|
|
AETHER_CFG['app']['version']: str = '3.6.0 2022-10-04' # Not set in DB???
|
|
AETHER_CFG['app']['email']: str = 'Info@OneSkyIT.com'
|
|
AETHER_CFG['app']['env'] = None # None, 'backup', 'default', 'development', 'production', 'testing'; Not set in DB???
|
|
AETHER_CFG['app']['mode'] = None # None, 'default', 'native', 'onsite'; Not set in DB???
|
|
AETHER_CFG['app']['ux_mode'] = None # In this case it is the same as mode. None, 'default', 'native', 'onsite'
|
|
AETHER_CFG['app']['theme'] = None # For future use or at least for 'light', 'dark', 'contrast' themes?
|
|
AETHER_CFG['app']['path_hosted_files_root']: str = None
|
|
AETHER_CFG['app']['path_hosted_tmp_root']: str = None
|
|
AETHER_CFG['app']['path_hosted_qr_images']: str = None # Will contain only QR code image files
|
|
|
|
## Aether API for Flask app configuration (pull from "cfg_flask" table)
|
|
AETHER_CFG['api'] = {}
|
|
AETHER_CFG['api']['protocol'] = os.getenv('AE_API_PROTOCOL', 'https') # 'https' # https
|
|
AETHER_CFG['api']['server'] = os.getenv('AE_API_SERVER', None) # 'dev-api.oneskyit.com' # linode.oneskyit.com vpn-linode linode.oneskyit.local
|
|
AETHER_CFG['api']['port'] = os.getenv('AE_API_PORT', '443') # '443' # default = 3306
|
|
AETHER_CFG['api']['path'] = os.getenv('AE_API_PATH', '') # ''
|
|
AETHER_CFG['api']['secret_key'] = os.getenv('AE_API_SECRET_KEY', None)
|
|
AETHER_CFG['api']['protocol_backup'] = 'http' # https
|
|
AETHER_CFG['api']['server_backup'] = 'dev-fastapi.oneskyit.local' # linode.oneskyit.com vpn-linode linode.oneskyit.local
|
|
AETHER_CFG['api']['port_backup'] = '5005' # default = 3306
|
|
AETHER_CFG['api']['path_backup'] = ''
|
|
AETHER_CFG['api']['secret_key_backup'] = 'the secret backup key'
|
|
AETHER_CFG['api']['temporary_token'] = {}
|
|
AETHER_CFG['api']['temporary_token']['token'] = None
|
|
AETHER_CFG['api']['temporary_token']['expire_on'] = None
|
|
|
|
## Aether database connection (pull from "cfg" table)
|
|
AETHER_CFG['db'] = {}
|
|
# AETHER_CFG['db']['server'] = 'linode.oneskyit.com' # vpn-linode linode.oneskyit.local
|
|
# AETHER_CFG['db']['port'] = '3306' # default = 3306
|
|
# AETHER_CFG['db']['name'] = 'aether_dev' #onesky_ams_dev
|
|
# AETHER_CFG['db']['username'] = 'osit_aether'
|
|
# AETHER_CFG['db']['password'] = ''
|
|
# AETHER_CFG['db']['uri'] = 'mysql://'+AETHER_CFG['db']['username']+':'+AETHER_CFG['db']['password']+'@'+AETHER_CFG['db']['server']+'/'+AETHER_CFG['db']['name'] # For SQL Alchemy DB connection
|
|
|
|
## Aether IDB client browser (pull from "cfg_flask" table)
|
|
AETHER_CFG['idb'] = {}
|
|
AETHER_CFG['idb']['name'] = 'osit'
|
|
|
|
# Aether app log files paths
|
|
AETHER_CFG['log_path'] = {}
|
|
AETHER_CFG['log_path']['app'] = '/logs/aether_app.log' # 'admin/log/app.log', '../../logs/aether_api.log'
|
|
AETHER_CFG['log_path']['app_warning'] = '/logs/aether_app_warning.log' # 'admin/log/app_warning.log' '../../logs/aether_api_warning.log'
|
|
|
|
## Aether Google's Recaptcha account (for One Sky IT; pull from "cfg" table)
|
|
AETHER_CFG['recaptcha'] = {}
|
|
AETHER_CFG['recaptcha']['url'] = 'https://www.google.com/recaptcha/api/siteverify'
|
|
AETHER_CFG['recaptcha']['secret_key'] = ''
|
|
|
|
## Aether SMTP email account (pull from "cfg" table)
|
|
AETHER_CFG['smtp'] = {}
|
|
# AETHER_CFG['smtp']['server'] = 'linode.oneskyit.com'
|
|
# AETHER_CFG['smtp']['port'] = '465'
|
|
# AETHER_CFG['smtp']['username'] = 'send_mail'
|
|
# AETHER_CFG['smtp']['password'] = '$onesky.Send_Mail.2021!'
|
|
|
|
## Aether Stripe account (for One Sky IT; pull from "cfg" table)
|
|
AETHER_CFG['stripe'] = {}
|
|
AETHER_CFG['stripe']['api_key'] = ''
|
|
AETHER_CFG['stripe']['publishable_key'] = ''
|
|
|
|
AETHER_CFG['stripe_dev'] = {}
|
|
AETHER_CFG['stripe_dev']['api_key'] = ''
|
|
AETHER_CFG['stripe_dev']['publishable_key'] = ''
|
|
|
|
## Aether modules (Event, Fundraising, Person, User, etc)
|
|
AETHER_CFG['mod_event'] = {}
|
|
AETHER_CFG['mod_event']['onsite_file_ext_change'] = [ 'ppt', 'pptx' ]
|
|
|
|
# ### ### #
|
|
|
|
|
|
## Legacy options just in case?
|
|
|
|
|
|
# Presentation management configuration options:
|
|
ONSITE_FILE_EXT_CHANGE = { 'ppt', 'pptx' }
|
|
|
|
|
|
# Server Hosted File Paths
|
|
FILES_PATH = {}
|
|
|
|
FILES_DIRECTORY = 'files/'
|
|
|
|
|
|
# Reference: https://en.wikipedia.org/wiki/List_of_file_formats
|
|
# ALLOWED_EXTENSIONS = set(['apng', 'pdf', 'pdfmac', 'pdfwin', 'png', 'jpg', 'jpeg', 'gif', 'svg', 'webp', 'zip', 'tar', 'gz', 'tgz', 'xz', 'rar', '7z', 'bz2', '3gp', 'aac', 'ac3', 'flac', 'm4a', 'mp3', 'ogg', 'avi', 'flv', 'm4v', 'mkv', 'mp4', 'mpg', 'mpeg', 'mov', 'qt', 'ts', 'webm', 'docx', 'xlsx', 'pptx', 'pptxmac', 'pptxwin', 'pptm', 'pptmmac', 'pptmwin', 'ppsm', 'ppsmmac', 'ppsmwin', 'ppt', 'pptmac', 'pptwin', 'key', 'keynote', 'odt', 'odp', 'odpmac', 'odpwin', 'ods', 'txt', 'heif', 'heifs', 'heic', 'heics', 'avci', 'avcs', 'avif', 'avifs'])
|
|
# ALLOWED_EXTENSIONS_DOCUMENTS = set(['txt', 'rtf', 'docx', 'xlsx', 'odt', 'ods', 'pdf'])
|
|
# ALLOWED_EXTENSIONS_IMAGES = set(['apng', 'gif', 'jpg', 'jpeg', 'png', 'svg', 'webp', 'heif', 'heifs', 'heic', 'heics', 'avci', 'avcs', 'avif', 'avifs'])
|
|
# ALLOWED_EXTENSIONS_AUDIO = set(['mp3', 'm4a', 'ogg', 'aac', 'flac', 'oga', 'opus', 'wma', 'webm'])
|
|
# ALLOWED_EXTENSIONS_VIDEO = set(['mp4', 'webm', 'mkv', 'avi', 'flv', 'mpg', 'mpeg', 'ts', 'ogg', 'mov', 'qt'])
|
|
# ALLOWED_EXTENSIONS_PRESENTATIONS = set(['key', 'keynote', 'pdf', 'pdfmac', 'pdfwin', 'ppt', 'pptx', 'pptxmac', 'pptxwin', 'pptm', 'pptmmac', 'pptmwin', 'ppsm', 'ppsmmac', 'ppsmwin', 'odp', 'odpmac', 'odpwin'])
|
|
|
|
# Google's Recaptcha
|
|
# GOOGLE_RECAPTCHA_URL = 'https://www.google.com/recaptcha/api/siteverify'
|
|
# GOOGLE_RECAPTCHA_SECRET_KEY = ''
|
|
|
|
# Keys for Stripe
|
|
# STRIPE_API_KEY = ''
|
|
# STRIPE_PUBLISHABLE_KEY = ''
|
|
|
|
|
|
# Poster presentation configuration options:
|
|
# POSTER_IDLE_TIME = 60000 # in milliseconds; 300 seconds = 5 minutes
|
|
# POSTER_HOLD_TIME = 15000 # in milliseconds; 15 seconds
|
|
|
|
|
|
# Badge printing configuration options:
|
|
# Path used for event badge QR code images (event_badge.id filenames).
|
|
# PATH_EVENT_BADGE_QR_IMAGES_ROOT = '/mnt/data_drive/Work_OneSkyIT/event_badges/qr_images' # Will contain only QR code image files
|
|
|
|
# TEST_CFG_OPTION = 'This is a test config option'
|