Skip to content

DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.

fix: restore loopback Harness permissions (#194)

Mao Mr6f1c9a843112
diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json
index cba7fb60..f238ef74 100644
--- a/src-tauri/capabilities/default.json
+++ b/src-tauri/capabilities/default.json
@@ -1,8 +1,11 @@
{
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
- "description": "Capability for the local desktop shell. The embedded remote Harness page does not receive native Tauri permissions and communicates with the shell through the restricted postMessage bridge. The service port is NOT fixed: it defaults to 3080/3081 but is user-configurable and advances to the next free port when the default is occupied (service/workflow::find_available_port).",
+ "description": "Capability for the main window and embedded Harness GUI. The remote Harness origin is restricted to loopback, while the shell validates every cross-origin postMessage before servicing bridge requests. The service port is NOT fixed: it defaults to 3080/3081 but is user-configurable and advances to the next free port when the default is occupied (service/workflow::find_available_port).",
"windows": ["main"],
+ "remote": {
+ "urls": ["http://127.0.0.1:*"]
+ },
"permissions": [
"core:default",
"core:event:allow-listen",
diff --git a/src-tauri/src/desktop/builder.rs b/src-tauri/src/desktop/builder.rs
index 9f1afbe8..9acfbe78 100644
--- a/src-tauri/src/desktop/builder.rs
+++ b/src-tauri/src/desktop/builder.rs
@@ -475,11 +475,12 @@ mod tests {
#[cfg(test)]
mod security_tests {
#[test]
- fn remote_capability_does_not_cover_wildcard_loopback() {
+ fn remote_capability_allows_only_loopback_harness() {
let capability = include_str!("../../capabilities/default.json");
- assert!(!capability.contains("\"remote\""));
+ assert!(capability.contains("\"remote\""));
let wildcard_loopback = ["http://127.0.0.1:", "*"].concat();
- assert!(!capability.contains(wildcard_loopback.as_str()));
+ assert!(capability.contains(wildcard_loopback.as_str()));
+ assert!(!capability.contains("https://"));
}
#[test]