From 83ba39e59a588db6a3c5862e22d3048031b54b51 Mon Sep 17 00:00:00 2001 From: ospab Date: Sat, 13 Jun 2026 02:55:28 +0300 Subject: [PATCH] =?UTF-8?q?feat(gui):=20split=20tunneling=20=E2=80=94=20ta?= =?UTF-8?q?g-chip=20UI,=20process=20picker=20with=20live=20process=20list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ostp-flutter/pubspec.yaml | 2 +- ostp-gui/src-tauri/Cargo.lock | 6 +- ostp-gui/src-tauri/src/lib.rs | 63 +++++++- ostp-gui/src-tauri/tauri.conf.json | 2 +- ostp-gui/src/index.html | 58 +++++++- ostp-gui/src/main.js | 163 +++++++++++++++++++-- ostp-gui/src/styles.css | 225 +++++++++++++++++++++++++++++ 7 files changed, 490 insertions(+), 29 deletions(-) diff --git a/ostp-flutter/pubspec.yaml b/ostp-flutter/pubspec.yaml index e396e88..8217f06 100644 --- a/ostp-flutter/pubspec.yaml +++ b/ostp-flutter/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 0.2.92+7 +version: 0.2.95+10 environment: sdk: ^3.11.4 diff --git a/ostp-gui/src-tauri/Cargo.lock b/ostp-gui/src-tauri/Cargo.lock index 7acac64..93b26aa 100644 --- a/ostp-gui/src-tauri/Cargo.lock +++ b/ostp-gui/src-tauri/Cargo.lock @@ -2665,7 +2665,7 @@ dependencies = [ [[package]] name = "ostp-client" -version = "0.2.87" +version = "0.2.95" dependencies = [ "anyhow", "base64 0.22.1", @@ -2699,7 +2699,7 @@ dependencies = [ [[package]] name = "ostp-core" -version = "0.2.87" +version = "0.2.95" dependencies = [ "anyhow", "bytes", @@ -2734,7 +2734,7 @@ dependencies = [ [[package]] name = "ostp-tun" -version = "0.2.87" +version = "0.2.95" dependencies = [ "anyhow", "libc", diff --git a/ostp-gui/src-tauri/src/lib.rs b/ostp-gui/src-tauri/src/lib.rs index 53abe5d..20d0619 100644 --- a/ostp-gui/src-tauri/src/lib.rs +++ b/ostp-gui/src-tauri/src/lib.rs @@ -242,6 +242,67 @@ fn get_autostart() -> bool { false } +/// Returns a sorted, deduplicated list of currently running process names. +#[tauri::command] +fn list_running_processes() -> Vec { + #[cfg(target_os = "windows")] + { + use std::process::Command; + if let Ok(out) = Command::new("tasklist") + .args(["/FO", "CSV", "/NH"]) + .output() + { + let text = String::from_utf8_lossy(&out.stdout); + let mut names: std::collections::BTreeSet = std::collections::BTreeSet::new(); + for line in text.lines() { + // CSV format: "chrome.exe","1234","Console","1","123,456 K" + let name = line.trim_matches('"').split('"').next().unwrap_or(""); + if !name.is_empty() && name.ends_with(".exe") { + names.insert(name.to_string()); + } + } + return names.into_iter().collect(); + } + } + #[cfg(target_os = "linux")] + { + use std::process::Command; + if let Ok(out) = Command::new("ps") + .args(["-e", "-o", "comm="]) + .output() + { + let text = String::from_utf8_lossy(&out.stdout); + let mut names: std::collections::BTreeSet = std::collections::BTreeSet::new(); + for line in text.lines() { + let name = line.trim(); + if !name.is_empty() { + names.insert(name.to_string()); + } + } + return names.into_iter().collect(); + } + } + #[cfg(target_os = "macos")] + { + use std::process::Command; + if let Ok(out) = Command::new("ps") + .args(["-e", "-o", "comm="]) + .output() + { + let text = String::from_utf8_lossy(&out.stdout); + let mut names: std::collections::BTreeSet = std::collections::BTreeSet::new(); + for line in text.lines() { + let name = line.trim().split('/').last().unwrap_or(""); + if !name.is_empty() { + names.insert(name.to_string()); + } + } + return names.into_iter().collect(); + } + } + vec![] +} + #[tauri::command] async fn get_config() -> Result { let path = get_config_path(); @@ -785,7 +846,7 @@ pub fn run() { } _ => {} }) - .invoke_handler(tauri::generate_handler![start_tunnel, stop_tunnel, reload_tunnel, get_tunnel_status, get_metrics, get_config, save_config, get_wintun_install_path, set_autostart, get_autostart]) + .invoke_handler(tauri::generate_handler![start_tunnel, stop_tunnel, reload_tunnel, get_tunnel_status, get_metrics, get_config, save_config, get_wintun_install_path, set_autostart, get_autostart, list_running_processes]) .run(tauri::generate_context!()) .expect("error while running tauri application"); } diff --git a/ostp-gui/src-tauri/tauri.conf.json b/ostp-gui/src-tauri/tauri.conf.json index 308bf8e..ba41066 100644 --- a/ostp-gui/src-tauri/tauri.conf.json +++ b/ostp-gui/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "ostp-gui", - "version": "0.2.92", + "version": "0.2.95", "identifier": "com.ospab.ostp", "build": { "frontendDist": "../src" diff --git a/ostp-gui/src/index.html b/ostp-gui/src/index.html index b226725..5a74e38 100644 --- a/ostp-gui/src/index.html +++ b/ostp-gui/src/index.html @@ -314,25 +314,49 @@ - +
Exclusions - one per line + traffic that bypasses the tunnel
- - + +
+
+ +
+ Enter domain suffix and press Enter. Example: google.com, *.local
- - + +
+
+ +
+ Local network ranges bypass the tunnel automatically
- - +
+ +
+ TUN only + +
+
+
+
+ +
+ Only works in TUN mode. Excluded apps bypass the VPN.
@@ -344,6 +368,24 @@
+ + +