feat: 支持托管到Metrix应用包并移除授权与平台模式

- 新增 scripts/package_metrix.py 打包应用包(user_auth=metrix、admin_auth=none、数据目录 /data)
- 托管模式只认平台代理身份,停用应用登录与改密码,新增 /api/session
- 后端按 X-Forwarded-Prefix 注入 <base href>,前端改为相对路径构建并按 basePath 请求
- 托管时隐藏登录页、退出按钮和修改密码页,顶栏显示 Metrix 用户名
- 移除授权到期校验、激活码和连点品牌图标打开的授权延期窗口
- 移除 Metrix 平台数据源/仓库模式及相关配置、接口、设置页和 requests 依赖
- 新增托管鉴权与 base href 注入测试,更新使用与开发文档
This commit is contained in:
2026-11-06 16:22:32 +08:00
parent 488c5406c4
commit 22fbf47577
45 changed files with 548 additions and 2195 deletions
-13
View File
@@ -1,5 +1,4 @@
import logging
from typing import Any
from app import state
@@ -17,18 +16,6 @@ def set_task_stage(task_id: str, stage: str, logs: list[str], status: str = "pro
state.global_task_lock["stage"] = stage
def log_license_check(logger: Any, info: Any) -> None:
if info.current_date:
logger.info(
f"授权校验通过,数据日期: {info.current_date.isoformat()},"
f"到期日期: {info.expires_on.isoformat()}"
)
elif info.zip_count:
logger.warning("未从 ZIP 文件名识别到日期,已跳过授权日期比对")
else:
logger.warning("未找到 ZIP 文件,已跳过授权日期比对")
def apply_history_retention_safely() -> None:
try:
state.apply_history_retention()