chore(release): v0.5.0-beta 发版准备

主要改动:

backend 业务:
- feat(error-codes): 统一错误码表 E1011/E1012 拆码
  - E1011 AUTH_PASSWORD_WRONG: 本地密码错误
  - E1012 AUTH_FIRST_LOGIN_PASSWORD_REQUIRED: 首次登录请先设置密码
  - E1015 AUTH_OLD_PASSWORD_REQUIRED: 改密需要旧密码
  - E1016 AUTH_OLD_PASSWORD_WRONG: 旧密码错误
- fix(agents): P0 降级放行时,如坐席已注册但未设密码,正确 raise 1012
  (修复前会撞 1011 本地密码错误,与场景不符)
- feat(approval): 审批模块 (T审批/A审批)
- feat(config): approval_template_resource / approval_template_device 配置
- feat(main): /ready, /metrics, /version 端点(K8s 友好)

backend 测试:
- test(agents): 新增 test_agents.py — 3 个 Fix-4 降级登录测试
  - 错误密码拒绝
  - 缺密码拒绝
  - 正确密码通过
  pytest tests/test_agents.py → 3/3 通过
- test(conftest): 模块级 mock + slowapi 限流重置 + UTF-8 patch
  解决 Windows pytest GBK 读 .env 失败 + 降级路径无法测试

仓库治理:
- chore(gitignore): 排除 .workbuddy/memory/(workbuddy 本地记忆)
- chore(docs): 重命名两份 IT 文档(前缀加智能区分版本)

部署与文档:
- docs: RELEASE_NOTES_v0.5.0-beta.md / dashboard.html / 需求-发版预览页面
- docs: 部署、架构、PRD、安全、评审报告等同步 v0.5.0-beta
- deploy-server: 打包脚本、nginx、docker-compose 版本号 bump

前端 (frontend-h5 / frontend-agent / frontend-admin / frontend-portal):
- index.html / package.json 版本号与构建号 bump

自动验收(RELEASE_NOTES L100-104):
- [x] pytest tests/test_agents.py -v → 3 passed
- [x] grep Bs7ucT backend frontend-h5 frontend-agent → 无输出
- [x] grep AppException(101[123]) backend → 仅 1 处(登录场景 1012)
- [ ] npm run build (frontend-h5 / frontend-agent) → 合并后跑

后续: 合并 feature/t-1-t4-merge → main,tag v0.5.0-beta
This commit is contained in:
Simon
2026-06-15 14:14:58 +08:00
parent 93ba41ed79
commit 364e688382
68 changed files with 1354 additions and 146 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
# 企微IT智能服务台 — 服务器部署指南
# 企微智能IT支持服务台 — 服务器部署指南
> 目标服务器:`10.90.5.110`Linux
> 域名:`itsupport.servyou.com.cn`
+2 -2
View File
@@ -1,4 +1,4 @@
# IT智能服务台 — 新服务器部署手册
# 智能IT支持服务台 — 新服务器部署手册
> **目标服务器**`10.80.0.136`(公司内网)
> **域名**`itsupport.servyou.com.cn`
@@ -53,7 +53,7 @@ Host bastion
Port 2222
User sxn
# IT智能服务台服务器
# 智能IT支持服务台服务器
Host itdesk
HostName 10.80.0.136
User sxn
+2 -2
View File
@@ -1,5 +1,5 @@
# =============================================================================
# 企微IT智能服务台 — 打包 + 构建后端镜像 + 部署脚本
# 企微智能IT支持服务台 — 打包 + 构建后端镜像 + 部署脚本
# =============================================================================
# 功能:
# 1. 打包前端构建产物 + nginx配置 + docker-compose.yml + .env
@@ -51,7 +51,7 @@ function Write-Error {
Write-Host ""
Write-Host "========================================" -ForegroundColor Cyan
Write-Host " 企微IT智能服务台 — 打包部署自动化" -ForegroundColor Cyan
Write-Host " 企微智能IT支持服务台 — 打包部署自动化" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
Write-Host " 模式:$Mode" -ForegroundColor White
Write-Host ""
+2 -2
View File
@@ -1,5 +1,5 @@
# =============================================================================
# 企微IT智能服务台 — 打包部署脚本
# 企微智能IT支持服务台 — 打包部署脚本
# =============================================================================
# 功能:将所有部署所需文件打包成一个 zip 文件
# 用法:在 PowerShell 中运行此脚本
@@ -19,7 +19,7 @@ $packageDir = "$deployDir\_package"
$zipFile = "$deployDir\it-smart-desk-server-deploy.zip"
Write-Host "========================================" -ForegroundColor Cyan
Write-Host " 企微IT智能服务台 — 打包部署文件" -ForegroundColor Cyan
Write-Host " 企微智能IT支持服务台 — 打包部署文件" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
Write-Host ""
+2 -2
View File
@@ -1,6 +1,6 @@
#!/bin/bash
# =============================================================================
# IT智能服务台 — RAGFlow 集成部署脚本
# 智能IT支持服务台 — RAGFlow 集成部署脚本
# 目标服务器:10.90.5.110
# 部署路径:/opt/wecom-it-desk
# =============================================================================
@@ -11,7 +11,7 @@ DEPLOY_DIR="/opt/wecom-it-desk"
BACKUP_DIR="/opt/wecom-it-desk-backup-$(date +%Y%m%d_%H%M%S)"
echo "=========================================="
echo "IT智能服务台 — RAGFlow 集成部署"
echo "智能IT支持服务台 — RAGFlow 集成部署"
echo "时间: $(date)"
echo "=========================================="
+2 -2
View File
@@ -1,6 +1,6 @@
#!/bin/bash
# =============================================================================
# IT智能服务台 — 生产部署脚本
# 智能IT支持服务台 — 生产部署脚本
# 目标服务器:10.90.5.110
# 部署路径:/opt/wecom-it-desk
# =============================================================================
@@ -11,7 +11,7 @@ DEPLOY_DIR="/opt/wecom-it-desk"
BACKUP_DIR="/opt/wecom-it-desk-backup-$(date +%Y%m%d_%H%M%S)"
echo "=========================================="
echo "IT智能服务台 生产部署"
echo "智能IT支持服务台 生产部署"
echo "时间: $(date)"
echo "=========================================="
+1 -1
View File
@@ -1,5 +1,5 @@
# =============================================================================
# 企微IT智能服务台 — Docker Compose(公司内网服务器版)
# 企微智能IT支持服务台 — Docker Compose(公司内网服务器版)
# =============================================================================
# 目标服务器:10.90.5.110
# 域名:itsupport.servyou.com.cn
+18 -1
View File
@@ -1,5 +1,5 @@
# =============================================================================
# 企微IT智能服务台 — Nginx 配置(公司内网服务器版 + HTTPS)
# 企微智能IT支持服务台 — Nginx 配置(公司内网服务器版 + HTTPS)
# =============================================================================
# 目标服务器:10.90.5.110
# 域名:itsupport.servyou.com.cn
@@ -47,6 +47,23 @@ http {
application/javascript application/xml+rss
application/json application/ld+json;
# ------------------------------------------------------------------
# 安全响应头
# ------------------------------------------------------------------
# 隐藏 nginx 版本号
server_tokens off;
# 基础安全头(应用到所有响应)
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
add_header X-Frame-Options "DENY" always;
add_header X-XSS-Protection "0" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Permissions-Policy "camera=(), microphone=(), geolocation=(), payment=()" always;
add_header Cross-Origin-Opener-Policy "same-origin" always;
# API 路径特殊处理(不加 CSP,只加基础安全头)
# 前端路径的 CSP 在各前端 index.html 中单独配置
# =================================================================
# 上游服务定义(Docker 内部网络)
# =================================================================
+14 -2
View File
@@ -1,5 +1,5 @@
# =============================================================================
# 企微IT智能服务台 — Nginx 配置(公司内网服务器版)
# 企微智能IT支持服务台 — Nginx 配置(公司内网服务器版)
# =============================================================================
# 适用场景:独立域名 itsupport.servyou.com.cn,公司内网 DNS 解析
# 与 NAS 版的区别:
@@ -67,12 +67,24 @@ http {
# ------------------------------------------------------------------
# 安全头
# ------------------------------------------------------------------
# 基础安全头
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:;" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
# CSP 收紧: 去掉 unsafe-inline(生产不需要,只有 dev HMR 需要)
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-eval' https://res.wx.qq.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: https: http:; connect-src 'self' https://qyapi.weixin.qq.com wss://*; font-src 'self' data:;" always;
# 隐私与跨域控制
add_header Permissions-Policy "camera=(), microphone=(), geolocation=(), payment=()" always;
add_header Cross-Origin-Opener-Policy "same-origin" always;
add_header Cross-Origin-Embedder-Policy "require-corp" always;
add_header Cross-Origin-Resource-Policy "same-origin" always;
# 隐藏服务器版本
server_tokens off;
# ------------------------------------------------------------------
# 健康检查端点
+2 -2
View File
@@ -1,11 +1,11 @@
@echo off
REM =============================================================================
REM IT智能服务台 — 打包部署脚本(Windows)
REM 智能IT支持服务台 — 打包部署脚本(Windows)
REM 目标:生成部署包,通过堡垒机上传到服务器
REM =============================================================================
echo ==========================================
echo IT智能服务台 部署包打包
echo 智能IT支持服务台 部署包打包
echo 时间: %date% %time%
echo ==========================================
+2 -2
View File
@@ -1,5 +1,5 @@
"""
企微IT智能服务台 — 部署包生成脚本(Windows 兼容版)
企微智能IT支持服务台 — 部署包生成脚本(Windows 兼容版)
=======================================================
功能:
1. 构建前端(H5 + 坐席端)
@@ -163,7 +163,7 @@ def create_package():
def main():
print("=" * 50)
print(" IT智能服务台 — 部署包生成")
print(" 智能IT支持服务台 — 部署包生成")
print("=" * 50)
# 检查是否跳过构建
+2 -2
View File
@@ -1,6 +1,6 @@
#!/bin/bash
# =============================================================================
# 企微IT智能服务台 — 部署包生成脚本(在开发机上运行)
# 企微智能IT支持服务台 — 部署包生成脚本(在开发机上运行)
# =============================================================================
# 功能:
# 1. 构建前端(H5 + 坐席端)
@@ -28,7 +28,7 @@ PACKAGE_NAME="it-smart-desk-server-deploy"
BUILD_DIR="/tmp/$PACKAGE_NAME"
echo -e "${GREEN}============================================${NC}"
echo -e "${GREEN} IT智能服务台 — 部署包生成${NC}"
echo -e "${GREEN} 智能IT支持服务台 — 部署包生成${NC}"
echo -e "${GREEN}============================================${NC}"
# --- 1. 构建前端 ---
+2 -2
View File
@@ -1,6 +1,6 @@
@echo off
REM =============================================================================
REM 企微IT智能服务台 — 打包部署一键执行
REM 企微智能IT支持服务台 — 打包部署一键执行
REM =============================================================================
REM 功能:
REM 1. 打包前端构建产物 + nginx配置 + docker-compose.yml + .env
@@ -20,7 +20,7 @@ if "%MODE%"=="" set MODE=local
echo.
echo ========================================
echo 企微IT智能服务台 — 打包部署
echo 企微智能IT支持服务台 — 打包部署
echo ========================================
echo 模式: %MODE%
echo.