feat: 支持 Linux 平台使用(CA 安装适配 + 静默启动),并修复 api_key 泄漏

CA 适配:
- 移除 CA 模块对 macOS/Windows 的硬性限制,Linux 走完整初始化流程
- 按发行版自动选择安装命令:Debian 系 update-ca-certificates,
  Fedora/RHEL/Arch 系 update-ca-trust extract;已安装检测比对信任锚文件
- 删除不可达的 CaState::Unsupported 分支及前端"请使用 macOS 或 Windows"提示

静默启动(参考 cc-switch 实现逻辑):
- 新增 DesktopSettings 持久化(service_settings 表)及 GET/PUT /api/settings/desktop
- 主窗口统一以 visible(false) 创建,启动时读取配置决定是否显示
- 应用设置页:开启"开机启动"后显示"静默启动"子开关

安全修复:
- ProviderEndpoint.api_key 增加 serde(skip_serializing),
  避免明文 API Key 随 JSON 响应泄漏(provider_console 测试恢复通过)

其他:
- Linux 补齐 open_terminal_with_command:按序探测 x-terminal-emulator /
  gnome-terminal / konsole 等并在新终端窗口执行命令
- "打开终端安装 CA"失败信息不再被前端静默吞掉
- 顺手修复上游遗留问题:desktop.rs 未使用导入、output.rs 测试模块位置、providers.rs 格式
This commit is contained in:
Linanwanttodo committed 2026-08-25 22:59:21 +08:00
1 parent 081e1f50e2
commit d95273c49b
18 files changed
+297 -99

No files matched your search

