aspera-cli 4.20.0 → 4.21.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +41 -3
- data/CONTRIBUTING.md +69 -142
- data/README.md +687 -461
- data/bin/ascli +5 -14
- data/bin/asession +3 -5
- data/examples/get_proto_file.rb +4 -3
- data/examples/proxy.pac +20 -20
- data/lib/aspera/agent/base.rb +2 -0
- data/lib/aspera/agent/connect.rb +20 -2
- data/lib/aspera/agent/{alpha.rb → desktop.rb} +12 -18
- data/lib/aspera/agent/direct.rb +30 -31
- data/lib/aspera/agent/node.rb +1 -11
- data/lib/aspera/agent/{trsdk.rb → transferd.rb} +37 -51
- data/lib/aspera/api/alee.rb +1 -1
- data/lib/aspera/api/aoc.rb +13 -8
- data/lib/aspera/api/cos_node.rb +1 -1
- data/lib/aspera/api/node.rb +49 -32
- data/lib/aspera/ascp/installation.rb +98 -77
- data/lib/aspera/ascp/management.rb +27 -6
- data/lib/aspera/cli/extended_value.rb +9 -3
- data/lib/aspera/cli/formatter.rb +155 -154
- data/lib/aspera/cli/info.rb +2 -1
- data/lib/aspera/cli/main.rb +12 -0
- data/lib/aspera/cli/manager.rb +4 -4
- data/lib/aspera/cli/plugin.rb +2 -2
- data/lib/aspera/cli/plugins/aoc.rb +134 -73
- data/lib/aspera/cli/plugins/config.rb +114 -83
- data/lib/aspera/cli/plugins/cos.rb +1 -0
- data/lib/aspera/cli/plugins/faspex.rb +4 -2
- data/lib/aspera/cli/plugins/faspex5.rb +29 -14
- data/lib/aspera/cli/plugins/node.rb +51 -41
- data/lib/aspera/cli/transfer_progress.rb +2 -0
- data/lib/aspera/cli/version.rb +1 -1
- data/lib/aspera/command_line_builder.rb +1 -1
- data/lib/aspera/coverage.rb +5 -3
- data/lib/aspera/environment.rb +59 -16
- data/lib/aspera/faspex_postproc.rb +3 -5
- data/lib/aspera/hash_ext.rb +2 -12
- data/lib/aspera/node_simulator.rb +230 -112
- data/lib/aspera/oauth/base.rb +40 -48
- data/lib/aspera/oauth/factory.rb +41 -2
- data/lib/aspera/oauth/jwt.rb +4 -1
- data/lib/aspera/persistency_action_once.rb +1 -1
- data/lib/aspera/persistency_folder.rb +20 -2
- data/lib/aspera/preview/generator.rb +13 -10
- data/lib/aspera/preview/options.rb +2 -2
- data/lib/aspera/preview/terminal.rb +1 -1
- data/lib/aspera/preview/utils.rb +11 -6
- data/lib/aspera/products/connect.rb +82 -0
- data/lib/aspera/products/desktop.rb +30 -0
- data/lib/aspera/products/other.rb +82 -0
- data/lib/aspera/products/transferd.rb +61 -0
- data/lib/aspera/rest.rb +22 -17
- data/lib/aspera/secret_hider.rb +9 -2
- data/lib/aspera/ssh.rb +31 -24
- data/lib/aspera/temp_file_manager.rb +5 -4
- data/lib/aspera/transfer/parameters.rb +2 -1
- data/lib/aspera/transfer/spec.yaml +22 -20
- data/lib/aspera/transfer/sync.rb +1 -5
- data/lib/aspera/transfer/uri.rb +2 -2
- data/lib/aspera/uri_reader.rb +18 -1
- data/lib/transferd_pb.rb +86 -0
- data/lib/transferd_services_pb.rb +84 -0
- data.tar.gz.sig +0 -0
- metadata +13 -166
- metadata.gz.sig +0 -0
- data/examples/build_exec +0 -74
- data/examples/build_exec_rubyc +0 -40
- data/lib/aspera/ascp/products.rb +0 -168
- data/lib/transfer_pb.rb +0 -84
- data/lib/transfer_services_pb.rb +0 -82
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aspera-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.21.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Laurent Martin
|
@@ -37,7 +37,7 @@ cert_chain:
|
|
37
37
|
eTf9kxhVM40wGQOECVNA8UsEEZHD48eF+csUYZtAJOF5oxTI8UyV9T/o6CgO0c9/
|
38
38
|
Gzz+Qm5ULOUcPiJLjSpaiTrkiIVYiDGnqNSr6R1Hb1c=
|
39
39
|
-----END CERTIFICATE-----
|
40
|
-
date: 2025-
|
40
|
+
date: 2025-04-11 00:00:00.000000000 Z
|
41
41
|
dependencies:
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: blankslate
|
@@ -115,14 +115,14 @@ dependencies:
|
|
115
115
|
requirements:
|
116
116
|
- - "~>"
|
117
117
|
- !ruby/object:Gem::Version
|
118
|
-
version: '7.
|
118
|
+
version: '7.3'
|
119
119
|
type: :runtime
|
120
120
|
prerelease: false
|
121
121
|
version_requirements: !ruby/object:Gem::Requirement
|
122
122
|
requirements:
|
123
123
|
- - "~>"
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version: '7.
|
125
|
+
version: '7.3'
|
126
126
|
- !ruby/object:Gem::Dependency
|
127
127
|
name: rainbow
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|
@@ -165,20 +165,6 @@ dependencies:
|
|
165
165
|
- - "~>"
|
166
166
|
- !ruby/object:Gem::Version
|
167
167
|
version: '2.0'
|
168
|
-
- !ruby/object:Gem::Dependency
|
169
|
-
name: symmetric-encryption
|
170
|
-
requirement: !ruby/object:Gem::Requirement
|
171
|
-
requirements:
|
172
|
-
- - "~>"
|
173
|
-
- !ruby/object:Gem::Version
|
174
|
-
version: '4.6'
|
175
|
-
type: :runtime
|
176
|
-
prerelease: false
|
177
|
-
version_requirements: !ruby/object:Gem::Requirement
|
178
|
-
requirements:
|
179
|
-
- - "~>"
|
180
|
-
- !ruby/object:Gem::Version
|
181
|
-
version: '4.6'
|
182
168
|
- !ruby/object:Gem::Dependency
|
183
169
|
name: terminal-table
|
184
170
|
requirement: !ruby/object:Gem::Requirement
|
@@ -249,146 +235,6 @@ dependencies:
|
|
249
235
|
- - "~>"
|
250
236
|
- !ruby/object:Gem::Version
|
251
237
|
version: '1.0'
|
252
|
-
- !ruby/object:Gem::Dependency
|
253
|
-
name: grpc-tools
|
254
|
-
requirement: !ruby/object:Gem::Requirement
|
255
|
-
requirements:
|
256
|
-
- - "~>"
|
257
|
-
- !ruby/object:Gem::Version
|
258
|
-
version: 1.67.0
|
259
|
-
type: :development
|
260
|
-
prerelease: false
|
261
|
-
version_requirements: !ruby/object:Gem::Requirement
|
262
|
-
requirements:
|
263
|
-
- - "~>"
|
264
|
-
- !ruby/object:Gem::Version
|
265
|
-
version: 1.67.0
|
266
|
-
- !ruby/object:Gem::Dependency
|
267
|
-
name: rake
|
268
|
-
requirement: !ruby/object:Gem::Requirement
|
269
|
-
requirements:
|
270
|
-
- - "~>"
|
271
|
-
- !ruby/object:Gem::Version
|
272
|
-
version: '13.0'
|
273
|
-
type: :development
|
274
|
-
prerelease: false
|
275
|
-
version_requirements: !ruby/object:Gem::Requirement
|
276
|
-
requirements:
|
277
|
-
- - "~>"
|
278
|
-
- !ruby/object:Gem::Version
|
279
|
-
version: '13.0'
|
280
|
-
- !ruby/object:Gem::Dependency
|
281
|
-
name: reek
|
282
|
-
requirement: !ruby/object:Gem::Requirement
|
283
|
-
requirements:
|
284
|
-
- - "~>"
|
285
|
-
- !ruby/object:Gem::Version
|
286
|
-
version: 6.1.0
|
287
|
-
type: :development
|
288
|
-
prerelease: false
|
289
|
-
version_requirements: !ruby/object:Gem::Requirement
|
290
|
-
requirements:
|
291
|
-
- - "~>"
|
292
|
-
- !ruby/object:Gem::Version
|
293
|
-
version: 6.1.0
|
294
|
-
- !ruby/object:Gem::Dependency
|
295
|
-
name: rspec
|
296
|
-
requirement: !ruby/object:Gem::Requirement
|
297
|
-
requirements:
|
298
|
-
- - "~>"
|
299
|
-
- !ruby/object:Gem::Version
|
300
|
-
version: '3.0'
|
301
|
-
type: :development
|
302
|
-
prerelease: false
|
303
|
-
version_requirements: !ruby/object:Gem::Requirement
|
304
|
-
requirements:
|
305
|
-
- - "~>"
|
306
|
-
- !ruby/object:Gem::Version
|
307
|
-
version: '3.0'
|
308
|
-
- !ruby/object:Gem::Dependency
|
309
|
-
name: rubocop
|
310
|
-
requirement: !ruby/object:Gem::Requirement
|
311
|
-
requirements:
|
312
|
-
- - "~>"
|
313
|
-
- !ruby/object:Gem::Version
|
314
|
-
version: '1.12'
|
315
|
-
type: :development
|
316
|
-
prerelease: false
|
317
|
-
version_requirements: !ruby/object:Gem::Requirement
|
318
|
-
requirements:
|
319
|
-
- - "~>"
|
320
|
-
- !ruby/object:Gem::Version
|
321
|
-
version: '1.12'
|
322
|
-
- !ruby/object:Gem::Dependency
|
323
|
-
name: rubocop-ast
|
324
|
-
requirement: !ruby/object:Gem::Requirement
|
325
|
-
requirements:
|
326
|
-
- - "~>"
|
327
|
-
- !ruby/object:Gem::Version
|
328
|
-
version: '1.4'
|
329
|
-
type: :development
|
330
|
-
prerelease: false
|
331
|
-
version_requirements: !ruby/object:Gem::Requirement
|
332
|
-
requirements:
|
333
|
-
- - "~>"
|
334
|
-
- !ruby/object:Gem::Version
|
335
|
-
version: '1.4'
|
336
|
-
- !ruby/object:Gem::Dependency
|
337
|
-
name: rubocop-performance
|
338
|
-
requirement: !ruby/object:Gem::Requirement
|
339
|
-
requirements:
|
340
|
-
- - "~>"
|
341
|
-
- !ruby/object:Gem::Version
|
342
|
-
version: '1.10'
|
343
|
-
type: :development
|
344
|
-
prerelease: false
|
345
|
-
version_requirements: !ruby/object:Gem::Requirement
|
346
|
-
requirements:
|
347
|
-
- - "~>"
|
348
|
-
- !ruby/object:Gem::Version
|
349
|
-
version: '1.10'
|
350
|
-
- !ruby/object:Gem::Dependency
|
351
|
-
name: rubocop-shopify
|
352
|
-
requirement: !ruby/object:Gem::Requirement
|
353
|
-
requirements:
|
354
|
-
- - "~>"
|
355
|
-
- !ruby/object:Gem::Version
|
356
|
-
version: '2.0'
|
357
|
-
type: :development
|
358
|
-
prerelease: false
|
359
|
-
version_requirements: !ruby/object:Gem::Requirement
|
360
|
-
requirements:
|
361
|
-
- - "~>"
|
362
|
-
- !ruby/object:Gem::Version
|
363
|
-
version: '2.0'
|
364
|
-
- !ruby/object:Gem::Dependency
|
365
|
-
name: simplecov
|
366
|
-
requirement: !ruby/object:Gem::Requirement
|
367
|
-
requirements:
|
368
|
-
- - "~>"
|
369
|
-
- !ruby/object:Gem::Version
|
370
|
-
version: '0.22'
|
371
|
-
type: :development
|
372
|
-
prerelease: false
|
373
|
-
version_requirements: !ruby/object:Gem::Requirement
|
374
|
-
requirements:
|
375
|
-
- - "~>"
|
376
|
-
- !ruby/object:Gem::Version
|
377
|
-
version: '0.22'
|
378
|
-
- !ruby/object:Gem::Dependency
|
379
|
-
name: solargraph
|
380
|
-
requirement: !ruby/object:Gem::Requirement
|
381
|
-
requirements:
|
382
|
-
- - "~>"
|
383
|
-
- !ruby/object:Gem::Version
|
384
|
-
version: '0.48'
|
385
|
-
type: :development
|
386
|
-
prerelease: false
|
387
|
-
version_requirements: !ruby/object:Gem::Requirement
|
388
|
-
requirements:
|
389
|
-
- - "~>"
|
390
|
-
- !ruby/object:Gem::Version
|
391
|
-
version: '0.48'
|
392
238
|
description: Command line interface for IBM Aspera products
|
393
239
|
email:
|
394
240
|
- laurent.martin.aspera@fr.ibm.com
|
@@ -404,19 +250,17 @@ files:
|
|
404
250
|
- README.md
|
405
251
|
- bin/ascli
|
406
252
|
- bin/asession
|
407
|
-
- examples/build_exec
|
408
|
-
- examples/build_exec_rubyc
|
409
253
|
- examples/build_package.sh
|
410
254
|
- examples/dascli
|
411
255
|
- examples/get_proto_file.rb
|
412
256
|
- examples/proxy.pac
|
413
|
-
- lib/aspera/agent/alpha.rb
|
414
257
|
- lib/aspera/agent/base.rb
|
415
258
|
- lib/aspera/agent/connect.rb
|
259
|
+
- lib/aspera/agent/desktop.rb
|
416
260
|
- lib/aspera/agent/direct.rb
|
417
261
|
- lib/aspera/agent/httpgw.rb
|
418
262
|
- lib/aspera/agent/node.rb
|
419
|
-
- lib/aspera/agent/
|
263
|
+
- lib/aspera/agent/transferd.rb
|
420
264
|
- lib/aspera/api/alee.rb
|
421
265
|
- lib/aspera/api/aoc.rb
|
422
266
|
- lib/aspera/api/ats.rb
|
@@ -426,7 +270,6 @@ files:
|
|
426
270
|
- lib/aspera/ascmd.rb
|
427
271
|
- lib/aspera/ascp/installation.rb
|
428
272
|
- lib/aspera/ascp/management.rb
|
429
|
-
- lib/aspera/ascp/products.rb
|
430
273
|
- lib/aspera/assert.rb
|
431
274
|
- lib/aspera/cli/basic_auth_plugin.rb
|
432
275
|
- lib/aspera/cli/error.rb
|
@@ -496,6 +339,10 @@ files:
|
|
496
339
|
- lib/aspera/preview/terminal.rb
|
497
340
|
- lib/aspera/preview/utils.rb
|
498
341
|
- lib/aspera/preview/video_error.png
|
342
|
+
- lib/aspera/products/connect.rb
|
343
|
+
- lib/aspera/products/desktop.rb
|
344
|
+
- lib/aspera/products/other.rb
|
345
|
+
- lib/aspera/products/transferd.rb
|
499
346
|
- lib/aspera/proxy_auto_config.js
|
500
347
|
- lib/aspera/proxy_auto_config.rb
|
501
348
|
- lib/aspera/rest.rb
|
@@ -518,8 +365,8 @@ files:
|
|
518
365
|
- lib/aspera/uri_reader.rb
|
519
366
|
- lib/aspera/web_auth.rb
|
520
367
|
- lib/aspera/web_server_simple.rb
|
521
|
-
- lib/
|
522
|
-
- lib/
|
368
|
+
- lib/transferd_pb.rb
|
369
|
+
- lib/transferd_services_pb.rb
|
523
370
|
homepage: https://github.com/IBM/aspera-cli
|
524
371
|
licenses:
|
525
372
|
- Apache-2.0
|
@@ -538,7 +385,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
538
385
|
requirements:
|
539
386
|
- - ">="
|
540
387
|
- !ruby/object:Gem::Version
|
541
|
-
version: '
|
388
|
+
version: '3.1'
|
542
389
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
543
390
|
requirements:
|
544
391
|
- - ">="
|
metadata.gz.sig
CHANGED
Binary file
|
data/examples/build_exec
DELETED
@@ -1,74 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
# Glibc for various OS: https://gist.github.com/wagenet/35adca1a032cec2999d47b6c40aa45b1
|
3
|
-
# https://distrowatch.com/table.php?distribution=redhat
|
4
|
-
# RHEL 8 : glibc 2.28
|
5
|
-
# RHEL 9 : glibc 2.34
|
6
|
-
# https://distrowatch.com/table.php?distribution=ubuntu
|
7
|
-
# Ubuntu 18.10 cosmic : glibc 2.28
|
8
|
-
# Ubuntu 21.10 impish : gblic 2.34
|
9
|
-
# https://www.ibm.com/docs/en/ahts/4.4.x?topic=release-notes
|
10
|
-
# ascp 4.4.5 : gblic 2.28
|
11
|
-
# dwarfs requires boost >= 1.65
|
12
|
-
# boost requires cmake >= 3.30
|
13
|
-
set -e
|
14
|
-
|
15
|
-
if test $# -ne 5; then
|
16
|
-
echo "Usage: $0 <CLI_EXECUTABLE> <CLI_PATH> <GEM_NAME> <GEM_VERSION> <DIR_TMP>" 1>&2
|
17
|
-
exit 1
|
18
|
-
fi
|
19
|
-
|
20
|
-
CLI_EXECUTABLE=$1
|
21
|
-
CLI_PATH=$(realpath $2)
|
22
|
-
GEM_NAME=$3
|
23
|
-
GEM_VERSION=$4
|
24
|
-
DIR_TMP=$(realpath $5)
|
25
|
-
|
26
|
-
echo "Building: $(basename $CLI_EXECUTABLE)"
|
27
|
-
|
28
|
-
# tebako compilation
|
29
|
-
tebako_env=$DIR_TMP/tebako-env
|
30
|
-
# project files (gem)
|
31
|
-
tebako_root=$DIR_TMP/tebako-root
|
32
|
-
# only provide the name, not path
|
33
|
-
tebako_entry=$(basename $CLI_PATH)
|
34
|
-
tebako_output=$CLI_EXECUTABLE
|
35
|
-
|
36
|
-
container_tag=alpine-3.17
|
37
|
-
#container_tag=ubuntu-20.04
|
38
|
-
|
39
|
-
gem install tebako
|
40
|
-
mkdir -p $tebako_env $tebako_root
|
41
|
-
(cd $tebako_root && gem fetch $GEM_NAME:$GEM_VERSION)
|
42
|
-
case $(uname -s) in
|
43
|
-
Darwin)
|
44
|
-
brew update
|
45
|
-
# install tools
|
46
|
-
brew install bash binutils bison flex gnu-sed lz4 pkg-config xz
|
47
|
-
# install libs
|
48
|
-
brew install boost double-conversion fmt gdbm glog jemalloc libevent libffi libsodium libyaml ncurses openssl@3 zlib
|
49
|
-
# make sure tools are reachable
|
50
|
-
export PATH=/opt/homebrew/opt/flex/bin:/opt/homebrew/opt/bison/bin:$PATH
|
51
|
-
# remove binutils from path so that macos `ar` is used
|
52
|
-
export PATH=$(echo $PATH|tr : \\n|grep -v /binutils/|tr \\n :)
|
53
|
-
;;
|
54
|
-
Linux)
|
55
|
-
tebako_root=/mnt/w
|
56
|
-
tebako_prefix="podman run -it --rm -v $PWD:$tebako_root ghcr.io/tamatebako/tebako-${container_tag}:0.8.6"
|
57
|
-
tebako_opts=--patchelf
|
58
|
-
tebako_output=$tebako_root/$(basename $CLI_EXECUTABLE)
|
59
|
-
;;
|
60
|
-
LinuxLocal)
|
61
|
-
dnf module reset ruby
|
62
|
-
dnf module install ruby:3.3
|
63
|
-
dnf install -y cmake git bash sudo autoconf boost-devel flex bison make clang binutils-devel libevent-devel libacl-devel sed python3 pkgconfig curl lz4-devel openssl-devel zlib-devel xz zip unzip tar xz-devel elfutils-devel libffi-devel gdbm-devel ncurses-devel readline-devel ruby-devel gettext-devel brotli-devel clang libxslt-devel
|
64
|
-
echo TODO
|
65
|
-
exit 1
|
66
|
-
dnf install
|
67
|
-
;;
|
68
|
-
*)
|
69
|
-
echo "This OS is not supported." >&2
|
70
|
-
exit 1
|
71
|
-
;;
|
72
|
-
esac
|
73
|
-
set -x
|
74
|
-
exec $tebako_prefix tebako press --root=$tebako_root --entry-point=$tebako_entry --output=$tebako_output --prefix=$tebako_env $tebako_opts
|
data/examples/build_exec_rubyc
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
|
3
|
-
set -e
|
4
|
-
|
5
|
-
if test $# -ne 5; then
|
6
|
-
echo "Usage: $0 <CLI_EXECUTABLE> <CLI_PATH> <GEM_NAME> <GEM_VERSION> <DIR_TMP>" 1>&2
|
7
|
-
exit 1
|
8
|
-
fi
|
9
|
-
|
10
|
-
CLI_EXECUTABLE=$1
|
11
|
-
CLI_PATH=$(realpath $2)
|
12
|
-
GEM_NAME=$3
|
13
|
-
GEM_VERSION=$4
|
14
|
-
DIR_TMP=$(realpath $5)
|
15
|
-
|
16
|
-
echo "Building: $(basename $CLI_EXECUTABLE)"
|
17
|
-
|
18
|
-
# https://github.com/you54f/ruby-packer
|
19
|
-
# https://github.com/you54f/ruby-packer/releases
|
20
|
-
set -e
|
21
|
-
FOLDER="$(dirname $0)/../tmp"
|
22
|
-
RUBYC="$FOLDER/rubyc"
|
23
|
-
if test ! -e "$RUBYC"; then
|
24
|
-
mkdir -p "$FOLDER"
|
25
|
-
case $(uname -sm|tr ' ' -) in
|
26
|
-
Darwin-arm64)
|
27
|
-
curl -L https://github.com/YOU54F/ruby-packer/releases/download/rel-20230812/rubyc-Darwin-arm64.tar.gz | tar -xz -C "$FOLDER"
|
28
|
-
mv "$FOLDER/rubyc-Darwin-arm64" "$RUBYC"
|
29
|
-
;;
|
30
|
-
Linux-x86_64)
|
31
|
-
curl -L https://github.com/YOU54F/ruby-packer/releases/download/rel-20230812/rubyc-Linux-x86_64.tar.gz | tar -xz -C "$FOLDER"
|
32
|
-
mv "$FOLDER/rubyc-Linux-x86_64" "$RUBYC"
|
33
|
-
;;
|
34
|
-
*)
|
35
|
-
echo "This architecture is not supported." >&2
|
36
|
-
exit 1
|
37
|
-
;;
|
38
|
-
esac
|
39
|
-
fi
|
40
|
-
exec "$RUBYC" -o "$CLI_EXECUTABLE" "$CLI_PATH"
|
data/lib/aspera/ascp/products.rb
DELETED
@@ -1,168 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# cspell:ignore LOCALAPPDATA
|
4
|
-
require 'aspera/environment'
|
5
|
-
|
6
|
-
module Aspera
|
7
|
-
module Ascp
|
8
|
-
# find Aspera standard products installation in standard paths
|
9
|
-
class Products
|
10
|
-
# known product names
|
11
|
-
CONNECT = 'IBM Aspera Connect'
|
12
|
-
ASPERA = 'IBM Aspera (Client)'
|
13
|
-
CLI_V1 = 'Aspera CLI (deprecated)'
|
14
|
-
DRIVE = 'Aspera Drive (deprecated)'
|
15
|
-
HSTS = 'IBM Aspera High-Speed Transfer Server'
|
16
|
-
# product information manifest: XML (part of aspera product)
|
17
|
-
INFO_META_FILE = 'product-info.mf'
|
18
|
-
BIN_SUBFOLDER = 'bin'
|
19
|
-
ETC_SUBFOLDER = 'etc'
|
20
|
-
VAR_RUN_SUBFOLDER = File.join('var', 'run')
|
21
|
-
|
22
|
-
@@found_products = nil # rubocop:disable Style/ClassVars
|
23
|
-
class << self
|
24
|
-
# @return product folders depending on OS fields
|
25
|
-
# :expected M app name is taken from the manifest if present, else defaults to this value
|
26
|
-
# :app_root M main folder for the application
|
27
|
-
# :log_root O location of log files (Linux uses syslog)
|
28
|
-
# :run_root O only for Connect Client, location of http port file
|
29
|
-
# :sub_bin O subfolder with executables, default : bin
|
30
|
-
def product_locations_on_current_os
|
31
|
-
result =
|
32
|
-
case Aspera::Environment.os
|
33
|
-
when Aspera::Environment::OS_WINDOWS then [{
|
34
|
-
expected: CONNECT,
|
35
|
-
app_root: File.join(ENV.fetch('LOCALAPPDATA', nil), 'Programs', 'Aspera', 'Aspera Connect'),
|
36
|
-
log_root: File.join(ENV.fetch('LOCALAPPDATA', nil), 'Aspera', 'Aspera Connect', 'var', 'log'),
|
37
|
-
run_root: File.join(ENV.fetch('LOCALAPPDATA', nil), 'Aspera', 'Aspera Connect')
|
38
|
-
}, {
|
39
|
-
expected: CLI_V1,
|
40
|
-
app_root: File.join('C:', 'Program Files', 'Aspera', 'cli'),
|
41
|
-
log_root: File.join('C:', 'Program Files', 'Aspera', 'cli', 'var', 'log')
|
42
|
-
}, {
|
43
|
-
expected: HSTS,
|
44
|
-
app_root: File.join('C:', 'Program Files', 'Aspera', 'Enterprise Server'),
|
45
|
-
log_root: File.join('C:', 'Program Files', 'Aspera', 'Enterprise Server', 'var', 'log')
|
46
|
-
}]
|
47
|
-
when Aspera::Environment::OS_MACOS then [{
|
48
|
-
expected: CONNECT,
|
49
|
-
app_root: File.join(Dir.home, 'Applications', 'Aspera Connect.app'),
|
50
|
-
log_root: File.join(Dir.home, 'Library', 'Logs', 'Aspera_Connect'),
|
51
|
-
run_root: File.join(Dir.home, 'Library', 'Application Support', 'Aspera', 'Aspera Connect'),
|
52
|
-
sub_bin: File.join('Contents', 'Resources')
|
53
|
-
}, {
|
54
|
-
expected: CONNECT,
|
55
|
-
app_root: File.join('', 'Applications', 'Aspera Connect.app'),
|
56
|
-
log_root: File.join(Dir.home, 'Library', 'Logs', 'Aspera_Connect'),
|
57
|
-
run_root: File.join(Dir.home, 'Library', 'Application Support', 'Aspera', 'Aspera Connect'),
|
58
|
-
sub_bin: File.join('Contents', 'Resources')
|
59
|
-
}, {
|
60
|
-
expected: CONNECT,
|
61
|
-
app_root: File.join(Dir.home, 'Applications', 'IBM Aspera Connect.app'),
|
62
|
-
log_root: File.join(Dir.home, 'Library', 'Logs', 'Aspera_Connect'),
|
63
|
-
run_root: File.join(Dir.home, 'Library', 'Application Support', 'Aspera', 'Aspera Connect'),
|
64
|
-
sub_bin: File.join('Contents', 'Resources')
|
65
|
-
}, {
|
66
|
-
expected: CONNECT,
|
67
|
-
app_root: File.join('', 'Applications', 'IBM Aspera Connect.app'),
|
68
|
-
log_root: File.join(Dir.home, 'Library', 'Logs', 'Aspera_Connect'),
|
69
|
-
run_root: File.join(Dir.home, 'Library', 'Application Support', 'Aspera', 'Aspera Connect'),
|
70
|
-
sub_bin: File.join('Contents', 'Resources')
|
71
|
-
}, {
|
72
|
-
expected: CLI_V1,
|
73
|
-
app_root: File.join(Dir.home, 'Applications', 'Aspera CLI'),
|
74
|
-
log_root: File.join(Dir.home, 'Library', 'Logs', 'Aspera')
|
75
|
-
}, {
|
76
|
-
expected: HSTS,
|
77
|
-
app_root: File.join('', 'Library', 'Aspera'),
|
78
|
-
log_root: File.join(Dir.home, 'Library', 'Logs', 'Aspera')
|
79
|
-
}, {
|
80
|
-
expected: DRIVE,
|
81
|
-
app_root: File.join('', 'Applications', 'Aspera Drive.app'),
|
82
|
-
log_root: File.join(Dir.home, 'Library', 'Logs', 'Aspera_Drive'),
|
83
|
-
sub_bin: File.join('Contents', 'Resources')
|
84
|
-
}, {
|
85
|
-
expected: ASPERA,
|
86
|
-
app_root: File.join('', 'Applications', 'IBM Aspera.app'),
|
87
|
-
log_root: File.join(Dir.home, 'Library', 'Logs', 'IBM Aspera'),
|
88
|
-
sub_bin: File.join('Contents', 'Resources', 'sdk', 'aspera', 'bin')
|
89
|
-
}]
|
90
|
-
else [{ # other: Linux and Unix family
|
91
|
-
expected: CONNECT,
|
92
|
-
app_root: File.join(Dir.home, '.aspera', 'connect'),
|
93
|
-
run_root: File.join(Dir.home, '.aspera', 'connect')
|
94
|
-
}, {
|
95
|
-
expected: CLI_V1,
|
96
|
-
app_root: File.join(Dir.home, '.aspera', 'cli')
|
97
|
-
}, {
|
98
|
-
expected: HSTS,
|
99
|
-
app_root: File.join('', 'opt', 'aspera')
|
100
|
-
}]
|
101
|
-
end
|
102
|
-
result # .each {|item| item.deep_do {|h, _k, _v, _m|h.freeze}}.freeze
|
103
|
-
end
|
104
|
-
|
105
|
-
# @return the list of installed products in format of product_locations_on_current_os
|
106
|
-
def installed_products
|
107
|
-
if @@found_products.nil?
|
108
|
-
scan_locations = product_locations_on_current_os.clone
|
109
|
-
# add SDK as first search path
|
110
|
-
scan_locations.unshift({
|
111
|
-
expected: 'SDK',
|
112
|
-
app_root: Installation.instance.sdk_folder,
|
113
|
-
sub_bin: ''
|
114
|
-
})
|
115
|
-
# search installed products: with ascp
|
116
|
-
@@found_products = scan_locations.select! do |item| # rubocop:disable Style/ClassVars
|
117
|
-
# skip if not main folder
|
118
|
-
next false unless Dir.exist?(item[:app_root])
|
119
|
-
Log.log.debug{"Found #{item[:app_root]}"}
|
120
|
-
sub_bin = item[:sub_bin] || BIN_SUBFOLDER
|
121
|
-
item[:ascp_path] = File.join(item[:app_root], sub_bin, ascp_filename)
|
122
|
-
# skip if no ascp
|
123
|
-
next false unless File.exist?(item[:ascp_path])
|
124
|
-
# read info from product info file if present
|
125
|
-
product_info_file = "#{item[:app_root]}/#{INFO_META_FILE}"
|
126
|
-
if File.exist?(product_info_file)
|
127
|
-
res_s = XmlSimple.xml_in(File.read(product_info_file), {'ForceArray' => false})
|
128
|
-
item[:name] = res_s['name']
|
129
|
-
item[:version] = res_s['version']
|
130
|
-
else
|
131
|
-
item[:name] = item[:expected]
|
132
|
-
end
|
133
|
-
true # select this version
|
134
|
-
end
|
135
|
-
end
|
136
|
-
return @@found_products
|
137
|
-
end
|
138
|
-
|
139
|
-
# filename for ascp with optional extension (Windows)
|
140
|
-
def ascp_filename
|
141
|
-
return "ascp#{Environment.exe_extension}"
|
142
|
-
end
|
143
|
-
|
144
|
-
# @return folder paths for specified applications
|
145
|
-
# @param name Connect or CLI
|
146
|
-
def folders(name)
|
147
|
-
found = Products.installed_products.select{|i|i[:expected].eql?(name) || i[:name].eql?(name)}
|
148
|
-
raise "Product: #{name} not found, please install." if found.empty?
|
149
|
-
return found.first
|
150
|
-
end
|
151
|
-
|
152
|
-
# @return the file path of local connect where API's URI can be read
|
153
|
-
def connect_uri
|
154
|
-
connect = folders(CONNECT)
|
155
|
-
folder = File.join(connect[:run_root], VAR_RUN_SUBFOLDER)
|
156
|
-
['', 's'].each do |ext|
|
157
|
-
uri_file = File.join(folder, "http#{ext}.uri")
|
158
|
-
Log.log.debug{"checking connect port file: #{uri_file}"}
|
159
|
-
if File.exist?(uri_file)
|
160
|
-
return File.open(uri_file, &:gets).strip
|
161
|
-
end
|
162
|
-
end
|
163
|
-
raise "no connect uri file found in #{folder}"
|
164
|
-
end
|
165
|
-
end
|
166
|
-
end
|
167
|
-
end
|
168
|
-
end
|