feat: add data backup/import, goal step ordering, and PostgreSQL migration
- Add GET /api/backup/export and POST /api/backup/import endpoints for full data backup
- Add drag-and-drop reorder for goal steps with PUT /api/goals/{id}/steps/reorder
- Auto-assign sort_order on step creation (preserves creation order)
- Fix duplicate milestone rendering in goal detail page
- Add category management button in goal dialog
- Migrate database default from SQLite to PostgreSQL
- Fix router guard redirect loop for logged-in users on setup/login pages
- Fix ALTER TABLE ADD COLUMN crash on callable defaults (uuid.uuid4)
- Add auth status rate limiter and token version caching
- Update CLAUDE.md to reflect current architecture
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -9,8 +9,10 @@ _logger = logging.getLogger("app.config")
|
||||
_BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
# 数据库配置
|
||||
DATABASE_PATH = os.path.join(_BASE_DIR, "data", "todo.db")
|
||||
DATABASE_URL = f"sqlite:///{DATABASE_PATH}"
|
||||
DATABASE_URL = os.getenv(
|
||||
"DATABASE_URL",
|
||||
"postgresql://ToDoList:53N2PTSjMBPDy6zY@192.168.1.86:5432/ToDoList",
|
||||
)
|
||||
|
||||
# WebUI 配置
|
||||
WEBUI_PATH = os.path.join(_BASE_DIR, "webui")
|
||||
@@ -49,3 +51,4 @@ def _load_jwt_secret() -> str:
|
||||
|
||||
JWT_SECRET = _load_jwt_secret()
|
||||
ACCESS_TOKEN_EXPIRE_MINUTES = 1440 # 24小时
|
||||
ACCESS_TOKEN_EXPIRE_SECONDS = ACCESS_TOKEN_EXPIRE_MINUTES * 60
|
||||
Reference in New Issue
Block a user