From f95c4cf8d2e8d37bd0cf700d446cb7c2b0d8a489 Mon Sep 17 00:00:00 2001 From: codeking Date: Wed, 5 Nov 2025 02:25:57 +0100 Subject: [PATCH] Add support for WireGuard endpoint verification --- cli/__main__.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/cli/__main__.py b/cli/__main__.py index 7f20adc..3559d80 100644 --- a/cli/__main__.py +++ b/cli/__main__.py @@ -1,5 +1,5 @@ from core.Constants import Constants -from core.Errors import MissingSubscriptionError, InvalidSubscriptionError, UnknownConnectionTypeError, ConnectionUnprotectedError, ProfileStateConflictError +from core.Errors import MissingSubscriptionError, InvalidSubscriptionError, UnknownConnectionTypeError, ConnectionUnprotectedError, EndpointVerificationError, ProfileStateConflictError from core.controllers.ApplicationController import ApplicationController from core.controllers.ApplicationVersionController import ApplicationVersionController from core.controllers.ClientController import ClientController @@ -95,9 +95,14 @@ if __name__ == '__main__': pristine_parser = argparse.ArgumentParser(add_help=False) pristine_parser.add_argument('--pristine', '-p', action='store_true') - security_parser = argparse.ArgumentParser(add_help=False) - security_parser.add_argument('--disable-connection-protection', action='store_true') - security_parser.add_argument('--disable-profile-state-protection', action='store_true') + connection_protection_parser = argparse.ArgumentParser(add_help=False) + connection_protection_parser.add_argument('--without-connection-protection', action='store_true') + + endpoint_verification_parser = argparse.ArgumentParser(add_help=False) + endpoint_verification_parser.add_argument('--without-endpoint-verification', action='store_true') + + profile_state_protection_parser = argparse.ArgumentParser(add_help=False) + profile_state_protection_parser.add_argument('--without-profile-state-protection', action='store_true') main_parser = argparse.ArgumentParser(prog=__get_name()) main_parser.add_argument('--version', '-v', action='version', version=f'{__get_name()} v{__get_version()}') @@ -133,8 +138,8 @@ if __name__ == '__main__': profile_subparsers.add_parser('destroy', parents=[profile_base_parser]) - profile_subparsers.add_parser('enable', parents=[profile_base_parser, pristine_parser, security_parser]) - profile_subparsers.add_parser('disable', parents=[profile_base_parser, security_parser]) + profile_subparsers.add_parser('enable', parents=[profile_base_parser, pristine_parser, connection_protection_parser, endpoint_verification_parser, profile_state_protection_parser]) + profile_subparsers.add_parser('disable', parents=[profile_base_parser, connection_protection_parser]) application_parser = main_subparsers.add_parser('application') application_subparsers = application_parser.add_subparsers(title='subcommands', dest='subcommand') @@ -171,10 +176,13 @@ if __name__ == '__main__': ignore = [] - if getattr(arguments, 'disable_connection_protection', False): + if getattr(arguments, 'without_connection_protection', False): ignore.append(ConnectionUnprotectedError) - if getattr(arguments, 'disable_profile_state_protection', False): + if getattr(arguments, 'without_endpoint_verification', False): + ignore.append(EndpointVerificationError) + + if getattr(arguments, 'without_profile_state_protection', False): ignore.append(ProfileStateConflictError) ignore = tuple(ignore)