-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
29 lines (23 loc) · 1.02 KB
/
Copy pathconfig.py
File metadata and controls
29 lines (23 loc) · 1.02 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
from __future__ import annotations
import os
from pathlib import Path
class Settings:
def __init__(self) -> None:
self.app_name = os.getenv("APP_NAME", "Next-Gen-IT Audit API")
self.app_env = os.getenv("APP_ENV", "development")
self.cors_origins = [
origin.strip()
for origin in os.getenv(
"APP_CORS_ORIGINS",
"http://localhost:4173,http://127.0.0.1:4173",
).split(",")
if origin.strip()
]
self.data_dir = Path(os.getenv("DATA_DIR", "./data")).resolve()
self.report_dir = Path(os.getenv("REPORT_DIR", str(self.data_dir / "reports"))).resolve()
self.upload_dir = Path(os.getenv("UPLOAD_DIR", str(self.data_dir / "uploads"))).resolve()
self.openai_api_key = os.getenv("OPENAI_API_KEY", "").strip()
self.data_dir.mkdir(parents=True, exist_ok=True)
self.report_dir.mkdir(parents=True, exist_ok=True)
self.upload_dir.mkdir(parents=True, exist_ok=True)
settings = Settings()