Skip to content

security: harden router lifecycle, credentials, and proxy handling - #5

Merged
fish2lab merged 3 commits into
fish2lab:mainfrom
LeaningLearner:main
Aug 3, 2026
Merged

security: harden router lifecycle, credentials, and proxy handling#5
fish2lab merged 3 commits into
fish2lab:mainfrom
LeaningLearner:main

Conversation

@LeaningLearner

Copy link
Copy Markdown
Contributor

恢复说明

此前的 PR #3 因误操作被关闭,无法恢复,因此重新提交本 PR。

本次提交内容与原 PR 基本一致,security-hardening 分支也已经同步到我 fork 的 main 分支。

主要改动

  • 为本地回环路由增加认证令牌,阻止未授权请求。
  • 强化关闭握手、PID 状态管理和替代实例保护。
  • 限制压缩请求体和解压后的请求体大小。
  • Windows 使用 DPAPI 加密 DeepSeek API Key 和带凭据的代理地址。
  • 自动迁移旧版本的 Windows 明文 Key。
  • 增加代理解析和 Node.js --use-env-proxy 支持。
  • 保证回环地址和 api.deepseek.com 不经过代理。
  • 修复自启动脚本的路径转义和中文用户名目录兼容性。
  • 自启动只在进程崩溃后重启,正常停止后不会自动拉起。
  • 最低 Node.js 版本调整为 24.5。

验证结果

  • npm test:60 个测试通过,1 个 Windows 平台测试按预期跳过。
  • git diff --check:通过。

@fish2lab
fish2lab merged commit 077024d into fish2lab:main Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants