This commit is contained in:
2026-07-06 18:30:50 +08:00
parent 2b1c27c36c
commit cee25b63e1
17 changed files with 102 additions and 837 deletions
+9 -8
View File
@@ -1,17 +1,14 @@
import os
import sys
from pathlib import Path
from pydantic_settings import BaseSettings, SettingsConfigDict
try:
os.chdir(os.path.dirname(sys.argv[0]))
except Exception:
pass
BACKEND_DIR = Path(__file__).resolve().parents[1]
class Config(BaseSettings):
DEBUG_MODE: bool = True
WORKERS: int = 1
PORT:int = 27173
PORT: int = 27173
MCPPORT: int = 27174
REDIS_URL: str = 'redis://localhost:6379/1'
COLG_TOKEN: str = ''
@@ -19,7 +16,11 @@ class Config(BaseSettings):
HELPER_ID: str = ''
model_config = SettingsConfigDict(
env_file=('config/.env', 'config/.env.dev', 'config/.env.prod'),
env_file=(
str(BACKEND_DIR / 'config' / '.env'),
str(BACKEND_DIR / 'config' / '.env.dev'),
str(BACKEND_DIR / 'config' / '.env.prod'),
),
extra='ignore',
)