feat(tunnels): import SSH forwards as tunnels + working per-tunnel au…#81
Open
BungeeDEV wants to merge 1 commit into
Open
feat(tunnels): import SSH forwards as tunnels + working per-tunnel au…#81BungeeDEV wants to merge 1 commit into
BungeeDEV wants to merge 1 commit into
Conversation
…to-start Parse LocalForward/RemoteForward/DynamicForward from ~/.ssh/config and import each as a tunnel bound to the host. Make auto-start actually fire: tunnels flagged auto_start start when their host connects and stop on the host's last disconnect, with a global "auto-start by default" setting that seeds new (and imported) tunnels. - parser: Local/Remote/Dynamic directives ([bind:]port, [ipv6]:port, host:hostport); idempotent re-import via a natural key + host reuse - backend forwarding: Local + Dynamic (SOCKS5) + Remote (tcpip_forward); each tunnel owns its own SSH connection with clean teardown and is ProxyJump-aware for Local/Dynamic - lifecycle: start on connect_saved_host, stop when the host's last session disconnects; per-instance teardown guard so a reconnect can't let a stale listener clobber the restarted tunnel - surface bind/start failures as toasts (friendly hint for ports <1024) - frontend: forward-type selector, type/SOCKS badges, global Settings toggle seeding new tunnels' auto_start Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
8e8ee5a to
1bbb492
Compare
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
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.
This pull request improves the SSH config import process by making port-forwarding (tunnel) imports idempotent and more robust. It introduces a natural-key lookup for port-forwarding rules to avoid duplicate tunnels when re-importing the same SSH config, and adds support for parsing and importing SSH port-forwarding directives directly from config files. The changes are covered by new tests to ensure correctness.
SSH config import improvements:
Added parsing and extraction of port-forwarding directives (
LocalForward,RemoteForward,DynamicForward) from SSH config files, mapping them to a newSshForwardstruct and including them inSshConfigEntryandSshConfigImportEntry(src-tauri/src/import/mod.rs). [1] [2] [3] [4] [5] [6]On import, port-forwarding rules are now created per host entry, but only if an identical rule does not already exist (idempotency). This is achieved by checking for an existing rule using a new natural-key lookup before creating a new one (
src-tauri/src/import/commands.rs). [1] [2] [3]Database enhancements:
find_pf_rule_id_by_natural_keyandget_pf_rulemethods toHostDbto support natural-key lookup and retrieval of port-forwarding rules, enabling idempotent import and easier rule management (src-tauri/src/db/mod.rs). [1] [2]Testing and reliability:
src-tauri/src/db/mod.rs,src-tauri/src/import/commands.rs). [1] [2]