feat: upgrade to V1.2 - Tags, Click Stats, and Robust WebDAV

- add Tagging system (backend and frontend)
- add Click count statistics and redirection logic
- add config.example.py
- fix WebDAV MKCOL 405 error and response handling
- fix redirection loop during force password change
- audit SQL queries for security
This commit is contained in:
OpenClaw Agent
2026-02-13 07:58:11 +08:00
parent 521cd9ba42
commit c0cdd146b1
11 changed files with 1559 additions and 749 deletions

View File

@@ -1,24 +1,24 @@
# -*- coding: utf-8 -*-
"""ToNav 配置文件"""
import os
from datetime import timedelta
class Config:
"""基础配置"""
# Flask 配置
SECRET_KEY = os.environ.get('TONAV_SECRET_KEY') or 'tonav-secret-key-change-in-production-2026'
# 基础配置
SECRET_KEY = os.environ.get('TONAV_SECRET_KEY', 'dev-key-7306783874')
DATABASE_PATH = os.environ.get('TONAV_DB_PATH', os.path.join(os.path.dirname(__file__), 'tonav.db'))
# 服务运行配置
HOST = os.environ.get('TONAV_HOST', '127.0.0.1')
PORT = int(os.environ.get('TONAV_PORT', 9519))
DEBUG = os.environ.get('TONAV_DEBUG', 'False').lower() == 'true'
# 健康检查
HEALTH_CHECK_INTERVAL = 60
HEALTH_CHECK_TIMEOUT = 15
# 日志配置
LOG_FILE = os.path.join(os.path.dirname(__file__), 'tonav.log')
LOG_LEVEL = os.environ.get('TONAV_LOG_LEVEL', 'INFO')
# 数据库配置
DATABASE_PATH = os.path.join(os.path.dirname(__file__), 'tonav.db')
# 服务配置
HOST = '127.0.0.1'
PORT = 9519
DEBUG = False
# 健康检查配置
HEALTH_CHECK_INTERVAL = 60 # 检测间隔(秒)
HEALTH_CHECK_TIMEOUT = 15 # 检测超时(秒)
# 分页配置
ITEMS_PER_PAGE = 20
# 会话配置
PERMANENT_SESSION_LIFETIME = timedelta(days=7)