-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.py
More file actions
37 lines (31 loc) · 1.13 KB
/
config.py
File metadata and controls
37 lines (31 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
app_name: str = 'Queue Manager'
app_server_name: str = 'queue.api2app.ru'
admin_email: str = 'aaa@bbb.cc'
api_keys: str = ''
sqlite_db_name: str = 'app_database.db'
mysql_connection_string: str = 'user:pass@some_mariadb/dbname?charset=utf8mb4'
max_execution_time: int = 14400
max_store_time: int = 43200
gdrive_folder_id: str = ''
yadisk_token: str = ''
ws_enabled: str = 'true'
ws_port: int = 8765
tg_bot_token: str = ''
tg_chat_id: str = ''
bothub_api_key: str = ''
vsegpt_api_key: str = ''
use_task_api_keys: bool = False
redis_host: str = 'localhost'
redis_port: int = 6379
redis_db: int = 10
cors_allowed_origins: str = 'http://localhost,http://localhost:8001,http://localhost:4200,http://127.0.0.1:4200'
class Config:
env_file = '.env'
def cors_origins_list(self) -> list[str]:
raw = (self.cors_allowed_origins or '').strip()
if not raw:
return []
return [p.strip().rstrip('/') for p in raw.split(',') if p.strip()]
settings = Settings()