| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- from pathlib import Path
- from typing import Any
- from pydantic import BaseModel
- from pydantic_settings import BaseSettings
- class LogConfig(BaseModel):
- datetime_format: str = "%Y-%m-%d %H:%M:%S"
- LOG_LEVEL: str = "DEBUG" # 修改日志级别为 DEBUG
- LOG_DIR: Path = ''
- class Settings(BaseSettings):
- # 基础配置
- BASE_DIR: Path = Path(__file__).parent.parent.absolute()
- OUTPUT_DIR: Path = BASE_DIR / "output"
- APP_NAME: str = "proxy-pool"
- DEBUG: bool = True
- HOST: str = "0.0.0.0"
- PORT: int = 5010
- WORKERS: int = 1
- LOG_CONF: LogConfig = LogConfig(LOG_DIR = Path(OUTPUT_DIR / "logs"))
- SUBSCRIPTION_USER_AGENT: str = "clash-verge/v1.7.5"
-
- # mihomo 配置
- MIHOMO_BIN_PATH: Path = BASE_DIR / r"output\download\mihomo\mihomo-windows-amd64-go120.exe"
- MIHOMO_TEMP_PATH: Path = OUTPUT_DIR / "temp"
- MIHOMO_DOWNLOAD_URL: str = "https://github.com/MetaCubeX/mihomo/releases/download/v1.18.6/mihomo-windows-amd64-go120-v1.18.6.zip"
- # 路径配置
- PATH_CONFIG_DIR: Path = BASE_DIR / "output/configs"
- PATH_SUBSCRIPTION_DIR: Path = BASE_DIR / "output/subscriptions"
-
- APP_CONFIG:Path = BASE_DIR / "config/app.yaml"
- class Config:
- case_sensitive = True
- settings = Settings()
|