diff --git a/.github/workflows/multibuild.yaml b/.github/workflows/multibuild.yaml index bc66fe75d..e82f61e25 100644 --- a/.github/workflows/multibuild.yaml +++ b/.github/workflows/multibuild.yaml @@ -64,7 +64,7 @@ jobs: - run: cp -r bundles/${{ matrix.bundle }}/* sshnp/ - run: cp LICENSE sshnp - run: tar -cvzf tarball/${{ matrix.output-name }}.tgz sshnp - - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 + - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 with: name: x64_binaries path: ./packages/sshnoports/tarball/${{ matrix.output-name }}.tgz @@ -96,7 +96,7 @@ jobs: --platform ${{ matrix.platform }} -o type=tar,dest=bins.tar . - run: mkdir tarballs - run: tar -xvf bins.tar -C tarballs - - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 + - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 with: name: other_binaries path: ./packages/sshnoports/tarballs/${{ matrix.output-name }}.tgz diff --git a/packages/noports_core/CHANGELOG.md b/packages/noports_core/CHANGELOG.md index 2b306437c..e9db560a5 100644 --- a/packages/noports_core/CHANGELOG.md +++ b/packages/noports_core/CHANGELOG.md @@ -1,3 +1,7 @@ +# 5.0.3 +- feat: Add `--storage-path` option to sshnpd to allow users to specify where + it keeps any locally stored data + # 5.0.2 - fix: Add more supported ssh public key types to the send ssh public key filters for sshnpd. diff --git a/packages/noports_core/lib/src/sshnpd/sshnpd_params.dart b/packages/noports_core/lib/src/sshnpd/sshnpd_params.dart index 79365c6f9..1b46028e1 100644 --- a/packages/noports_core/lib/src/sshnpd/sshnpd_params.dart +++ b/packages/noports_core/lib/src/sshnpd/sshnpd_params.dart @@ -19,6 +19,7 @@ class SshnpdParams { final int localSshdPort; final String ephemeralPermissions; final SupportedSshAlgorithm sshAlgorithm; + final String? storagePath; // Non param variables static final ArgParser parser = _createArgParser(); @@ -37,6 +38,7 @@ class SshnpdParams { required this.localSshdPort, required this.ephemeralPermissions, required this.sshAlgorithm, + required this.storagePath, }); static Future fromArgs(List args) async { @@ -76,6 +78,7 @@ class SshnpdParams { int.tryParse(r['local-sshd-port']) ?? DefaultArgs.localSshdPort, ephemeralPermissions: r['ephemeral-permissions'], sshAlgorithm: SupportedSshAlgorithm.fromString(r['ssh-algorithm']), + storagePath: r['storage-path'], ); } @@ -171,6 +174,12 @@ class SshnpdParams { allowed: SupportedSshAlgorithm.values.map((c) => c.toString()).toList(), ); + parser.addOption( + 'storage-path', + mandatory: false, + help: r'Directory for local storage. Defaults to $HOME/.sshnp/${atSign}/storage', + ); + return parser; } } diff --git a/packages/noports_core/lib/src/version.dart b/packages/noports_core/lib/src/version.dart index d89252b2b..8b7226fbe 100644 --- a/packages/noports_core/lib/src/version.dart +++ b/packages/noports_core/lib/src/version.dart @@ -1,2 +1,2 @@ // Generated code. Do not modify. -const packageVersion = '5.0.2'; +const packageVersion = '5.0.3'; diff --git a/packages/noports_core/pubspec.yaml b/packages/noports_core/pubspec.yaml index d1987ec1a..0a0ed14d8 100644 --- a/packages/noports_core/pubspec.yaml +++ b/packages/noports_core/pubspec.yaml @@ -2,7 +2,7 @@ name: noports_core description: Core library code for sshnoports homepage: https://docs.atsign.com/ -version: 5.0.2 +version: 5.0.3 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/sshnoports/bin/sshnpd.dart b/packages/sshnoports/bin/sshnpd.dart index 6ed958d71..ae6376c81 100644 --- a/packages/sshnoports/bin/sshnpd.dart +++ b/packages/sshnoports/bin/sshnpd.dart @@ -18,6 +18,7 @@ void main(List args) async { atsign: p.deviceAtsign, atKeysFilePath: p.atKeysFilePath, rootDomain: p.rootDomain, + storagePath: p.storagePath, ), usageCallback: (e, s) { printVersion(); diff --git a/packages/sshnoports/lib/src/create_at_client_cli.dart b/packages/sshnoports/lib/src/create_at_client_cli.dart index 38dce2240..2be586b94 100644 --- a/packages/sshnoports/lib/src/create_at_client_cli.dart +++ b/packages/sshnoports/lib/src/create_at_client_cli.dart @@ -10,6 +10,7 @@ Future createAtClientCli({ required String homeDirectory, required String atsign, required String atKeysFilePath, + String? storagePath, String? pathExtension, String subDirectory = '.sshnp', String namespace = DefaultArgs.namespace, @@ -21,12 +22,13 @@ Future createAtClientCli({ if (pathExtension != null) { pathBase += '$pathExtension${Platform.pathSeparator}'; } + storagePath ??= path.normalize('$pathBase/storage'); AtOnboardingPreference atOnboardingConfig = AtOnboardingPreference() - ..hiveStoragePath = path.normalize('$pathBase/storage') + ..hiveStoragePath = storagePath ..namespace = namespace ..downloadPath = path.normalize('$homeDirectory/$subDirectory/files') ..isLocalStoreRequired = true - ..commitLogPath = path.normalize('$pathBase/storage/commitLog') + ..commitLogPath = path.normalize('$storagePath/commitLog') ..fetchOfflineNotifications = false ..atKeysFilePath = atKeysFilePath ..atProtocolEmitted = Version(2, 0, 0) diff --git a/packages/sshnoports/lib/src/version.dart b/packages/sshnoports/lib/src/version.dart index 6f629a2a5..2572e8013 100644 --- a/packages/sshnoports/lib/src/version.dart +++ b/packages/sshnoports/lib/src/version.dart @@ -1,2 +1,2 @@ // Generated code. Do not modify. -const packageVersion = '4.0.4'; +const packageVersion = '4.0.5'; diff --git a/packages/sshnoports/pubspec.lock b/packages/sshnoports/pubspec.lock index 1cfc13fae..cdcd6ddab 100644 --- a/packages/sshnoports/pubspec.lock +++ b/packages/sshnoports/pubspec.lock @@ -572,11 +572,10 @@ packages: noports_core: dependency: "direct main" description: - name: noports_core - sha256: c9228de65289f6946c07f12606feb106a6c53d65ca22b69f3da10a71f3f12e0d - url: "https://pub.dev" - source: hosted - version: "5.0.2" + path: "../noports_core" + relative: true + source: path + version: "5.0.3" openssh_ed25519: dependency: transitive description: diff --git a/packages/sshnoports/pubspec.yaml b/packages/sshnoports/pubspec.yaml index 48506ee9a..c4e14876b 100644 --- a/packages/sshnoports/pubspec.yaml +++ b/packages/sshnoports/pubspec.yaml @@ -1,13 +1,13 @@ name: sshnoports publish_to: none -version: 4.0.4 +version: 4.0.5 environment: sdk: ">=3.0.0 <4.0.0" dependencies: - noports_core: 5.0.2 + noports_core: 5.0.3 at_onboarding_cli: 1.4.1 dependency_overrides: