Skip to content

Commit a64802f

Browse files
yhy0claude
andcommitted
fix: 修复拦截界面 URL 列内容不显示的问题
URL 列的 cellRenderer 使用了 max-w-0 (max-width: 0px) CSS 类, 导致内容被完全截断不可见。改为 min-w-0 w-full 以正确支持 flex 布局下的文本省略显示。 Closes #11 Co-Authored-By: Claude (Claude-4.6-Opus) <noreply@anthropic.com>
1 parent de34f7b commit a64802f

File tree

4 files changed

+114
-10
lines changed

4 files changed

+114
-10
lines changed

CLAUDE.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## 项目概述
6+
7+
承影(ChYing)是一个基于 Wails v3 的桌面安全测试工具,类似轻量级 Burp Suite。后端 Go,前端 Vue 3 + TypeScript,数据库 SQLite。集成了 Jie 扫描器用于被动/主动漏洞检测。
8+
9+
## 开发环境要求
10+
11+
- Go 1.25+,CGO_ENABLED=1(go-sqlite3 依赖 CGO)
12+
- Node.js + npm
13+
- wails3 CLI(从 wails 仓库 v3-alpha 分支安装:`cd wails/v3/cmd/wails3 && go install`
14+
- wails 源码需与 ChYing 目录同级(go.mod 中 `replace github.com/wailsapp/wails/v3 => ../wails/v3`
15+
- Windows 需要 MinGW(CGO 编译依赖)
16+
17+
## 常用命令
18+
19+
```bash
20+
# 开发模式(热重载)
21+
wails3 dev -config ./build/config.yml -port 9245
22+
23+
# 构建(当前平台)
24+
wails3 task build # 开发构建
25+
wails3 task build DEV=true # 带调试信息
26+
27+
# 打包
28+
wails3 task package # 当前平台
29+
wails3 task darwin:package # macOS .app
30+
wails3 task darwin:package:universal # macOS 通用二进制
31+
wails3 task windows:package # Windows(需 PRODUCTION=true)
32+
wails3 task linux:package # Linux
33+
34+
# 前端
35+
cd frontend && npm install # 安装依赖
36+
cd frontend && npm run dev # 前端独立开发
37+
cd frontend && npm run build # 生产构建
38+
39+
# 生成绑定(Go struct -> TypeScript)
40+
wails3 generate bindings -clean=true -ts
41+
42+
# Go
43+
go mod tidy
44+
go test ./test/... # 运行测试
45+
go test ./test/ -run TestXxx -v # 运行单个测试
46+
```
47+
48+
## 架构
49+
50+
### 根目录 Go 文件 —— App 层(Wails 绑定)
51+
52+
`App` struct 是 Wails 暴露给前端的核心服务,其方法按职责拆分:
53+
54+
- `main.go` — 入口,Wails 应用创建、窗口配置、事件转发循环 `EventNotification()`
55+
- `app.go` — App struct 定义、类型定义(Result/InitStep/InitProgress 等)、全局变量、init()
56+
- `app_initialization.go` — 分步初始化流程(7 步:基础组件 → 配置加载 → 数据库 → 表结构 → 代理启动 → 项目加载 → 完成)
57+
- `app_proxy.go` — 代理作用域配置、DSL 查询、匹配替换规则、越权检测、监听器管理
58+
- `app_config.go` — 配置管理(读取/更新/保存配置文件)
59+
- `app_database.go` — 数据库和历史记录操作
60+
- `app_scan.go` — 扫描目标管理
61+
- `app_window.go` — 窗口管理(文件选择对话框等)
62+
- `app_utils.go` — 工具方法(内存信息、Nmap 扫描等)
63+
- `app_claude.go` — Claude Code CLI 集成和 A2A 协议支持
64+
- `mitmproxy.go` — Repeater(重放器)、Intruder(入侵者)、流量历史查询
65+
- `extension.go` — 编解码器(URL/Base64/Hex/Unicode/MD5)
66+
- `gadgets.go` — JWT 解析/签名/爆破、Fuzz、API 预测
67+
68+
### 核心包
69+
70+
- `mitmproxy/` — HTTP/HTTPS 代理核心,基于 projectdiscovery/proxify 的本地修改版(`lib/proxify/`)。包含流量拦截(intercept.go)、Intruder 攻击(intruder.go)、匹配替换(matchreplace.go)、越权检测(authcheck.go)、被动扫描插件(passiveScanPlugin.go)、DSL 查询(dsl.go)
71+
- `conf/` — 统一配置管理,使用 viper 热加载 YAML 配置。`conf.go` 热加载逻辑,`config_manager.go` 配置读写,`default.go` 默认配置,`type.go` 配置结构体定义
72+
- `pkg/db/` — SQLite 数据库层(gorm),管理 HTTP 历史、请求/响应、扫描目标、漏洞等
73+
- `pkg/Jie/` — 集成的 Jie 扫描引擎(漏洞检测:XSS/SQL注入/SSRF/命令执行等)
74+
- `pkg/claude-code/` — Claude Code SDK 客户端封装(CLI 调用 + A2A 协议)
75+
- `api/` — API 管理层,封装 Config/Proxy/Vulnerability 三类 API
76+
77+
### 前端
78+
79+
Vue 3 + TypeScript + UnoCSS,Glassmorphism(液态玻璃)UI 风格。
80+
81+
- `frontend/src/views/` — 页面视图(ProjectSelection、ClaudeAgent、ScanLog、Vulnerability)
82+
- `frontend/src/components/` — 按功能模块组织:proxy、repeater、intruder、decoder、plugins、scan、claude、settings 等
83+
- `frontend/src/store/` — Pinia 状态管理
84+
- `frontend/src/composables/` — Vue 组合式函数
85+
- `frontend/bindings/` — wails3 自动生成的 Go→TS 绑定(.gitignore 中)
86+
87+
### 本地修改的依赖
88+
89+
- `lib/proxify/` — 修改版 proxify(修复 Stop() 端口释放)
90+
- `lib/jsluice/` — JS 分析库
91+
- `lib/gowsdl/` — WSDL 解析
92+
- `lib/webUnPack/` — Web 解包工具
93+
94+
## 关键约定
95+
96+
- 前后端通信通过 Wails 绑定(App struct 方法)和 Wails 事件(`wailsApp.Event.Emit`
97+
- 统一返回结构 `Result{Data, Error}` — 不使用类型别名(Wails v3 binding 生成器的限制)
98+
- 配置文件位于 `~/.config/ChYing/`,HTTPS 证书在 `~/.config/ChYing/proxify_data/cacert.pem`
99+
- 日志文件在 `~/.config/ChYing/` 目录下
100+
- Windows 构建必须使用 `PRODUCTION=true`,否则 sqlite 崩溃
101+
- go.mod 中有多个 replace 指令处理依赖冲突,修改依赖时需注意

frontend/src/components/proxy/panels/ProxyInterceptPanel.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -515,13 +515,13 @@ const interceptColumns = computed<HttpTrafficColumn<any>[]>(() => [
515515
516516
// 如果有 host,显示 host + path 格式
517517
if (host) {
518-
return h('div', { class: 'flex truncate max-w-0' }, [
519-
h('span', { class: 'font-medium text-gray-800 dark:text-gray-200' }, host),
520-
h('span', { class: 'text-gray-500 dark:text-gray-400 ml-1' }, path)
518+
return h('div', { class: 'flex truncate min-w-0 w-full' }, [
519+
h('span', { class: 'font-medium text-gray-800 dark:text-gray-200 truncate' }, host),
520+
h('span', { class: 'text-gray-500 dark:text-gray-400 ml-1 truncate' }, path)
521521
]);
522522
}
523523
// 如果没有 host,显示完整 URL 或 path
524-
return h('div', { class: 'flex truncate max-w-0' }, [
524+
return h('div', { class: 'flex truncate min-w-0 w-full' }, [
525525
h('span', { class: 'text-gray-600 dark:text-gray-300' }, displayUrl || '(未知)')
526526
]);
527527
}

go.mod

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ require (
2121
github.com/iancoleman/orderedmap v0.3.0
2222
github.com/imroc/req/v3 v3.57.0
2323
github.com/ipinfo/go/v2 v2.10.0
24-
github.com/klauspost/compress v1.18.2
24+
github.com/klauspost/compress v1.18.3
2525
github.com/logrusorgru/aurora v2.0.3+incompatible
2626
github.com/panjf2000/ants/v2 v2.11.4
2727
github.com/pkg/errors v0.9.1
@@ -88,7 +88,8 @@ require (
8888
github.com/chainreactors/utils v0.0.0-20251216161625-70054cf04e88 // indirect
8989
github.com/chromedp/cdproto v0.0.0-20250803210736-d308e07a266d // indirect
9090
github.com/chromedp/sysutil v1.1.0 // indirect
91-
github.com/cloudflare/circl v1.6.2 // indirect
91+
github.com/cloudflare/circl v1.6.3 // indirect
92+
github.com/coder/websocket v1.8.14 // indirect
9293
github.com/cyphar/filepath-securejoin v0.6.1 // indirect
9394
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
9495
github.com/dimchansky/utfbom v1.1.1 // indirect

go.sum

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,10 @@ github.com/chromedp/chromedp v0.14.2 h1:r3b/WtwM50RsBZHMUm9fsNhhzRStTHrKdr2zmwbZ
7777
github.com/chromedp/chromedp v0.14.2/go.mod h1:rHzAv60xDE7VNy/MYtTUrYreSc0ujt2O1/C3bzctYBo=
7878
github.com/chromedp/sysutil v1.1.0 h1:PUFNv5EcprjqXZD9nJb9b/c9ibAbxiYo4exNWZyipwM=
7979
github.com/chromedp/sysutil v1.1.0/go.mod h1:WiThHUdltqCNKGc4gaU50XgYjwjYIhKWoHGPTUfWTJ8=
80-
github.com/cloudflare/circl v1.6.2 h1:hL7VBpHHKzrV5WTfHCaBsgx/HGbBYlgrwvNXEVDYYsQ=
81-
github.com/cloudflare/circl v1.6.2/go.mod h1:2eXP6Qfat4O/Yhh8BznvKnJ+uzEoTQ6jVKJRn81BiS4=
80+
github.com/cloudflare/circl v1.6.3 h1:9GPOhQGF9MCYUeXyMYlqTR6a5gTrgR/fBLXvUgtVcg8=
81+
github.com/cloudflare/circl v1.6.3/go.mod h1:2eXP6Qfat4O/Yhh8BznvKnJ+uzEoTQ6jVKJRn81BiS4=
82+
github.com/coder/websocket v1.8.14 h1:9L0p0iKiNOibykf283eHkKUHHrpG7f65OE3BhhO7v9g=
83+
github.com/coder/websocket v1.8.14/go.mod h1:NX3SzP+inril6yawo5CQXx8+fk145lPDC6pumgx0mVg=
8284
github.com/cyphar/filepath-securejoin v0.6.1 h1:5CeZ1jPXEiYt3+Z6zqprSAgSWiggmpVyciv8syjIpVE=
8385
github.com/cyphar/filepath-securejoin v0.6.1/go.mod h1:A8hd4EnAeyujCJRrICiOWqjS1AX0a9kM5XL+NwKoYSc=
8486
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -257,8 +259,8 @@ github.com/kataras/jwt v0.1.17/go.mod h1:HUnU5HDBCDanVF8zrPVSE2VK8HicospKefZDD4D
257259
github.com/kevinburke/ssh_config v1.4.0 h1:6xxtP5bZ2E4NF5tuQulISpTO2z8XbtH8cg1PWkxoFkQ=
258260
github.com/kevinburke/ssh_config v1.4.0/go.mod h1:q2RIzfka+BXARoNexmF9gkxEX7DmvbW9P4hIVx2Kg4M=
259261
github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
260-
github.com/klauspost/compress v1.18.2 h1:iiPHWW0YrcFgpBYhsA6D1+fqHssJscY/Tm/y2Uqnapk=
261-
github.com/klauspost/compress v1.18.2/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4=
262+
github.com/klauspost/compress v1.18.3 h1:9PJRvfbmTabkOX8moIpXPbMMbYN60bWImDDU7L+/6zw=
263+
github.com/klauspost/compress v1.18.3/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4=
262264
github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
263265
github.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=
264266
github.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=

0 commit comments

Comments
 (0)