fix: 落实 PR #693 review 意见 - #707
Merged
Merged
Conversation
- feat(gui): 新增流量监控页面,adblock 零 IP 与已拦截域名不计入错误统计 - feat(core): 支持 DEV_SIDECAR_LOG_DISABLED 完全关闭日志,设置页增加开关 - feat(overwall): 服务器支持 ID 标识,可按域名选择目标服务器 - feat(speed): 测速过滤零 IP,等待 Cloudflare 路由就绪后执行 - fix(gui): 修复安装后任务栏图标仍为 Electron 默认图标(signAndEditExecutable 改为 true,确保写入 exe 图标与版本信息) - fix(build): 平台原生可选依赖声明为直接依赖,修复安装后 sysproxy/shutdown-handler 模块缺失 - fix(proxy): DS-Proxy-Request 响应头改用实际上游路径 - fix(system-proxy): 优化系统代理开关与恢复逻辑 - chore(script): 统一 dev.ps1 启停/检查脚本 内容使用DeepSeekV4Pro0813 high+DSH完成
- feat(interceptor): 新增 retry 拦截器,收到 500 或连接失败时自动重试,支持缓存小请求体 - fix(proxy): 子资源错误页改为 text/plain,避免浏览器 ORB 拦截;错误日志精简 rOptions 输出 - feat(sni): sni 配置为空字符串时关闭上游 SNI 发送 - feat(cloudflareRoute): 预设 IP 优先级最高不参与重定向;新增 blacklist/whitelist 模式与域名名单 - fix(speed): 请求失败后从存活 IP 列表移除失败 IP,后续请求与重试自动切换 - feat(server): 新增按域名 TLS 版本设置 tlsVersionMapping,支持远程下发后用户自行启用 - feat(gui): 加速服务页新增 TLS 版本设置 UI,并为 Cloudflare 路由重定向增加模式与域名名单 UI
修复更新检查证书校验失败
Co-authored-by: 8odream <87055981+8odream@users.noreply.github.com>
Co-authored-by: 8odream <87055981+8odream@users.noreply.github.com>
Co-authored-by: 8odream <87055981+8odream@users.noreply.github.com>
0816 update
修复dns回传问题
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
- 安全:错误页 XSS 转义;未知长度 body 禁止无界重试缓存;恢复 pnpm 安全 overrides - 更新:ARM 不回退 x64 增量包;下载到 userData;写流 finish 后再通知 - 环境变量:关闭时按备份恢复;macOS 用 launchctl+LaunchAgent,Linux 写 environment.d/profile - 流量:keep-alive 基线累计、lifetime 总量、域名淘汰、MITM 端口映射;processResolver 仅 Windows - 其他:TLS 版本在 Connection:close 生效;log-env 兼容 json5;server.vue 保留 cf 字段 - 测试:ipv6 连通检查移出 mocha 默认路径
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical and moderate findings remain across packaging, environment persistence, updates, proxy behavior, and traffic monitoring.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This PR applies follow-up security, proxy, update, monitoring, packaging, and testing fixes from PR #693.
Changes:
- Hardens retry, error-page, DNS, TLS, and dependency handling.
- Updates cross-platform proxy and environment persistence.
- Improves GUI updates, ARM packaging, speed tests, and traffic monitoring.
- Adds regression tests, diagnostics, and documentation.
File summaries
| File | Reviewed changes and final comments |
|---|---|
README.md |
Adds proxy conflict troubleshooting guidance. |
pnpm-workspace.yaml |
Restores dependency security overrides. |
pnpm-lock.yaml |
Synchronizes dependency resolutions. |
packages/mitmproxy/test/ipv6-test.mjs |
Adjusts IPv6 test execution. |
packages/mitmproxy/test/dnsDefaultLookupTest.mjs |
Adds DNS lookup regression coverage. |
packages/mitmproxy/src/options.js |
Updates plugin terminology. |
packages/mitmproxy/src/lib/traffic/TrafficMonitor.js |
Adds traffic aggregation, lifetime totals, domain tracking, and client association. Moderate (2 votes): Keep-alive deltas can be omitted from lifetime totals; expired blocked hosts are not swept; repeated requests add duplicate socket listeners. Moderate (1 vote): Initial socket bytes can be omitted from totals. |
packages/mitmproxy/src/lib/traffic/processResolver.js |
Adds Windows process resolution and lifecycle handling. |
packages/mitmproxy/src/lib/speed/SpeedTester.js |
Preserves Cloudflare metadata during speed tests. |
packages/mitmproxy/src/lib/speed/index.js |
Integrates speed-test changes. |
packages/mitmproxy/src/lib/speed/config.js |
Updates speed-test configuration. |
packages/mitmproxy/src/lib/proxy/mitmproxy/index.js |
Integrates proxy monitoring and lifecycle changes. |
packages/mitmproxy/src/lib/proxy/mitmproxy/dnsLookup.js |
Updates DNS and Cloudflare lookup handling. Moderate (1 vote): CONNECT failures do not report probe failures or retain the original DNS address. |
packages/mitmproxy/src/lib/proxy/mitmproxy/createConnectHandler.js |
Associates CONNECT sockets with clients. Moderate (1 vote): Connect errors omit the client port and can miss per-client accounting. |
packages/mitmproxy/src/lib/proxy/middleware/overwall.js |
Updates Overwall server selection. Critical (1 vote): Custom server IDs can leave the default target pointing to nonexistent server ID 0. |
packages/mitmproxy/src/lib/proxy/common/util.js |
Applies TLS version mappings. Moderate (2 votes): Connection: close matching is not case-insensitive or token-aware. |
packages/mitmproxy/src/lib/interceptor/index.js |
Integrates interceptor updates. |
packages/mitmproxy/src/lib/interceptor/impl/req/sni.js |
Applies TLS mapping changes. |
packages/mitmproxy/src/lib/interceptor/impl/req/retry.js |
Implements bounded request retries. |
packages/mitmproxy/src/lib/dns/util.ip.js |
Updates IP handling. |
packages/mitmproxy/src/lib/dns/tls.js |
Updates TLS DNS behavior. |
packages/mitmproxy/src/lib/dns/tcp.js |
Updates TCP DNS behavior. |
packages/mitmproxy/src/lib/cloudflareRoute.js |
Updates Cloudflare routing. |
packages/mitmproxy/src/index.js |
Updates proxy startup and shutdown. |
packages/mitmproxy/scripts/ipv6-net-check.js |
Provides a standalone IPv6 connectivity check. |
packages/gui/src/view/router/menu.js |
Updates GUI navigation. |
packages/gui/src/view/router/index.js |
Registers GUI routes. |
packages/gui/src/view/pages/traffic.vue |
Adds traffic monitoring UI. Moderate (1 vote): Sortable headers are not keyboard accessible. |
packages/gui/src/view/pages/setting.vue |
Updates settings UI. |
packages/gui/src/view/pages/server.vue |
Preserves speed-test metadata. Moderate (1 vote): Normalization drops fields used to display failed probes. |
packages/gui/src/view/pages/plugin/overwall.vue |
Updates Overwall configuration UI. |
packages/gui/src/view/pages/plugin/node.vue |
Updates Node plugin UI. |
packages/gui/src/view/pages/index.vue |
Updates dashboard behavior. |
packages/gui/src/view/pages/github-status.vue |
Adds GitHub status display. |
packages/gui/src/view/components/container.vue |
Updates shared GUI container behavior. |
packages/gui/src/utils/util.log-env.js |
Adds JSON5-compatible logging configuration. |
packages/gui/src/bridge/update/front.js |
Updates installer interaction. |
packages/gui/src/bridge/update/backend.js |
Handles installer downloads. Critical (1 vote): Unvalidated asset names can escape the update directory. Moderate (2 votes): Non-2xx responses can be reported as successful downloads. Moderate (1 vote): Linux AppImages need executable permissions before opening. |
packages/gui/src/bridge/api/backend.js |
Updates backend API bridging. |
packages/gui/src/background.js |
Updates Electron lifecycle integration. |
packages/gui/package.json |
Adds platform-specific dependencies. |
packages/gui/electron-builder.config.cjs |
Updates multi-architecture packaging. |
packages/core/test/instanceTest.js |
Updates core instance tests. |
packages/core/src/utils/util.logger.js |
Updates logging configuration. |
packages/core/src/utils/util.log-or-console.js |
Updates conditional logging. |
packages/core/src/shell/scripts/set-system-proxy/index.js |
Manages proxy environment restoration. Moderate (2 votes): Re-enabling the proxy can overwrite the original backup; restoration can delete untouched environment variables. |
packages/core/src/shell/scripts/set-system-env.js |
Adds cross-platform environment persistence. Moderate (1 vote): System-proxy executors do not use this helper or its cleanup path. |
packages/core/src/modules/server/index.js |
Updates server lifecycle handling. |
packages/core/src/modules/plugin/overwall/config.js |
Updates Overwall configuration. |
packages/core/src/modules/plugin/node/index.js |
Applies Node/npm environment configuration. Critical (1 vote): Disabling acceleration can leave TLS-verification-disabling variables persisted. |
packages/core/src/modules/plugin/node/config.js |
Updates Node plugin settings. |
packages/core/src/expose.js |
Updates exposed core APIs. |
packages/core/src/config/index.js |
Updates default configuration. |
packages/core/src/config-api.js |
Updates configuration API handling. |
doc/wiki/加速服务使用说明.md |
Updates usage documentation. |
.github/workflows/build-and-release.yml |
Updates release artifacts and architectures. Critical (1 vote): The ARM Flatpak path is unreachable because the ARM matrix entry is disabled and the active builder targets only x64; the same issue appears at line 610. |
_script/electron-dev.mjs |
Updates Electron development startup. |
_script/dev.js |
Updates development tooling. |
Review details
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
Suppressed comments (9)
.github/workflows/build-and-release.yml:612
- The release job has no active download step for the ARM Flatpaks uploaded by the build job (and the x64 Flatpak download is commented out here). Consequently those artifacts never enter
release/and cannot be published, even if the ARM build is fixed. Add download steps for the intended Flatpak artifacts or remove the corresponding uploads.
#- name: "Download DevSidecar-${{ steps.package-info.outputs.version }}-linux-x86_64.flatpak"
# uses: actions/download-artifact@v4.1.8
# with:
packages/core/src/shell/scripts/set-system-env.js:348
- This new cross-platform environment helper is not used by the system-proxy executors:
set-system-proxy/index.jsstill calls the legacywriteProxyEnvFile/profile-source functions on Linux and macOS. Consequently, toggling the system proxy never uses the advertisedlaunchctl/environment.dhandling or appliesREQUEST_CA_BUNDLEthrough this implementation. Route those executors through this helper (and its matching cleanup) or remove the legacy path.
module.exports = async function (args) {
return execute(executor, args)
packages/gui/src/bridge/update/backend.js:363
- Linux
.AppImagefiles downloaded throughcreateWriteStreamdo not retain an executable mode. This callback immediately opens the file, so the automatically opened full installer can fail with a permission error; set the executable bit before notifying the renderer.
log.info('完整安装包下载成功:', downloadedPath)
packages/gui/src/bridge/update/backend.js:127
- The download request is piped to the file without checking its HTTP status, and
finishunconditionally callsonSuccess. A 403/404 or proxy-generated error page can therefore be reported as a completed installer and opened by the GUI. Reject non-2xx responses and remove the partial file before treating the download as successful.
progress(request(uri, { ca: getTrustedCaList() }), {
// throttle: 2000, // Throttle the progress event to 2000ms, defaults to 1000ms
// delay: 1000, // Only start to emit after 1000ms delay, defaults to 0ms
// lengthHeader: 'x-transfer-length' // Length header to use, defaults to content-length
})
packages/gui/src/view/pages/server.vue:352
- This normalization drops
titleandstatus, but the template useselement.titleto distinguish failed probes from pending ones. Failed IPs will therefore be displayed as “测速中” without the error color. Preserve the existing item fields and use a nullish check fortimeso valid zero values are not discarded.
const standardized = {
host: ipObj.host,
port: ipObj.port || 443,
dns: ipObj.dns || 'unknown',
time: ipObj.time || null,
packages/gui/src/view/pages/traffic.vue:237
- The custom sortable headers are plain
spanelements with only a mouseclickhandler. They are not keyboard focusable or operable, so keyboard and screen-reader users cannot sort either table. Use a native button (or provide equivalent tabindex/role and keyboard handlers) for this control.
packages/mitmproxy/src/lib/proxy/mitmproxy/createConnectHandler.js:61 - This rejection path calls
markConnectError(hostname)without the client port, even thoughattachConnecthas already associated the request with one. As a result, a failed intercepted CONNECT increments only the domain-wide error count and never the originating process/client entry. Pass the associated client port through the error-reporting API, and deduplicate it with socket error events.
packages/mitmproxy/src/lib/proxy/mitmproxy/dnsLookup.js:127 - The lookup records the selected tester/IP for both normal requests and CONNECT tunnels, but the CONNECT timeout/error paths only call
dns.count. A Cloudflare-rewritten address is not the original address in that DNS cache, and notester.reportProbeResult(ip, false)is made for CONNECT failures, so a dead preferred endpoint can remain marked alive and be selected repeatedly. Report the probe failure in the CONNECT path and retain the original DNS address for cache accounting.
packages/mitmproxy/src/lib/traffic/TrafficMonitor.js:155 attachRequestruns after Node has already consumed the request headers, so a newly created entry'ssocket.bytesReadalready includes the first request. Using that value as the baseline permanently drops those bytes from both the per-process and lifetime totals for every new connection. Establish the baseline when the socket is accepted, or otherwise account for the current counters according to the intended traffic metric.
- Files reviewed: 57/59 changed files
- Comments generated: 10
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- 保留其余安全 overrides - 同步 pnpm-lock.yaml
- cross-spawn/form-data 等 override 与生产依赖解析冲突 - 安全版本应通过升级直接依赖解决,而非全局 override - 与上次绿色构建 1f70b07 的依赖解析方式对齐
- 环境变量备份仅首次 enable 写入;restore 只处理备份中的 key - TrafficMonitor: keep-alive 增量计入 lifetime;同 socket 只挂一次 close;扫过期 blockedHosts - Connection 头大小写/token 列表兼容 - fullPackageName 限制 basename,防路径穿越
- 移除 Access-Control-Allow-Credentials: true - 保留 Access-Control-Allow-Origin 反射 + Vary: Origin - 修复 CodeQL js/cors-misconfiguration-for-credentials (high)
- checkout/setup-node/setup-python/setup-dotnet/cache/pnpm-action 升大版本 - upload-artifact@v6 / download-artifact@v7 - codeql upload-sarif@v4 - 消除 runner 强制 Node 24 的弃用警告
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
按 PR #693 中 cute-omega 与 Copilot 的 review 意见,在合并后手动落地剩余修正。
安全
更新 / 配置
代理 / 环境变量
流量监控
测试
验证
备注