import os class Settings: def __init__(self): self.healthie_api_key = os.environ.get("HEALTHIE_API_KEY", "") self.healthie_api_base_url = os.environ.get("HEALTHIE_API_BASE_URL", "") self.form_template_id = os.environ.get("FORM_TEMPLATE_ID", "2360739") self.recaptcha_site_key = os.environ.get("RECAPTCHA_SITE_KEY", "") self.recaptcha_secret_key = os.environ.get("RECAPTCHA_SECRET_KEY", "") self.rate_limit_max = int(os.environ.get("RATE_LIMIT_MAX", "5")) self.rate_limit_window = int(os.environ.get("RATE_LIMIT_WINDOW", "3600")) self.form_timeout = int(os.environ.get("FORM_TIMEOUT", "1800")) self.refresh_interval = int(os.environ.get("REFRESH_INTERVAL", "300")) self.upload_max_bytes = int( os.environ.get("UPLOAD_MAX_BYTES", str(10 * 1024 * 1024)) ) self.max_uploads_per_session = int(os.environ.get("MAX_UPLOADS_PER_SESSION", "5")) self.debug = os.environ.get("DEBUG", "").lower() in ("true", "1", "yes") _settings = None def settings() -> Settings: global _settings if _settings is None: _settings = Settings() return _settings