-
-
Notifications
You must be signed in to change notification settings - Fork 75
feat: Rust backend with CLI #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
productdevbook
wants to merge
11
commits into
main
Choose a base branch
from
feat/rust-backend
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…d process management - Added core library structure in `lib.rs` with modules for configuration, error handling, process killing, models, and scanning. - Created data models for port and process information, including `PortInfo`, `ProcessType`, `PortFilter`, and `WatchedPort`. - Implemented port filtering functionality in `port_filter.rs` with comprehensive filtering options. - Developed macOS-specific port scanning using `lsof` in `darwin.rs`. - Added Linux and Windows scanner modules with placeholders for future implementation. - Included tests for models and filtering logic to ensure correctness.
13 tasks
13 tasks
- Add portkiller-ffi crate with UniFFI bindings for Swift integration - Create XCFramework build script for universal macOS library - Add RustPortScanner Swift wrapper for seamless integration - Remove Swift PortScanner - now fully powered by Rust backend - Update AppState to use Rust scanner exclusively - Simplify Settings UI with "Powered by Rust" badge - Update gitignore for Frameworks/ and .build/rust/ - Update backend README with FFI documentation BREAKING: Swift PortScanner removed, Rust backend is now required 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
… with notification settings
* refactor: move get_process_commands to utils.rs * feat: Implement Linux Port Scanner
…t forwarding - Implemented a new module for Kubernetes that includes service and namespace discovery via kubectl, port forward connection configuration, process management for kubectl port-forward and socat, and connection monitoring with auto-reconnect functionality. - Created data models for Kubernetes namespaces, services, and port forward configurations. - Developed a process manager to handle kubectl and socat processes, including lifecycle management and error handling. - Exposed Kubernetes functionality through FFI, allowing interaction with Swift, including fetching namespaces and services, managing port forward connections, and monitoring their states. - Added necessary tests for the new functionality to ensure reliability and correctness.
- Updated error handling in config_store and connection_manager for better clarity. - Replaced `std::sync::RwLock` with `parking_lot::RwLock` for improved performance. - Enhanced async file operations in config_store and connection_manager. - Simplified code structure in various modules, including discovery and process_manager. - Improved formatting and consistency in model definitions and tests. - Added default implementations where necessary for better usability. - Cleaned up unnecessary unwraps and improved error handling across the codebase.
…nux, and Windows - Added macOS port scanner using lsof (darwin.rs) - Added Linux port scanner using ss (linux.rs) - Created Windows port scanner interface (windows.rs) - Introduced scanner module to manage platform-specific implementations - Added utility functions for address parsing (utils.rs) - Defined domain models for port and process information (port.rs, watched.rs) - Established configuration and process killer ports for user settings management
…ux, and Windows - Deleted PortInfo, ProcessType, WatchedPort models and their associated tests. - Removed DarwinScanner and LinuxScanner implementations along with their tests. - Eliminated WindowsScanner stub and related code. - Cleaned up scanner module and utility functions.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🗺️ PortKiller Architecture Roadmap
Vision: Shared Backend Architecture
flowchart TB subgraph Core["🦀 portkiller-core (Rust Library)"] Scanner["📡 Port Scanner<br/>• macOS ✅<br/>• Linux 🚧<br/>• Windows 🚧"] Killer["💀 Process Killer<br/>• SIGTERM ✅<br/>• SIGKILL ✅<br/>• Graceful ✅"] Config["⚙️ Config Store<br/>• favorites ✅<br/>• watched ✅<br/>• JSON sync ✅"] Models["📦 Models<br/>• PortInfo ✅<br/>• ProcessType ✅<br/>• Filter ✅"] end subgraph Clients["Frontends"] CLI["🖥️ Rust CLI ✅<br/>• list, kill, fav, watch<br/>• TUI (ratatui)<br/>• JSON output"] Swift["🍎 Swift GUI 🚧<br/>• SwiftUI<br/>• Menu Bar<br/>• Sparkle"] Future["🔮 Future<br/>• Tauri (Linux/Win)<br/>• Wails"] end subgraph Storage["💾 Shared Storage"] JSON["~/.portkiller/config.json"] end Core --> CLI Core -->|"FFI (uniffi)"| Swift Core --> Future Config <--> JSON Swift <--> JSON✅ This PR: Phase 1 Complete
Core Library (
backend/core/)lsofparsingss/netstat(stub ready)netstat(stub ready)~/.portkiller/CLI (
backend/cli/)portkiller listportkiller kill <port>portkiller fav add/rm/listportkiller watch add/rm/listportkiller config📋 Roadmap
gantt title PortKiller Rust Backend Roadmap dateFormat YYYY-MM-DD section Phase 1 Core Library (macOS) :done, p1a, 2024-12-19, 1d Rust CLI + TUI :done, p1b, 2024-12-19, 1d section Phase 2 Linux Scanner :p2a, after p1b, 3d Windows Scanner :p2b, after p2a, 3d section Phase 3 Swift FFI (uniffi) :p3a, after p2b, 7d Replace PortScanner.swift :p3b, after p3a, 3d section Phase 4 Release Binaries :p4a, after p3b, 2d Tauri GUI (optional) :p4b, after p4a, 14d🧪 Test
🤖 Generated with Claude Code