Working on Aether configs

This commit is contained in:
Scott Idem
2022-07-07 15:01:17 -04:00
parent ead68b24a3
commit 5a390a2c2b
2 changed files with 25 additions and 14 deletions

View File

@@ -1,19 +1,35 @@
import os, secrets
# import os, secrets
from pydantic import AnyHttpUrl, BaseSettings, EmailStr, HttpUrl, PostgresDsn, validator
from typing import Any, Dict, List, Optional, Union
class Settings(BaseSettings):
APP_NAME: str = "Aether API"
ADMIN_EMAIL: EmailStr = 'example@example.com'
AETHER_CFG = {}
AETHER_CFG['id'] = 0
AETHER_CFG['api_id'] = 0
AETHER_DB_SERVER = 'xxx'
AETHER_DB_PORT = '3306' # default = 3306
AETHER_DB_NAME = 'xxx'
AETHER_DB_USERNAME = 'xxx'
AETHER_DB_PASSWORD = 'xxx'
SQLALCHEMY_DATABASE_URI = 'mysql://'+AETHER_DB_USERNAME+':'+AETHER_DB_PASSWORD+'@'+AETHER_DB_SERVER+'/'+AETHER_DB_NAME
APP_NAME: str = "Aether API (FastAPI)"
ADMIN_EMAIL: EmailStr = 'Aether.Admin@oneskyit.com'
# Database Connection
DB = {}
DB['server'] = 'linode.oneskyit.com' # vpn-linode linode.oneskyit.local
DB['port'] = '3306' # default = 3306
DB['name'] = 'aether_dev' #onesky_ams_dev
DB['username'] = ''
DB['password'] = ''
SQLALCHEMY_DB_URI = 'mysql://'+DB['username']+':'+DB['password']+'@'+DB['server']+'/'+DB['name']
# Send SMTP Email
SMTP = {}
# Server Hosted File Paths
FILES_PATH = {}
# HTTP Status Dict List
HTTP_STATUS_LI = {}
HTTP_STATUS_LI[200] = { 'name': 'OK', 'message': 'The request has succeeded.' }
HTTP_STATUS_LI[400] = { 'name': 'Bad Request', 'message': 'The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.' }
@@ -29,9 +45,4 @@ class Settings(BaseSettings):
HTTP_STATUS_LI[503] = { 'name': 'Service Unavailable', 'message': 'The server is currently unable to handle the request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the delay MAY be indicated in a Retry-After header. If no Retry-After is given, the client SHOULD handle the response as it would for a 500 response.' }
HTTP_STATUS_LI[504] = { 'name': 'Gateway Timeout', 'message': 'The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server specified by the URI (e.g. HTTP, FTP, LDAP) or some other auxiliary server (e.g. DNS) it needed to access in attempting to complete the request.' }
PATH_HOSTED_FILES_ROOT = '/mnt/data_drive/srv/data/osit_app/hosted_hashed_dev' # Will contain only hashed files
PATH_HOSTED_TMP_ROOT = '/mnt/data_drive/srv/data/osit_app/hosted_tmp_dev' # Will contain only temporary files
DB_CFG_FASTAPI_ID = 0
settings = Settings()