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, 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 005fa2db2..892a10132 100644 --- a/packages/sshnoports/lib/sshnp/sshnp_impl.dart +++ b/packages/sshnoports/lib/sshnp/sshnp_impl.dart @@ -232,7 +232,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 f493f0dba..c248df624 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; /// Special Arguments late final bool listDevices; @@ -44,6 +45,7 @@ class SSHNPParams { this.rsa = false, this.remoteUsername, String? atKeysFilePath, + this.rootDomain = 'root.atsign.org', this.listDevices = false, }) { // Do we have a username ? @@ -80,6 +82,7 @@ class SSHNPParams { verbose: partial.verbose ?? false, remoteUsername: partial.remoteUsername, atKeysFilePath: partial.atKeysFilePath, + rootDomain: partial.rootDomain ?? 'root.atsign.org', listDevices: partial.listDevices, ); } @@ -102,6 +105,7 @@ class SSHNPPartialParams { late final bool? rsa; late final String? remoteUsername; late final bool? verbose; + late final String? rootDomain; /// Special Params // N.B. config file is a meta param and doesn't need to be included @@ -123,6 +127,7 @@ class SSHNPPartialParams { this.rsa, this.remoteUsername, this.verbose, + this.rootDomain, this.listDevices = false, }); @@ -149,6 +154,7 @@ class SSHNPPartialParams { rsa: params2.rsa ?? params1.rsa, remoteUsername: params2.remoteUsername ?? params1.remoteUsername, verbose: params2.verbose ?? params1.verbose, + rootDomain: params2.rootDomain ?? params1.rootDomain, listDevices: params2.listDevices || params1.listDevices, ); } @@ -167,6 +173,7 @@ class SSHNPPartialParams { rsa: args['rsa'], remoteUsername: args['remote-user-name'], verbose: args['verbose'], + rootDomain: args['root-domain'], listDevices: args['list-devices'] ?? false, ); } diff --git a/packages/sshnoports/lib/sshnpd/sshnpd_impl.dart b/packages/sshnoports/lib/sshnpd/sshnpd_impl.dart index 5b427428f..a20b2f3d0 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; } } 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; } } 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: