Files
Nexus/docs/changelog/2026-06-07-probe-curl-parse-fix.md
T
Nexus Agent e3fe161ae5 fix(deploy): 健康检查 PORT 缺省 8600
NEXUS_PUBLISH_PORT 未写入 .env.prod 时避免空端口误打 OpenResty 导致部署脚本误报失败。
2026-06-07 18:05:27 +08:00

40 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Changelog — 外网探测脚本 curl / WebSocket 修复
**日期**2026-06-07
## 摘要
修复 `security_probe_external.sh``probe()``shift 3` 的误用,消除 `code=000000ok200` 类误报 `[FAIL]`WebSocket 段自动解析项目 `venv` 或引导临时 venv 安装 `websockets`
## 动机
`probe GET /path` 仅 2 个参数时,bash `shift 3` 不移位,`GET``/health` 被当作 curl 额外 URLstdout 混入 `000` 错误与响应体,判定逻辑全部失真。
## 涉及文件
- `scripts/security_probe_external.sh`
## 变更(续 2026-06-07 试跑)
- `deploy-production.sh``NEXUS_PUBLISH_PORT` 缺失时 `PORT` 默认 **8600**(修复空端口打到 OpenResty 404
## 变更
- GET`shift 2`;非 GET`shift 2` + `shift 1`(消费 body),剩余 `$@` 为额外 curl 参数
- HTTP 状态码写入独立临时文件,避免与 body 混淆
- 统一 `-X "$method"`
- `script-callback` 探测 body 满足 Pydantic 最小长度,确保测到 401 而非 422
- 新增 `resolve_ws_python()``NEXUS_PROBE_PYTHON``venv/` → 系统 python → `/tmp/nexus-probe-venv` + `websockets==14.1`
## 迁移 / 重启
无。
## 验证
```bash
NEXUS_PROBE_BASE=https://api.synaglobal.vip bash scripts/security_probe_external.sh
# GET /health → [PASS]install POST → [PASS] 404;无 code=000000... 误报
# WebSocket → [PASS] HTTP 403(不再 [SKIP]
```