From 36e420b0c2ce5a12c7870fe049758474a4c45a1c Mon Sep 17 00:00:00 2001 From: WuYongJie Date: Fri, 28 Aug 2026 22:38:45 +0800 Subject: [PATCH] =?UTF-8?q?ops:=20=E7=99=BB=E8=AE=B0=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E7=9B=91=E6=8E=A7=E9=80=9A=E7=9F=A5=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 2 +- scripts/deploy-material-host.sh | 5 +++++ src/__tests__/deployment.test.ts | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 913d6f4..6a441e9 100644 --- a/.env.example +++ b/.env.example @@ -16,7 +16,7 @@ DINGTALK_LOGIN_TICKET_TTL_SECONDS=60 # 每个项目必须使用不同密钥;allowedHosts 用于限制卡片跳转域名。 # login 省略或 enabled=false 时保持原直接跳转,不启用免登中转。 # 生产环境请使用足够长的随机密钥,不要把真实值提交到 Git。 -YYD_NOTIFICATION_PROJECTS_JSON=[{"code":"material_library","name":"素材库","secret":"replace-with-random-secret","allowedHosts":["sc.example.com"],"recipients":[{"alias":"示例花名","userId":"replace-with-dingtalk-user-id"}]},{"code":"fixed_asset","name":"固定资产","secret":"replace-with-another-random-secret","allowedHosts":["asset.example.com"],"login":{"enabled":true,"callbackUrl":"https://asset.example.com/api/dingtalk/broker-login","allowedRedirectPathPrefixes":["/workflows/disposals","/dashboard"]}},{"code":"furniture_platform","name":"家具业务系统","secret":"replace-with-furniture-random-secret","allowedHosts":["cp.example.com"]}] +YYD_NOTIFICATION_PROJECTS_JSON=[{"code":"material_library","name":"素材库","secret":"replace-with-random-secret","allowedHosts":["sc.example.com"],"recipients":[{"alias":"示例花名","userId":"replace-with-dingtalk-user-id"}]},{"code":"fixed_asset","name":"固定资产","secret":"replace-with-another-random-secret","allowedHosts":["asset.example.com"],"login":{"enabled":true,"callbackUrl":"https://asset.example.com/api/dingtalk/broker-login","allowedRedirectPathPrefixes":["/workflows/disposals","/dashboard"]}},{"code":"furniture_platform","name":"家具业务系统","secret":"replace-with-furniture-random-secret","allowedHosts":["cp.example.com"]},{"code":"script_monitor","name":"脚本监控","secret":"replace-with-script-monitor-random-secret","allowedHosts":["cp.example.com"]}] WORKER_ENABLED=true WORKER_INTERVAL_MS=1000 diff --git a/scripts/deploy-material-host.sh b/scripts/deploy-material-host.sh index 50c58ea..42bd8aa 100644 --- a/scripts/deploy-material-host.sh +++ b/scripts/deploy-material-host.sh @@ -193,6 +193,11 @@ projects = [ '家具业务系统', ['cp.jiansun.vip'], ), + project_with_preserved_login( + 'script_monitor', + '脚本监控', + ['cp.jiansun.vip'], + ), ] # 兜底:生产 .env 里已登记、但上面清单未列出的项目原样保留, diff --git a/src/__tests__/deployment.test.ts b/src/__tests__/deployment.test.ts index 2a957a5..370f4ed 100644 --- a/src/__tests__/deployment.test.ts +++ b/src/__tests__/deployment.test.ts @@ -26,6 +26,8 @@ test('生产发布面透传免登配置并保留已有项目 login', () => { // 家具系统已接入生产;正式登记进初始化清单,防止重部署覆盖。 assert.match(deploy, /'furniture_platform'/) assert.match(deploy, /'家具业务系统'/) + assert.match(deploy, /'script_monitor'/) + assert.match(deploy, /'脚本监控'/) // 未列出的已登记项目必须原样保留,杜绝同类覆盖事故。 assert.match(deploy, /known_codes = \{item\['code'\] for item in projects\}/) assert.match(deploy, /docker pause youyidian-notification-center/)