Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 25 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Tauri 打包目标当前配置为 NSIS 安装包,产物位于 `src-tauri/targe
%APPDATA%\DeepSeekMonitorWindows\config.json
```

其中包含 API Key 和用量 Token。**请不要提交该文件,也不要把截图、日志或配置文件中的密钥内容公开。**
其中包含 API Key 和用量 Token,凭据已通过 Windows DPAPI 加密存储,不在文件中明文保留。**请不要提交该文件,也不要把截图、日志或配置文件中的密钥内容公开。**

WebView2 登录缓存通常位于:

Expand All @@ -113,31 +113,18 @@ DeepSeekMonitorWindows/
│ ├── main.tsx # 主界面、设置页、详情页和 Tauri 调用
│ └── styles.css # Windows 桌面 UI 样式
├── src-tauri/ # Tauri + Rust 后端
│ ├── src/lib.rs # API 调用、配置存储、托盘、网页登录同步
│ ├── tauri.conf.json # Tauri 窗口、打包和安全配置
│ ├── src/lib.rs # API 调用、配置存储、凭据加密、托盘、网页登录同步
│ ├── tauri.conf.json # Tauri 窗口、打包和安全配置(CSP 已启用)
│ ├── Cargo.toml # Rust 依赖与包信息
│ └── capabilities/ # Tauri 权限配置
│ ├── default.json # 主窗口权限
│ └── login-sync.json # 登录窗口最小权限
├── public/assets/ # DeepSeek 图标与静态资源
├── scripts/ # Windows 开发脚本
├── package.json # 前端依赖与脚本
└── README.md # 项目说明
```

## 不应提交的文件

仓库已通过 `.gitignore` 忽略以下内容:

- `node_modules/`
- `dist/`
- `src-tauri/target/`
- `.env`, `.env.local`, `.env.*.local`
- `.npmrc`
- `*.log`, `*.err.log`, `*.out.log`
- `test-output/`
- 根目录临时截图 `dashboard-mvp.png`, `settings-mvp.png`, `detail-mvp.png`
- WebView2 缓存和本地运行配置
- IDE 配置和系统临时文件

## 依赖

前端运行依赖:
Expand Down Expand Up @@ -168,6 +155,25 @@ Rust 后端依赖:

完整发布记录见 GitHub Releases。

### v1.2.0

由 [KerryChia](https://github.com/KerryChia) 开发。

**安全加固:**

- 启用 CSP 内容安全策略,阻止内联脚本注入和外部资源加载。
- API Key 与用量 Token 改为 Windows DPAPI 加密存储,不再明文写入 config.json。
- 关闭 `withGlobalTauri`,阻止外部网页访问 Tauri IPC。
- 登录同步注入脚本增加域名白名单守卫,仅拦截发往 DeepSeek 域名的请求。
- 移除注入脚本中的 `__TAURI__` 辅助通道。
- 登录窗口添加 `on_navigation` 导航限制,仅允许 `platform.deepseek.com` 和 `api.deepseek.com`。
- 拆分 capabilities 权限:`login-sync` 窗口仅保留最小权限,不再开放窗口操作和事件 API。
- API Key 输入增加长度上限(256 字符)和格式警告;用量 Token 增加长度上限(4096 字符)。

**功能改进:**

- 主窗口改为可拉伸调整大小(最小 340×500,最大 600×1200),拉高窗口即可完整查看图表内容无需滚动。

### v1.1.0

- 支持缓存命中、缓存未命中与输出 Token 的明细显示。
Expand All @@ -193,4 +199,4 @@ Rust 后端依赖:

本项目仅用于学习和研究目的。请遵守 DeepSeek 的使用条款,合理使用相关接口,避免频繁请求。

DeepSeek 平台页面结构、登录状态、WebView2 缓存和内部用量接口都可能变化,本项目不保证长期可用。**API Key 和用量 Token 属于敏感凭据,使用者需自行承担本机存储、账号安全、网络请求和数据展示带来的风险。**
DeepSeek 平台页面结构、登录状态、WebView2 缓存和内部用量接口都可能变化,本项目不保证长期可用。**API Key 和用量 Token 已通过 Windows DPAPI 加密存储在本机,但使用者仍需自行承担账号安全、网络请求和数据展示带来的风险。**
14 changes: 3 additions & 11 deletions src-tauri/capabilities/default.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
{
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
"description": "enables the default permissions",
"description": "permissions for the main window only",
"windows": [
"main",
"login-sync"
"main"
],
"remote": {
"urls": [
"https://platform.deepseek.com",
"https://platform.deepseek.com/*"
]
},
"permissions": [
"core:default",
"core:window:allow-start-dragging",
Expand All @@ -20,7 +13,6 @@
"core:window:allow-close",
"core:window:allow-set-focus",
"core:event:allow-emit",
"core:event:allow-listen",
"core:webview:allow-internal-toggle-devtools"
"core:event:allow-listen"
]
}
11 changes: 11 additions & 0 deletions src-tauri/capabilities/login-sync.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "login-sync",
"description": "minimal permissions for the login-sync window - no Tauri API access, navigation only to DeepSeek",
"windows": [
"login-sync"
],
"permissions": [
"core:default"
]
}
Loading