+90 -61
View File
@@ -431,8 +431,8 @@
"refs": [
{
"file": "components/cursor/CursorGates.tsx",
"line": 22,
"column": 107
"line": 21,
"column": 65
}
]
},
@@ -484,7 +484,7 @@
"refs": [
{
"file": "components/cursor/CursorGates.tsx",
"line": 38,
"line": 37,
"column": 59
},
{
@@ -576,7 +576,7 @@
"refs": [
{
"file": "components/settings/AppLifecycleSettingsCard.tsx",
"line": 87,
"line": 120,
"column": 27
}
]
@@ -789,7 +789,7 @@
"refs": [
{
"file": "components/settings/AppLifecycleSettingsCard.tsx",
"line": 51,
"line": 72,
"column": 29
}
]
@@ -803,7 +803,7 @@
"refs": [
{
"file": "components/settings/AppLifecycleSettingsCard.tsx",
"line": 83,
"line": 116,
"column": 13
}
]
@@ -1320,6 +1320,18 @@
}
]
},
"47d1c20aa017ff05": {
"source": "开机启动时不显示主窗口,仅保留系统托盘图标。",
"kind": "text",
"placeholders": [],
"refs": [
{
"file": "components/settings/AppLifecycleSettingsCard.tsx",
"line": 102,
"column": 17
}
]
},
"48b970b568a7f8f9": {
"source": "代理设置",
"kind": "text",
@@ -1355,7 +1367,7 @@
"refs": [
{
"file": "components/settings/AppLifecycleSettingsCard.tsx",
"line": 82,
"line": 115,
"column": 13
}
]
@@ -1514,8 +1526,8 @@
"refs": [
{
"file": "components/cursor/CursorGates.tsx",
"line": 23,
"column": 222
"line": 22,
"column": 205
}
]
},
@@ -1665,7 +1677,7 @@
"refs": [
{
"file": "components/settings/AppLifecycleSettingsCard.tsx",
"line": 40,
"line": 48,
"column": 40
}
]
@@ -1789,7 +1801,7 @@
"refs": [
{
"file": "api.ts",
"line": 290,
"line": 294,
"column": 43
}
]
@@ -1801,7 +1813,7 @@
"refs": [
{
"file": "components/settings/AppLifecycleSettingsCard.tsx",
"line": 80,
"line": 113,
"column": 18
}
]
@@ -1844,7 +1856,7 @@
"refs": [
{
"file": "components/cursor/CursorGates.tsx",
"line": 36,
"line": 35,
"column": 14
}
]
@@ -1974,7 +1986,7 @@
"refs": [
{
"file": "components/settings/AppLifecycleSettingsCard.tsx",
"line": 51,
"line": 72,
"column": 78
}
]
@@ -2015,18 +2027,6 @@
}
]
},
"722e156c20650a3f": {
"source": "请使用 macOS 或 Windows。",
"kind": "text",
"placeholders": [],
"refs": [
{
"file": "components/cursor/CursorGates.tsx",
"line": 22,
"column": 26
}
]
},
"7392e20d61abaa07": {
"source": "额外保存完整请求和流响应;默认只保存时间、状态与用量。",
"kind": "text",
@@ -2082,7 +2082,7 @@
"refs": [
{
"file": "api.ts",
"line": 285,
"line": 289,
"column": 43
}
]
@@ -2185,8 +2185,8 @@
"refs": [
{
"file": "components/cursor/CursorGates.tsx",
"line": 23,
"column": 138
"line": 22,
"column": 121
}
]
},
@@ -2197,7 +2197,7 @@
"refs": [
{
"file": "components/settings/AppLifecycleSettingsCard.tsx",
"line": 91,
"line": 124,
"column": 37
}
]
@@ -2221,7 +2221,7 @@
"refs": [
{
"file": "api.ts",
"line": 231,
"line": 235,
"column": 21
}
]
@@ -2250,12 +2250,12 @@
"refs": [
{
"file": "components/settings/AppLifecycleSettingsCard.tsx",
"line": 68,
"line": 89,
"column": 18
},
{
"file": "components/settings/AppLifecycleSettingsCard.tsx",
"line": 74,
"line": 95,
"column": 16
}
]
@@ -2272,6 +2272,18 @@
}
]
},
"864597982c308d72": {
"source": "已开启静默启动",
"kind": "text",
"placeholders": [],
"refs": [
{
"file": "components/settings/AppLifecycleSettingsCard.tsx",
"line": 61,
"column": 25
}
]
},
"86b7355ec3bd55ef": {
"source": "隐藏 API Key",
"kind": "text",
@@ -2508,18 +2520,6 @@
}
]
},
"95f76d30c25d5eda": {
"source": "当前系统暂不支持安装 CA",
"kind": "text",
"placeholders": [],
"refs": [
{
"file": "components/cursor/CursorGates.tsx",
"line": 21,
"column": 28
}
]
},
"966498853d801a52": {
"source": "TAB 选择",
"kind": "text",
@@ -2558,8 +2558,8 @@
"refs": [
{
"file": "components/cursor/CursorGates.tsx",
"line": 23,
"column": 205
"line": 22,
"column": 188
}
]
},
@@ -2616,6 +2616,18 @@
}
]
},
"9e356080c56877f8": {
"source": "已关闭静默启动",
"kind": "text",
"placeholders": [],
"refs": [
{
"file": "components/settings/AppLifecycleSettingsCard.tsx",
"line": 61,
"column": 40
}
]
},
"9e46da6923836182": {
"source": "如:2026-08-23 09:00、1小时前",
"kind": "text",
@@ -2683,11 +2695,28 @@
"refs": [
{
"file": "components/settings/AppLifecycleSettingsCard.tsx",
"line": 65,
"line": 86,
"column": 29
}
]
},
"a1b8c98f29374a2f": {
"source": "静默启动",
"kind": "text",
"placeholders": [],
"refs": [
{
"file": "components/settings/AppLifecycleSettingsCard.tsx",
"line": 101,
"column": 18
},
{
"file": "components/settings/AppLifecycleSettingsCard.tsx",
"line": 107,
"column": 16
}
]
},
"a2901cd2743c1921": {
"source": "模型服务的 API 根地址;修改后会同步更新该上游模型的路由身份。",
"kind": "text",
@@ -2734,8 +2763,8 @@
"refs": [
{
"file": "components/cursor/CursorGates.tsx",
"line": 23,
"column": 170
"line": 22,
"column": 153
}
]
},
@@ -2906,7 +2935,7 @@
"refs": [
{
"file": "components/settings/AppLifecycleSettingsCard.tsx",
"line": 40,
"line": 48,
"column": 25
}
]
@@ -2918,7 +2947,7 @@
"refs": [
{
"file": "components/settings/AppLifecycleSettingsCard.tsx",
"line": 87,
"line": 120,
"column": 39
}
]
@@ -3561,7 +3590,7 @@
"refs": [
{
"file": "components/settings/AppLifecycleSettingsCard.tsx",
"line": 69,
"line": 90,
"column": 17
}
]
@@ -3962,8 +3991,8 @@
"refs": [
{
"file": "components/cursor/CursorGates.tsx",
"line": 21,
"column": 68
"line": 20,
"column": 33
}
]
},
@@ -4121,7 +4150,7 @@
"refs": [
{
"file": "components/cursor/CursorGates.tsx",
"line": 37,
"line": 36,
"column": 12
}
]
@@ -4296,7 +4325,7 @@
"refs": [
{
"file": "components/settings/AppLifecycleSettingsCard.tsx",
"line": 91,
"line": 124,
"column": 25
}
]
@@ -4308,8 +4337,8 @@
"refs": [
{
"file": "components/cursor/CursorGates.tsx",
"line": 21,
"column": 89
"line": 20,
"column": 54
}
]
},
@@ -4422,8 +4451,8 @@
"refs": [
{
"file": "components/cursor/CursorGates.tsx",
"line": 22,
"column": 73
"line": 21,
"column": 31
}
]
},