From 0931200c796af253482652820c4a0485415aade4 Mon Sep 17 00:00:00 2001 From: SimplifiedPrivacy Date: Thu, 15 Oct 2026 19:13:57 -0400 Subject: [PATCH] Fixing wireguard breaking due to changes in systemwide state from singbox kill checking wireguard first --- .../networking/systemwide/encrypted_proxy/singbox_runner.py | 2 +- core/services/networking/systemwide/systemwide_wireguard.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/services/networking/systemwide/encrypted_proxy/singbox_runner.py b/core/services/networking/systemwide/encrypted_proxy/singbox_runner.py index 2ee4a3a..aac91f4 100644 --- a/core/services/networking/systemwide/encrypted_proxy/singbox_runner.py +++ b/core/services/networking/systemwide/encrypted_proxy/singbox_runner.py @@ -146,7 +146,7 @@ def end_singbox() -> Result: # 1. WireGuard Cleanup. In case, it was a different protocol. if current_state and get_protocol_enum(current_state.profile_id) == ProtocolChoice.WIREGUARD: - from core.services.networking.systemwide_wireguard import terminate_system_connection + from core.services.networking.systemwide.systemwide_wireguard import terminate_system_connection terminate_system_connection( firewall_setting=current_state.firewalled, dns_setting=current_state.dns_set diff --git a/core/services/networking/systemwide/systemwide_wireguard.py b/core/services/networking/systemwide/systemwide_wireguard.py index 7bc4dc5..ad04dba 100644 --- a/core/services/networking/systemwide/systemwide_wireguard.py +++ b/core/services/networking/systemwide/systemwide_wireguard.py @@ -1,3 +1,4 @@ +from core.models.enum_models import ProtocolChoice from core.services.networking.general_connection_tools.testing_evaluating import await_connection, system_uses_wireguard_interface, terminate_tor_connection from core.services.keys_and_verifications.endpoint_verification import verify_wireguard_endpoint from core.models.Result import Result, ResultError @@ -141,9 +142,10 @@ def __establish_system_connection( current_state = SystemStateController.create( profile_id=profile.id, firewalled=firewall_setting, # intended setting, not result yet - dns_set=dns_setting # intended setting, not result yet + dns_set=dns_setting, # intended setting, not result yet, + protocol=ProtocolChoice.WIREGUARD ) - + # ============= PREP SETTINGS ============= if connection_observer: connection_observer.notify("connecting", "Getting Interface Name..")