46 lines
1.0 KiB
Python
46 lines
1.0 KiB
Python
"""
|
|
Application settings loaded from .env file.
|
|
"""
|
|
|
|
from pydantic_settings import BaseSettings
|
|
from typing import List
|
|
import json
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
# Database
|
|
DATABASE_URL: str = "sqlite+aiosqlite:///./foxy_dev_team.db"
|
|
|
|
# Telegram
|
|
TELEGRAM_BOT_TOKEN: str = ""
|
|
TELEGRAM_CHAT_ID: str = ""
|
|
|
|
# OpenClaw
|
|
FOXY_HOME: str = "/home/foxy/.openclaw"
|
|
FOXY_WORKSPACE: str = "/home/foxy/.openclaw/workspace"
|
|
|
|
# Gitea
|
|
GITEA_SERVER: str = ""
|
|
GITEA_OPENCLAW_TOKEN: str = ""
|
|
|
|
# Deployment
|
|
DEPLOYMENT_SERVER: str = ""
|
|
DEPLOYMENT_USER: str = ""
|
|
DEPLOYMENT_PWD: str = ""
|
|
|
|
# App
|
|
LOG_LEVEL: str = "info"
|
|
CORS_ORIGINS: str = '["http://localhost:5173"]'
|
|
|
|
@property
|
|
def cors_origins_list(self) -> List[str]:
|
|
try:
|
|
return json.loads(self.CORS_ORIGINS)
|
|
except (json.JSONDecodeError, TypeError):
|
|
return ["http://localhost:5173"]
|
|
|
|
model_config = {"env_file": ".env", "env_file_encoding": "utf-8"}
|
|
|
|
|
|
settings = Settings()
|