fix: fail closed on production settings

This commit is contained in:
2026-08-04 11:05:04 +08:00
parent 44bf6e003e
commit fd9bb0a436
3 changed files with 33 additions and 2 deletions
+2 -1
View File
@@ -2,6 +2,7 @@
from pydantic import Field
from pydantic_settings import BaseSettings
from typing import Literal
LEGACY_DEFAULT_SECRET = "change-me-to-a-long-random-string"
@@ -9,7 +10,7 @@ LEGACY_DEFAULT_SECRET = "change-me-to-a-long-random-string"
class Settings(BaseSettings):
# ---------- 运行环境 ----------
environment: str = "development"
environment: Literal["development", "test", "production"] = "development"
# ---------- 数据库 ----------
DATABASE_URL: str = "sqlite+aiosqlite:///./pingwatch.db"