Net core: turning capture on restarts the core cleanly; remember TUN state
After the AmneziaVPN app held the routes, the running core kept Amnezia's utun as its way out; its own TUN reused the same utun name and sent everything into itself (no routes, no DNS). "tun on" now refuses while AmneziaVPN is open and restarts the core; the on/off choice is saved (tun.json) and used on the next start. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+10
-1
@@ -6,6 +6,7 @@ keys/*.vpnkey one vpn:// key per Amnezia connection (AmneziaWG 2/3); BroV
|
||||
src/saga.conf WireGuard client config -> only 192.168.8.0/24
|
||||
src/planet9.conf WireGuard client config -> only 192.168.68.0/24
|
||||
src/vless.sub 3x-ui subscription URL (all VLESS nodes)
|
||||
tun.json {"on": bool}: traffic capture as the user left it (survives restarts)
|
||||
hidden.json connections removed in BroV: {"amnezia": [...], "vless": [...]} (proxy
|
||||
names). Hidden ones stay on disk and can be returned from the panel.
|
||||
|
||||
@@ -44,6 +45,14 @@ def hidden():
|
||||
return {"amnezia": [], "vless": []}
|
||||
|
||||
|
||||
def tun_on():
|
||||
try:
|
||||
with open(os.path.join(CORE, "tun.json")) as f:
|
||||
return bool(json.load(f).get("on", True))
|
||||
except (OSError, ValueError, AttributeError):
|
||||
return True
|
||||
|
||||
|
||||
def rx(name):
|
||||
"""Literal regex for a node name (backslash only before ASCII punctuation: valid in Go
|
||||
regexp and regexp2 alike)."""
|
||||
@@ -194,7 +203,7 @@ def main():
|
||||
"external-controller": "127.0.0.1:9097", "secret": api_secret, "unified-delay": True,
|
||||
"find-process-mode": "strict",
|
||||
"profile": {"store-selected": True},
|
||||
"tun": {"enable": True, "stack": "mixed", "auto-route": True, "auto-detect-interface": True,
|
||||
"tun": {"enable": tun_on(), "stack": "mixed", "auto-route": True, "auto-detect-interface": True,
|
||||
"dns-hijack": ["any:53"], "mtu": 1400},
|
||||
"dns": {"enable": True, "ipv6": False, "enhanced-mode": "fake-ip", "fake-ip-range": "198.18.0.1/16",
|
||||
"fake-ip-filter": ["*.lan", "*.local", "+.duckdns.org"],
|
||||
|
||||
Reference in New Issue
Block a user