- AI service: replace allow_origins=["*"] with env-configured AI_CORS_ORIGINS - Payment services (VNPay, MoMo, ZaloPay): use requireEnv() instead of empty string defaults for credentials - Search indexer: replace raw SQL template literals with Prisma findMany + parameterized PostGIS queries Co-Authored-By: Paperclip <noreply@paperclip.ing>
23 lines
547 B
Python
23 lines
547 B
Python
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
app_name: str = "Goodgo AI Services"
|
|
debug: bool = False
|
|
model_path: str = "/app/models"
|
|
log_level: str = "info"
|
|
cors_origins: str = ""
|
|
api_key: str = ""
|
|
rate_limit: str = "60/minute"
|
|
|
|
model_config = {"env_prefix": "AI_"}
|
|
|
|
@property
|
|
def cors_origin_list(self) -> list[str]:
|
|
if not self.cors_origins:
|
|
return []
|
|
return [o.strip() for o in self.cors_origins.split(",") if o.strip()]
|
|
|
|
|
|
settings = Settings()
|