diff --git a/core/cli_api.py b/core/cli_api.py index 1324772..90e2b49 100644 --- a/core/cli_api.py +++ b/core/cli_api.py @@ -147,6 +147,16 @@ def backup_hysteria(): '''Backups Hysteria configuration.''' run_cmd(['bash', Command.BACKUP_HYSTERIA.value]) + +def generate_hysteria_obfs(): + '''Generates 'obfs' in Hysteria2 configuration.''' + run_cmd(['bash', Command.MANAGE_OBFS.value, '--generate']) + + +def remove_hysteria_obfs(): + '''Removes 'obfs' from Hysteria2 configuration.''' + run_cmd(['bash', Command.MANAGE_OBFS.value, '--remove']) + # endregion # region User @@ -261,20 +271,6 @@ def server_info() -> str | None: return run_cmd(['bash', Command.SERVER_INFO.value]) -def manage_obfs(remove: bool, generate: bool): - ''' - Manages 'obfs' in Hysteria2 configuration. - ''' - if remove and generate: - raise InvalidInputError('Error: You cannot use both --remove and --generate at the same time') - elif remove: - run_cmd(['bash', Command.MANAGE_OBFS.value, '--remove']) - elif generate: - run_cmd(['bash', Command.MANAGE_OBFS.value, '--generate']) - else: - raise InvalidInputError('Error: Please specify either --remove or --generate.') - - def ip_address(edit: bool, ipv4: str, ipv6: str): ''' Manages IP address configuration with edit options.