- 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
25 lines
787 B
Python
25 lines
787 B
Python
# -*- coding: utf-8 -*-
|
|
import os
|
|
from datetime import timedelta
|
|
|
|
class Config:
|
|
# 基础配置
|
|
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')
|
|
|
|
# 会话配置
|
|
PERMANENT_SESSION_LIFETIME = timedelta(days=7)
|