Feat/openvpn split tunnel - #5
Open
RezaMahdaviiDev wants to merge 4 commits into
Open
Conversation
Start an optional OpenVPN profile right after Hiddify and before the Mihomo generation, so a private or corporate network is reachable without the side tunnel becoming the system gateway. The tunnel is never allowed to touch the routing table: the helper passes --route-noexec and installs only the routes it validated itself — the tunnel's own network, the scoped routes parsed out of the server's PUSH_REPLY, and the CIDRs the user listed. A default route is rejected in the config validator, the IPC validator, and the helper. A dropped tunnel therefore costs the user the networks behind it and nothing else. A .ovpn file is untrusted input to a root process, so the helper refuses any profile carrying up/down/route-up/plugin/script-security and pins --script-security 0 after --config as a second barrier. Selected traffic reaches the tunnel through a new OPENVPN route in the rules table: Mihomo gains a direct outbound bound to the helper-owned device, marked on Linux so the helper's policy table picks it up, bound by interface name on Windows. The OpenVPN server's own address is pinned DIRECT above every other rule so the tunnel's transport never loops back into the split TUN, and the OpenVPN rule-sets sit above private-networks so an RFC1918 host behind the tunnel is reachable. The side tunnel fails alone: openvpn.required is off by default, so a tunnel that will not start marks its own component degraded and Connect proceeds with the existing DIRECT/Hiddify split. See ADR 0067. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M9AxX8DzAZVMn831eckyNb
env_clear() costs a Windows process SYSTEMROOT, without which it cannot start, so the OpenVPN spawn now restores the same variables the Mihomo spawn does and hides the console window. The Linux-only PATH it used to set moves behind the same cfg. Also drops the interface_index lookup that became dead when the Windows routes moved to netsh. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M9AxX8DzAZVMn831eckyNb
The Linux ip-addr parser is unused in the Windows lib target, which failed CI under -D warnings. Gate it to unix/tests, restore PATH after env_clear, and cover the netsh parser. Co-authored-by: Cursor <cursoragent@cursor.com>
The dry-run workflow bundled the 0-byte Tauri placeholder instead of staging iran-split-helper, so Connect tried to elevate nothing and then showed a stale sharing-violation log. Stage the real helper, ignore empty placeholders, and retry locked copies. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
No description provided.