From a6210a77d093768cd04717102576d904bdb988f9 Mon Sep 17 00:00:00 2001 From: Edward Moscardini Date: Thu, 10 Oct 2024 13:55:24 -0400 Subject: [PATCH 1/3] fix --jwt help message --- router_registration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/router_registration.py b/router_registration.py index fbf5160..7b69e65 100755 --- a/router_registration.py +++ b/router_registration.py @@ -314,7 +314,7 @@ def create_parser(): mgroup.add_argument('registration_key', nargs='?', help='NetFoundry Edge-Router Registration Key') mgroup.add_argument('--jwt', type=str, - help='Path to file based jwt') + help='JWT string') parser.add_argument('-f', '--force', action="store_false", help='Forcefully proceed with re-enrollment', From 25968809943195c204f8daa544f293558fce6667 Mon Sep 17 00:00:00 2001 From: Edward Moscardini Date: Thu, 10 Oct 2024 14:20:32 -0400 Subject: [PATCH 2/3] updated change log; fix issue with fabric port --- CHANGELOG | 7 +++++++ router_registration.py | 32 ++++++++++++++++---------------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 8f944a3..de0a1eb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.6.4] - 2024-10-10 + +### Fixed + +- Fixed issue with help message on --jwt. +- Fixed issue with fabric port on ziti version above 30 if link listener was eneabled. + ## [1.6.3] - 2024-09-25 - Add --skipSoftwareMgmtPortCheck to allow skipping just the software management port check. diff --git a/router_registration.py b/router_registration.py index 7b69e65..cd51ecf 100755 --- a/router_registration.py +++ b/router_registration.py @@ -167,9 +167,8 @@ def check_port(ip_host, port, timeout): if port == 6262: logging.info("Found port 6262 closed - could be intentional") return True - else: - logging.error("Socket error: %s", error) - return False + logging.error("Socket error: %s", error) + return False finally: socket_connection.close() @@ -306,7 +305,7 @@ def create_parser(): :return: A Namespace containing arguments """ - __version__ = '1.6.3' + __version__ = '1.6.4' parser = argparse.ArgumentParser() mgroup = parser.add_mutually_exclusive_group(required=True) @@ -645,6 +644,13 @@ def handle_ziti_router_auto_enroll(args, router_info, enrollment_commands, regis enrollment_commands.append('tls:0.0.0.0:443') enrollment_commands.append(f"{args.edge}:443") + # set fabric_port depending on ziti version + fabric_port = 80 + if ziti_router_auto_enroll.compare_semver( + router_info['productMetadata']['zitiVersion'],'0.30.0' + ) >= 0: + fabric_port = 443 + # if the setting was selected in the NetFoundry console # if overriding the fabric listener add a manual linkListener # Otherwise the auto_enroller will create one if passing in @@ -653,8 +659,8 @@ def handle_ziti_router_auto_enroll(args, router_info, enrollment_commands, regis if args.fabric: enrollment_commands.append('--linkListeners') enrollment_commands.append('transport') - enrollment_commands.append('tls:0.0.0.0:80') - enrollment_commands.append(f"tls:{args.fabric}:80") + enrollment_commands.append(f"tls:0.0.0.0:{fabric_port}") + enrollment_commands.append(f"tls:{args.fabric}:{fabric_port}") else: enrollment_commands.append('--assumePublic') @@ -688,16 +694,10 @@ def handle_ziti_router_auto_enroll(args, router_info, enrollment_commands, regis enrollment_commands.append(router_info['productMetadata']['zitiBinaryBundleLinuxAMD64']) - # check if ziti version is 0.30.0 or above - fabric_port = ziti_router_auto_enroll.compare_semver( - router_info['productMetadata']['zitiVersion'],'0.30.0' - ) - - # pass in fabric port 443 for versions 0.30.0 and above - if fabric_port >= 0: - logging.debug("Setting fabric port to 443") - enrollment_commands.append('--controllerFabricPort') - enrollment_commands.append('443') + # pass in fabric port + logging.debug("Setting fabric port to %s", fabric_port) + enrollment_commands.append('--controllerFabricPort') + enrollment_commands.append("{fabric_port}") # add proxy if specified if args.proxyAddress: From 1498570be024e16de3cda23c78b9126328490660 Mon Sep 17 00:00:00 2001 From: Edward Moscardini Date: Thu, 10 Oct 2024 14:36:56 -0400 Subject: [PATCH 3/3] typo --- router_registration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/router_registration.py b/router_registration.py index cd51ecf..0ad6f39 100755 --- a/router_registration.py +++ b/router_registration.py @@ -697,7 +697,7 @@ def handle_ziti_router_auto_enroll(args, router_info, enrollment_commands, regis # pass in fabric port logging.debug("Setting fabric port to %s", fabric_port) enrollment_commands.append('--controllerFabricPort') - enrollment_commands.append("{fabric_port}") + enrollment_commands.append(f"{fabric_port}") # add proxy if specified if args.proxyAddress: