fix: 代码审查和安全扫描反馈修复
- work-order-manager.js: 归档前确保目录存在(mkdirSync recursive) - staging-ops-agent.js: LLM模型名可配置(ZY_LLM_MODEL环境变量) - staging-auto-deploy.yml: 工单读取增加try-catch错误处理 - zhuyuan-sovereign.conf: SSL配置块增加域名占位符替换说明 Agent-Logs-Url: https://github.com/qinfendebingshuo/guanghulab/sessions/bb893563-5fa6-41ba-86e4-b6f87d2c2c32 Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
This commit is contained in:
parent
461a270459
commit
6891619c81
|
|
@ -363,11 +363,16 @@ jobs:
|
||||||
# 读取工单重试次数
|
# 读取工单重试次数
|
||||||
ORDER_ID="${{ needs.deploy-staging.outputs.order_id }}"
|
ORDER_ID="${{ needs.deploy-staging.outputs.order_id }}"
|
||||||
RETRY_INFO=$(node -e "
|
RETRY_INFO=$(node -e "
|
||||||
const data = JSON.parse(require('fs').readFileSync('data/work-orders/active.json','utf8'));
|
try {
|
||||||
const order = data.orders.find(o => o.id === '$ORDER_ID');
|
const data = JSON.parse(require('fs').readFileSync('data/work-orders/active.json','utf8'));
|
||||||
if (order) {
|
const order = data.orders.find(o => o.id === '$ORDER_ID');
|
||||||
console.log(order.retry_count >= order.max_retries ? 'SEND_ALERT' : 'SKIP');
|
if (order) {
|
||||||
} else {
|
console.log(order.retry_count >= order.max_retries ? 'SEND_ALERT' : 'SKIP');
|
||||||
|
} else {
|
||||||
|
console.log('SKIP');
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error('工单文件读取失败:', e.message);
|
||||||
console.log('SKIP');
|
console.log('SKIP');
|
||||||
}
|
}
|
||||||
")
|
")
|
||||||
|
|
|
||||||
|
|
@ -219,7 +219,7 @@ ${logContent.slice(0, 3000)}
|
||||||
const requestModule = isHttps ? https : http;
|
const requestModule = isHttps ? https : http;
|
||||||
|
|
||||||
const body = JSON.stringify({
|
const body = JSON.stringify({
|
||||||
model: 'deepseek-chat', // 优先使用高性价比模型
|
model: process.env.ZY_LLM_MODEL || 'deepseek-chat', // 默认使用高性价比模型, 可通过环境变量覆盖
|
||||||
messages: [
|
messages: [
|
||||||
{ role: 'system', content: '你是铸渊(ZhuYuan),光湖(HoloLake)系统的AI守护者。精通服务器运维、Node.js、Nginx、PM2。' },
|
{ role: 'system', content: '你是铸渊(ZhuYuan),光湖(HoloLake)系统的AI守护者。精通服务器运维、Node.js、Nginx、PM2。' },
|
||||||
{ role: 'user', content: prompt }
|
{ role: 'user', content: prompt }
|
||||||
|
|
|
||||||
|
|
@ -222,6 +222,9 @@ function archiveOrder(args) {
|
||||||
message: '任务归档完成'
|
message: '任务归档完成'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 确保归档目录存在
|
||||||
|
fs.mkdirSync(ARCHIVE_DIR, { recursive: true });
|
||||||
|
|
||||||
// 移到归档目录
|
// 移到归档目录
|
||||||
const month = new Date().toISOString().slice(0, 7);
|
const month = new Date().toISOString().slice(0, 7);
|
||||||
const archiveFile = path.join(ARCHIVE_DIR, `${month}.json`);
|
const archiveFile = path.join(ARCHIVE_DIR, `${month}.json`);
|
||||||
|
|
|
||||||
|
|
@ -203,6 +203,8 @@ server {
|
||||||
# 当 /opt/zhuyuan/config/ssl/ 下存在证书文件时启用
|
# 当 /opt/zhuyuan/config/ssl/ 下存在证书文件时启用
|
||||||
# 证书来源: GitHub Secrets → ZY_SSL_FULLCHAIN / ZY_SSL_PRIVKEY
|
# 证书来源: GitHub Secrets → ZY_SSL_FULLCHAIN / ZY_SSL_PRIVKEY
|
||||||
# 部署方式: staging-auto-deploy.yml 自动写入证书文件
|
# 部署方式: staging-auto-deploy.yml 自动写入证书文件
|
||||||
|
# 域名占位符: ZY_DOMAIN_PREVIEW_PLACEHOLDER 由 deploy workflow 的 sed 命令替换
|
||||||
|
# (同 §1/§2 的注入方式,详见 staging-auto-deploy.yml 和 deploy-to-zhuyuan-server.yml)
|
||||||
|
|
||||||
# ─── §3.1 预览域名 HTTPS (guanghu.online) ───
|
# ─── §3.1 预览域名 HTTPS (guanghu.online) ───
|
||||||
# 注意: 此block仅在证书存在时由deploy脚本include,不会导致Nginx启动失败
|
# 注意: 此block仅在证书存在时由deploy脚本include,不会导致Nginx启动失败
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue