52 lines
1.4 KiB
Python
52 lines
1.4 KiB
Python
from pydantic_settings import BaseSettings
|
|
from typing import List
|
|
import json
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
# Firebase
|
|
firebase_service_account_path: str = "./firebase-service-account.json"
|
|
firebase_storage_bucket: str = ""
|
|
|
|
# JWT
|
|
jwt_secret_key: str = "change-me-in-production"
|
|
jwt_algorithm: str = "HS256"
|
|
jwt_expiration_minutes: int = 480
|
|
|
|
# MQTT
|
|
mqtt_broker_host: str = "localhost"
|
|
mqtt_broker_port: int = 1883
|
|
mqtt_admin_username: str = "admin"
|
|
mqtt_admin_password: str = ""
|
|
mqtt_secret: str = "change-me-in-production"
|
|
mosquitto_password_file: str = "/etc/mosquitto/passwd"
|
|
|
|
# SQLite (MQTT data storage)
|
|
sqlite_db_path: str = "./mqtt_data.db"
|
|
mqtt_data_retention_days: int = 90
|
|
|
|
# Local file storage
|
|
built_melodies_storage_path: str = "./storage/built_melodies"
|
|
firmware_storage_path: str = "./storage/firmware"
|
|
|
|
# Email (Resend)
|
|
resend_api_key: str = "re_placeholder_change_me"
|
|
email_from: str = "noreply@yourdomain.com"
|
|
|
|
# App
|
|
backend_cors_origins: str = '["http://localhost:5173"]'
|
|
debug: bool = True
|
|
|
|
# Auto-deploy (Gitea webhook)
|
|
deploy_secret: str = ""
|
|
deploy_project_path: str = "/app"
|
|
|
|
@property
|
|
def cors_origins(self) -> List[str]:
|
|
return json.loads(self.backend_cors_origins)
|
|
|
|
model_config = {"env_file": ".env", "extra": "ignore"}
|
|
|
|
|
|
settings = Settings()
|