34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
secret_key: str = "change-me-in-production-use-openssl-rand-hex-32"
|
|
algorithm: str = "HS256"
|
|
access_token_expire_minutes: int = 60 * 24
|
|
database_url: str = "postgresql+psycopg2://doceditor:doceditor@localhost:5432/doceditor"
|
|
upload_dir: str = "./uploads"
|
|
export_dir: str = "./exports"
|
|
admin_email: str = "admin@localhost"
|
|
admin_username: str = "admin"
|
|
admin_password: str = "admin123"
|
|
frontend_url: str = "http://localhost:5173"
|
|
cors_origins: str = "http://localhost:5173,http://localhost:3000,http://127.0.0.1:5173"
|
|
smtp_host: str = ""
|
|
smtp_port: int = 587
|
|
smtp_user: str = ""
|
|
smtp_password: str = ""
|
|
smtp_from: str = ""
|
|
smtp_use_tls: bool = True
|
|
activation_code_expire_hours: int = 24
|
|
password_reset_code_expire_hours: int = 1
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
|
|
@property
|
|
def cors_origin_list(self) -> list[str]:
|
|
return [o.strip() for o in self.cors_origins.split(",") if o.strip()]
|
|
|
|
|
|
settings = Settings()
|