hisham-cmd's picture
Full Sync: Explicit Commit Operations (Pure & Optimized)
b2be963 verified
Raw
History Blame Contribute Delete
1.08 kB
from pydantic_settings import BaseSettings
from typing import List
import os
class Settings(BaseSettings):
# Base directory for persistent data (e.g., /data for Hugging Face persistent storage)
DATA_DIR: str = os.getenv("DATA_DIR", ".")
DATABASE_URL: str = os.getenv("DATABASE_URL", f"sqlite:///{os.path.join(os.getenv('DATA_DIR', '.'), 'vortex.db')}")
TURSO_AUTH_TOKEN: str = os.getenv("TURSO_AUTH_TOKEN", "")
JWT_SECRET: str = "change-me-in-production"
JWT_ALGORITHM: str = "HS256"
ACCESS_TOKEN_EXPIRE_MINUTES: int = 30
REFRESH_TOKEN_EXPIRE_DAYS: int = 7
GOOGLE_CLIENT_ID: str = ""
GOOGLE_CLIENT_SECRET: str = ""
CORS_ORIGINS: str = "http://localhost:3000,http://localhost:3001,https://ofoq-commerce.vercel.app"
@property
def cors_origins_list(self) -> List[str]:
return [origin.strip() for origin in self.CORS_ORIGINS.split(",")]
model_config = {
"env_file": ".env",
"env_file_encoding": "utf-8",
"extra": "ignore",
}
settings = Settings()