From 9af671ea3737557973477209423d7e5435e35aa1 Mon Sep 17 00:00:00 2001 From: JeremyTubongbanua Date: Sat, 5 Aug 2023 16:16:20 -0400 Subject: [PATCH 1/5] fix: directory typo in manual tool docker compose yaml --- tests/end2end_tests/tools/manual-tool/local/docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/end2end_tests/tools/manual-tool/local/docker-compose.yaml b/tests/end2end_tests/tools/manual-tool/local/docker-compose.yaml index eee5d075a..6ccee686f 100644 --- a/tests/end2end_tests/tools/manual-tool/local/docker-compose.yaml +++ b/tests/end2end_tests/tools/manual-tool/local/docker-compose.yaml @@ -5,7 +5,7 @@ services: image-manual-local: build: context: ../../../../../ - dockerfile: test/end2end_tests/image/Dockerfile + dockerfile: tests/end2end_tests/image/Dockerfile target: manual-local image: atsigncompany/sshnp-e2e-manual:local deploy: From 1d1d04399a250dc7e98b32a6a91003409466a5eb Mon Sep 17 00:00:00 2001 From: JeremyTubongbanua Date: Sat, 5 Aug 2023 16:32:48 -0400 Subject: [PATCH 2/5] feat: add root domain to createAtClientCli --- packages/sshnoports/lib/common/create_at_client_cli.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/sshnoports/lib/common/create_at_client_cli.dart b/packages/sshnoports/lib/common/create_at_client_cli.dart index 7e2027bcd..d6b64d8f6 100644 --- a/packages/sshnoports/lib/common/create_at_client_cli.dart +++ b/packages/sshnoports/lib/common/create_at_client_cli.dart @@ -12,6 +12,7 @@ Future createAtClientCli({ String? pathExtension, String subDirectory = '.sshnp', String namespace = 'sshnp', + String rootDomain = 'root.atsign.org', }) async { // Now on to the atPlatform startup //onboarding preference builder can be used to set onboardingService parameters @@ -30,7 +31,9 @@ Future createAtClientCli({ '$pathBase/storage/commitLog'.replaceAll('/', Platform.pathSeparator) ..fetchOfflineNotifications = false ..atKeysFilePath = atKeysFilePath - ..atProtocolEmitted = Version(2, 0, 0); + ..atProtocolEmitted = Version(2, 0, 0) + ..rootDomain = rootDomain + ; AtOnboardingService onboardingService = AtOnboardingServiceImpl( atsign, atOnboardingConfig, From b9f7cee50e3236133ac88488037307e3ac8ff5cd Mon Sep 17 00:00:00 2001 From: JeremyTubongbanua Date: Sat, 5 Aug 2023 16:32:58 -0400 Subject: [PATCH 3/5] feat: sshnpd root domain option --- packages/sshnoports/lib/sshnpd/sshnpd_impl.dart | 1 + packages/sshnoports/lib/sshnpd/sshnpd_params.dart | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/packages/sshnoports/lib/sshnpd/sshnpd_impl.dart b/packages/sshnoports/lib/sshnpd/sshnpd_impl.dart index 87ccc80af..3200320c1 100644 --- a/packages/sshnoports/lib/sshnpd/sshnpd_impl.dart +++ b/packages/sshnoports/lib/sshnpd/sshnpd_impl.dart @@ -80,6 +80,7 @@ class SSHNPDImpl implements SSHNPD { homeDirectory: p.homeDirectory, atsign: p.deviceAtsign, atKeysFilePath: p.atKeysFilePath, + rootDomain: p.rootDomain, ); var sshnpd = SSHNPD( diff --git a/packages/sshnoports/lib/sshnpd/sshnpd_params.dart b/packages/sshnoports/lib/sshnpd/sshnpd_params.dart index e8251cfcc..2fffa1790 100644 --- a/packages/sshnoports/lib/sshnpd/sshnpd_params.dart +++ b/packages/sshnoports/lib/sshnpd/sshnpd_params.dart @@ -12,6 +12,7 @@ class SSHNPDParams { late final String deviceAtsign; late final bool verbose; late final SupportedSshClient sshClient; + late final String rootDomain; // Non param variables static final ArgParser parser = _createArgParser(); @@ -43,6 +44,8 @@ class SSHNPDParams { sshClient = SupportedSshClient.values .firstWhere((c) => c.cliArg == r['ssh-client']); + + rootDomain = r['root-domain']; } static ArgParser _createArgParser() { @@ -100,6 +103,12 @@ class SSHNPDParams { allowed: SupportedSshClient.values.map((c) => c.cliArg).toList(), help: 'What to use for outbound ssh connections.'); + parser.addOption('root-domain', + mandatory: false, + defaultsTo: 'root.atsign.org', + help: 'atDirectory domain', + ); + return parser; } } From 83fa59ec941b5b8093572a96873232d11e878491 Mon Sep 17 00:00:00 2001 From: JeremyTubongbanua Date: Sun, 6 Aug 2023 15:58:57 -0400 Subject: [PATCH 4/5] feat: sshnp root domain --- packages/sshnoports/lib/sshnp/sshnp_arg.dart | 7 +++++++ packages/sshnoports/lib/sshnp/sshnp_impl.dart | 4 +++- packages/sshnoports/lib/sshnp/sshnp_params.dart | 7 +++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/sshnoports/lib/sshnp/sshnp_arg.dart b/packages/sshnoports/lib/sshnp/sshnp_arg.dart index 5112bea0b..e6f1c058c 100644 --- a/packages/sshnoports/lib/sshnp/sshnp_arg.dart +++ b/packages/sshnoports/lib/sshnp/sshnp_arg.dart @@ -118,5 +118,12 @@ class SSHNPArg { abbr: 'u', help: 'username to use in the ssh session on the remote host', ), + SSHNPArg( + name: 'root-domain', + help: 'atDirectory domain', + defaultsTo: 'root.atsign.org', + mandatory: false, + format: ArgFormat.option, + ), ]; } diff --git a/packages/sshnoports/lib/sshnp/sshnp_impl.dart b/packages/sshnoports/lib/sshnp/sshnp_impl.dart index 658e96c1b..30715a103 100644 --- a/packages/sshnoports/lib/sshnp/sshnp_impl.dart +++ b/packages/sshnoports/lib/sshnp/sshnp_impl.dart @@ -228,7 +228,9 @@ class SSHNPImpl implements SSHNP { atsign: p.clientAtSign!, namespace: '${p.device}.sshnp', pathExtension: sessionId, - atKeysFilePath: p.atKeysFilePath); + atKeysFilePath: p.atKeysFilePath, + rootDomain: p.rootDomain + ); var sshnp = SSHNP( atClient: atClient, diff --git a/packages/sshnoports/lib/sshnp/sshnp_params.dart b/packages/sshnoports/lib/sshnp/sshnp_params.dart index af08f44f0..a19434466 100644 --- a/packages/sshnoports/lib/sshnp/sshnp_params.dart +++ b/packages/sshnoports/lib/sshnp/sshnp_params.dart @@ -27,6 +27,7 @@ class SSHNPParams { late final bool rsa; late final String? remoteUsername; late final bool verbose; + late final String rootDomain; SSHNPParams({ required this.clientAtSign, @@ -41,6 +42,7 @@ class SSHNPParams { this.rsa = false, this.remoteUsername, String? atKeysFilePath, + this.rootDomain = 'root.atsign.org', }) { // Do we have a username ? username = getUserName(throwIfNull: true)!; @@ -76,6 +78,7 @@ class SSHNPParams { verbose: partial.verbose ?? false, remoteUsername: partial.remoteUsername, atKeysFilePath: partial.atKeysFilePath, + rootDomain: partial.rootDomain ?? 'root.atsign.org', ); } } @@ -96,6 +99,7 @@ class SSHNPPartialParams { late final bool? rsa; late final String? remoteUsername; late final bool? verbose; + late final String? rootDomain; // Non param variables static final ArgParser parser = _createArgParser(); @@ -113,6 +117,7 @@ class SSHNPPartialParams { this.rsa, this.remoteUsername, this.verbose, + this.rootDomain, }); factory SSHNPPartialParams.empty() { @@ -138,6 +143,7 @@ class SSHNPPartialParams { rsa: params2.rsa ?? params1.rsa, remoteUsername: params2.remoteUsername ?? params1.remoteUsername, verbose: params2.verbose ?? params1.verbose, + rootDomain: params2.rootDomain ?? params1.rootDomain, ); } @@ -155,6 +161,7 @@ class SSHNPPartialParams { rsa: args['rsa'], remoteUsername: args['remote-user-name'], verbose: args['verbose'], + rootDomain: args['root-domain'], ); } From facf961d3761bd5cffd4ea775b4a57cdbda7cf15 Mon Sep 17 00:00:00 2001 From: JeremyTubongbanua Date: Sun, 6 Aug 2023 15:59:03 -0400 Subject: [PATCH 5/5] feat: sshrvd root domain --- packages/sshnoports/lib/sshrvd/sshrvd_impl.dart | 1 + packages/sshnoports/lib/sshrvd/sshrvd_params.dart | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/packages/sshnoports/lib/sshrvd/sshrvd_impl.dart b/packages/sshnoports/lib/sshrvd/sshrvd_impl.dart index 5e66c95a3..c9ad70060 100644 --- a/packages/sshnoports/lib/sshrvd/sshrvd_impl.dart +++ b/packages/sshnoports/lib/sshrvd/sshrvd_impl.dart @@ -67,6 +67,7 @@ class SSHRVDImpl implements SSHRVD { atsign: p.atSign, atKeysFilePath: p.atKeysFilePath, namespace: SSHRVD.namespace, + rootDomain: p.rootDomain, ); var sshrvd = SSHRVD( diff --git a/packages/sshnoports/lib/sshrvd/sshrvd_params.dart b/packages/sshnoports/lib/sshrvd/sshrvd_params.dart index 8338a40cf..f1f2245ae 100644 --- a/packages/sshnoports/lib/sshrvd/sshrvd_params.dart +++ b/packages/sshnoports/lib/sshrvd/sshrvd_params.dart @@ -10,6 +10,7 @@ class SSHRVDParams { late final String ipAddress; late final bool verbose; late final bool snoop; + late final String rootDomain; // Non param variables static final ArgParser parser = _createArgParser(); @@ -33,6 +34,7 @@ class SSHRVDParams { verbose = r['verbose']; snoop = r['snoop']; + rootDomain = r['root-domain']; } static ArgParser _createArgParser() { @@ -77,6 +79,12 @@ class SSHRVDParams { defaultsTo: false, help: 'Snoop on traffic passing through service', ); + parser.addOption( + 'root-domain', + mandatory: false, + defaultsTo: 'root.atsign.org', + help: 'atDirectory domain', + ); return parser; } }