Files
Nexus/docs/changelog/2026-06-07-probe-curl-parse-fix.md
T
2026-07-08 22:31:31 +08:00

1.4 KiB
Raw Blame History

Changelog — 外网探测脚本 curl / WebSocket 修复

日期2026-06-07

摘要

修复 security_probe_external.shprobe()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.shNEXUS_PUBLISH_PORT 缺失时 PORT 默认 8600(修复空端口打到 OpenResty 404

变更

  • GETshift 2;非 GETshift 2 + shift 1(消费 body),剩余 $@ 为额外 curl 参数
  • HTTP 状态码写入独立临时文件,避免与 body 混淆
  • 统一 -X "$method"
  • script-callback 探测 body 满足 Pydantic 最小长度,确保测到 401 而非 422
  • 新增 resolve_ws_python()NEXUS_PROBE_PYTHONvenv/ → 系统 python → /tmp/nexus-probe-venv + websockets==14.1

迁移 / 重启

无。

验证

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]