mirror of
https://github.com/Rarebuffalo/securelens-backend.git
synced 2026-06-19 07:00:30 +00:00
35 lines
936 B
Python
35 lines
936 B
Python
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
app_name: str = "SecureLens AI"
|
|
app_version: str = "1.0.0"
|
|
debug: bool = False
|
|
|
|
host: str = "0.0.0.0"
|
|
port: int = 8000
|
|
|
|
cors_origins: str = "http://localhost:3000,http://localhost:5173"
|
|
|
|
rate_limit: str = "30/minute"
|
|
|
|
scan_timeout: int = 5
|
|
path_check_timeout: int = 3
|
|
|
|
database_url: str = "postgresql+asyncpg://securelens:securelens@localhost:5433/securelens"
|
|
|
|
jwt_secret: str = "change-me-in-production-use-a-long-random-string"
|
|
jwt_algorithm: str = "HS256"
|
|
jwt_expiry_minutes: int = 1440
|
|
|
|
openai_api_key: str | None = None
|
|
|
|
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8")
|
|
|
|
@property
|
|
def cors_origin_list(self) -> list[str]:
|
|
return [origin.strip() for origin in self.cors_origins.split(",") if origin.strip()]
|
|
|
|
|
|
settings = Settings()
|