aspera-cli 4.0.0.pre3 → 4.0.0
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
- data/README.md +38 -27
- data/docs/README.erb.md +15 -22
- data/lib/aspera/cli/plugins/aoc.rb +23 -21
- data/lib/aspera/cli/plugins/faspex.rb +1 -1
- data/lib/aspera/cli/version.rb +1 -1
- data/lib/aspera/fasp/installation.rb +15 -14
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7172a58b5d9de3455d25667a9eb6d3475d66b2a334be6e2cdee987a041d1d89f
|
|
4
|
+
data.tar.gz: 7408405f727f10b137a15c453cd3d89770256fc8392ab311b1318b873bffd18d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 80fff0696b7a65c05b823483e8f07f34d37a3b0c95c6658ed23e4837b4b223143b46146aae53604a5f80e1695e12f598d53bbb900d3d34a5c31094e441904e82
|
|
7
|
+
data.tar.gz: 76c299e2daed96ff33af518f1d1df97eba35bab38c9c8eec86f2bf5b623455dec6bc6bbddba3fbd390b3ebb7d34a68ed7054a74999e215cbbfa88840af8d311a
|
data/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[comment1]: # (Do not edit this README.md, edit docs/README.erb.md, for details, read docs/README.md)
|
|
2
2
|
# `ascli` : a Command Line for IBM Aspera products
|
|
3
3
|
|
|
4
|
-
Version : 4.0.0
|
|
4
|
+
Version : 4.0.0
|
|
5
5
|
|
|
6
6
|
_Laurent/2016-2021_
|
|
7
7
|
|
|
@@ -14,17 +14,11 @@ Disclaimers:
|
|
|
14
14
|
|
|
15
15
|
* This has not yet been officially released so things may change
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
This manual addresses three parts:
|
|
20
|
-
|
|
21
|
-
* `ascli` : The command line tool
|
|
22
|
-
* `asession` : starting a FASP Session with JSON parameters
|
|
23
|
-
* `Aspera` : includes a Ruby "FASPManager"
|
|
17
|
+
`ascli` is also a great tool to learn Aspera APIs.
|
|
24
18
|
|
|
25
19
|
In examples, command line operations (starting with `$`) are shown using a standard shell: `bash` or `zsh`.
|
|
26
20
|
|
|
27
|
-
Command line parameters in
|
|
21
|
+
Command line parameters in examples beginning with `my_`, like `my_param_value` are user-provided value and not fixed value commands.
|
|
28
22
|
|
|
29
23
|
# Quick Start
|
|
30
24
|
|
|
@@ -36,7 +30,7 @@ Once the gem is installed, `ascli` shall be accessible:
|
|
|
36
30
|
|
|
37
31
|
```
|
|
38
32
|
$ ascli --version
|
|
39
|
-
4.0.0
|
|
33
|
+
4.0.0
|
|
40
34
|
```
|
|
41
35
|
|
|
42
36
|
## First use
|
|
@@ -112,19 +106,21 @@ The following sections provide information on the installation.
|
|
|
112
106
|
## <a name="ruby"></a>Ruby
|
|
113
107
|
|
|
114
108
|
A ruby interpreter is required to run the tool or to use the gem and tool.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
109
|
+
|
|
110
|
+
Ruby minimum version: > 2.4
|
|
111
|
+
|
|
112
|
+
Ruby 3 is also supported.
|
|
113
|
+
|
|
114
|
+
Any type of Ruby installation can be used (installer, rpm, rvm, ...).
|
|
118
115
|
|
|
119
116
|
Refer to the following sections for a proposed method for specific operating systems.
|
|
120
117
|
|
|
121
118
|
### macOS
|
|
122
119
|
|
|
123
|
-
|
|
124
120
|
MacOS 10.13+ (High Sierra) comes with a recent Ruby, so you can use it directly, you will need to install aspera-cli using `sudo` :
|
|
125
121
|
|
|
126
122
|
```
|
|
127
|
-
$ sudo gem install aspera-cli
|
|
123
|
+
$ sudo gem install aspera-cli
|
|
128
124
|
```
|
|
129
125
|
|
|
130
126
|
Alternatively, if you use [Homebrew](https://brew.sh/) already you can install Ruby with it:
|
|
@@ -133,6 +129,8 @@ Alternatively, if you use [Homebrew](https://brew.sh/) already you can install R
|
|
|
133
129
|
$ brew install ruby
|
|
134
130
|
```
|
|
135
131
|
|
|
132
|
+
It is also possib le to use `rvm`
|
|
133
|
+
|
|
136
134
|
### Windows
|
|
137
135
|
|
|
138
136
|
Install Latest stable Ruby using [https://rubyinstaller.org/](https://rubyinstaller.org/).
|
|
@@ -167,13 +165,7 @@ Alternatively, only if you know what you do, on RPM based systems (CentOs, Redha
|
|
|
167
165
|
# yum install -y ruby rubygems ruby-json
|
|
168
166
|
```
|
|
169
167
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
```
|
|
173
|
-
# gem install jwt -v 1.5.6
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
You can cleanup your whole yum-installed ruby environment like this to uninstall:
|
|
168
|
+
One can cleanup your whole yum-installed ruby environment like this to uninstall:
|
|
177
169
|
|
|
178
170
|
```
|
|
179
171
|
gem uninstall $(ls $(gem env gemdir)/gems/|sed -e 's/-[^-]*$//'|sort -u)
|
|
@@ -182,7 +174,7 @@ yum remove -y ruby ruby-libs
|
|
|
182
174
|
|
|
183
175
|
### Other Unixes: Aix, etc...
|
|
184
176
|
|
|
185
|
-
If your unix do not provide a pre-built ruby, you can get using one of those
|
|
177
|
+
If your unix do not provide a pre-built ruby, you can get it using one of those
|
|
186
178
|
[methods](https://www.ruby-lang.org/en/documentation/installation/)
|
|
187
179
|
|
|
188
180
|
For instance to build from source, and install in `/opt/ruby` :
|
|
@@ -203,7 +195,7 @@ For instance to build from source, and install in `/opt/ruby` :
|
|
|
203
195
|
Once you have Ruby and rights to install gems: Install the gem and its dependencies:
|
|
204
196
|
|
|
205
197
|
```
|
|
206
|
-
# gem install aspera-cli
|
|
198
|
+
# gem install aspera-cli
|
|
207
199
|
```
|
|
208
200
|
|
|
209
201
|
To upgrade to the latest version:
|
|
@@ -1252,6 +1244,24 @@ ascli aoc admin ats cluster clouds
|
|
|
1252
1244
|
ascli aoc admin ats cluster list
|
|
1253
1245
|
ascli aoc admin ats cluster show --cloud=aws --region=eu-west-1
|
|
1254
1246
|
ascli aoc admin ats cluster show --id=1f412ae7-869a-445c-9c05-02ad16813be2
|
|
1247
|
+
ascli aoc admin res apps_new list
|
|
1248
|
+
ascli aoc admin res client list
|
|
1249
|
+
ascli aoc admin res client_access_key list
|
|
1250
|
+
ascli aoc admin res client_registration_token list
|
|
1251
|
+
ascli aoc admin res contact list
|
|
1252
|
+
ascli aoc admin res dropbox list
|
|
1253
|
+
ascli aoc admin res dropbox_membership list
|
|
1254
|
+
ascli aoc admin res group list
|
|
1255
|
+
ascli aoc admin res kms_profile list
|
|
1256
|
+
ascli aoc admin res node list
|
|
1257
|
+
ascli aoc admin res operation list
|
|
1258
|
+
ascli aoc admin res organization show
|
|
1259
|
+
ascli aoc admin res package list
|
|
1260
|
+
ascli aoc admin res saml_configuration list
|
|
1261
|
+
ascli aoc admin res self show
|
|
1262
|
+
ascli aoc admin res short_link list
|
|
1263
|
+
ascli aoc admin res user list
|
|
1264
|
+
ascli aoc admin res workspace_membership list
|
|
1255
1265
|
ascli aoc admin resource node --name=AOC_NODE1_NAME --secret=AOC_NODE1_SECRET v3 access_key create --value=@json:'{"id":"testsub1","storage":{"path":"/folder1"}}'
|
|
1256
1266
|
ascli aoc admin resource node --name=AOC_NODE1_NAME --secret=AOC_NODE1_SECRET v3 access_key delete --id=testsub1
|
|
1257
1267
|
ascli aoc admin resource node --name=AOC_NODE1_NAME --secret=AOC_NODE1_SECRET v3 events
|
|
@@ -1441,7 +1451,7 @@ ascli sync start --parameters=@json:'{"sessions":[{"name":"test","reset":true,"r
|
|
|
1441
1451
|
```
|
|
1442
1452
|
$ ascli -h
|
|
1443
1453
|
NAME
|
|
1444
|
-
ascli -- a command line tool for Aspera Applications (v4.0.0
|
|
1454
|
+
ascli -- a command line tool for Aspera Applications (v4.0.0)
|
|
1445
1455
|
|
|
1446
1456
|
SYNOPSIS
|
|
1447
1457
|
ascli COMMANDS [OPTIONS] [ARGS]
|
|
@@ -2272,8 +2282,9 @@ Notes:
|
|
|
2272
2282
|
Examples:
|
|
2273
2283
|
|
|
2274
2284
|
```
|
|
2275
|
-
$ ascli aoc
|
|
2276
|
-
$ ascli aoc
|
|
2285
|
+
$ ascli aoc package send --value=@json:'{"name":"my title","note":"my note","recipients":["laurent.martin.aspera@fr.ibm.com","other@example.com"]}' --sources=@args my_file.dat
|
|
2286
|
+
$ ascli aoc package send --value=@json:'{"name":"my file in shared inbox","recipients":["The Shared Inbox"]}' my_file.dat --ts=@json:'{"target_rate_kbps":100000}'
|
|
2287
|
+
$ ascli aoc package send --workspace=eudemo --value=@json:'{"name":"my pack title","recipients":["Shared Inbox Name"],"metadata":[{"input_type":"single-text","name":"Project Id","values":["123"]},{"input_type":"single-dropdown","name":"Type","values":["Opt2"]},{"input_type":"multiple-checkbox","name":"CheckThose","values":["Check1","Check2"]},{"input_type":"date","name":"Optional Date","values":["2021-01-13T15:02:00.000Z"]}]}' ~/Documents/Samples/200KB.1
|
|
2277
2288
|
```
|
|
2278
2289
|
|
|
2279
2290
|
## <a name="aoccargo"></a>Receive new packages only
|
data/docs/README.erb.md
CHANGED
|
@@ -30,17 +30,11 @@ Disclaimers:
|
|
|
30
30
|
|
|
31
31
|
* This has not yet been officially released so things may change
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
This manual addresses three parts:
|
|
36
|
-
|
|
37
|
-
* <%=tool%> : The command line tool
|
|
38
|
-
* `asession` : starting a FASP Session with JSON parameters
|
|
39
|
-
* `Aspera` : includes a Ruby "FASPManager"
|
|
33
|
+
<%=tool%> is also a great tool to learn Aspera APIs.
|
|
40
34
|
|
|
41
35
|
In examples, command line operations (starting with `$`) are shown using a standard shell: `bash` or `zsh`.
|
|
42
36
|
|
|
43
|
-
Command line parameters in
|
|
37
|
+
Command line parameters in examples beginning with `my_`, like `my_param_value` are user-provided value and not fixed value commands.
|
|
44
38
|
|
|
45
39
|
# Quick Start
|
|
46
40
|
|
|
@@ -128,15 +122,17 @@ The following sections provide information on the installation.
|
|
|
128
122
|
## <a name="ruby"></a>Ruby
|
|
129
123
|
|
|
130
124
|
A ruby interpreter is required to run the tool or to use the gem and tool.
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
125
|
+
|
|
126
|
+
Ruby minimum version: <%= gemspec.required_ruby_version %>
|
|
127
|
+
|
|
128
|
+
Ruby 3 is also supported.
|
|
129
|
+
|
|
130
|
+
Any type of Ruby installation can be used (installer, rpm, rvm, ...).
|
|
134
131
|
|
|
135
132
|
Refer to the following sections for a proposed method for specific operating systems.
|
|
136
133
|
|
|
137
134
|
### macOS
|
|
138
135
|
|
|
139
|
-
|
|
140
136
|
MacOS 10.13+ (High Sierra) comes with a recent Ruby, so you can use it directly, you will need to install <%= gemspec.name %> using `sudo` :
|
|
141
137
|
|
|
142
138
|
```
|
|
@@ -149,6 +145,8 @@ Alternatively, if you use [Homebrew](https://brew.sh/) already you can install R
|
|
|
149
145
|
$ brew install ruby
|
|
150
146
|
```
|
|
151
147
|
|
|
148
|
+
It is also possib le to use `rvm`
|
|
149
|
+
|
|
152
150
|
### Windows
|
|
153
151
|
|
|
154
152
|
Install Latest stable Ruby using [https://rubyinstaller.org/](https://rubyinstaller.org/).
|
|
@@ -183,13 +181,7 @@ Alternatively, only if you know what you do, on RPM based systems (CentOs, Redha
|
|
|
183
181
|
# yum install -y ruby rubygems ruby-json
|
|
184
182
|
```
|
|
185
183
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
```
|
|
189
|
-
# gem install jwt -v 1.5.6
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
You can cleanup your whole yum-installed ruby environment like this to uninstall:
|
|
184
|
+
One can cleanup your whole yum-installed ruby environment like this to uninstall:
|
|
193
185
|
|
|
194
186
|
```
|
|
195
187
|
gem uninstall $(ls $(gem env gemdir)/gems/|sed -e 's/-[^-]*$//'|sort -u)
|
|
@@ -198,7 +190,7 @@ yum remove -y ruby ruby-libs
|
|
|
198
190
|
|
|
199
191
|
### Other Unixes: Aix, etc...
|
|
200
192
|
|
|
201
|
-
If your unix do not provide a pre-built ruby, you can get using one of those
|
|
193
|
+
If your unix do not provide a pre-built ruby, you can get it using one of those
|
|
202
194
|
[methods](https://www.ruby-lang.org/en/documentation/installation/)
|
|
203
195
|
|
|
204
196
|
For instance to build from source, and install in `/opt/ruby` :
|
|
@@ -1735,8 +1727,9 @@ Notes:
|
|
|
1735
1727
|
Examples:
|
|
1736
1728
|
|
|
1737
1729
|
```
|
|
1738
|
-
$ <%=cmd%> aoc
|
|
1739
|
-
$ <%=cmd%> aoc
|
|
1730
|
+
$ <%=cmd%> aoc package send --value=@json:'{"name":"my title","note":"my note","recipients":["laurent.martin.aspera@fr.ibm.com","other@example.com"]}' --sources=@args my_file.dat
|
|
1731
|
+
$ <%=cmd%> aoc package send --value=@json:'{"name":"my file in shared inbox","recipients":["The Shared Inbox"]}' my_file.dat --ts=@json:'{"target_rate_kbps":100000}'
|
|
1732
|
+
$ <%=cmd%> aoc package send --workspace=eudemo --value=@json:'{"name":"my pack title","recipients":["Shared Inbox Name"],"metadata":[{"input_type":"single-text","name":"Project Id","values":["123"]},{"input_type":"single-dropdown","name":"Type","values":["Opt2"]},{"input_type":"multiple-checkbox","name":"CheckThose","values":["Check1","Check2"]},{"input_type":"date","name":"Optional Date","values":["2021-01-13T15:02:00.000Z"]}]}' ~/Documents/Samples/200KB.1
|
|
1740
1733
|
```
|
|
1741
1734
|
|
|
1742
1735
|
## <a name="aoccargo"></a>Receive new packages only
|
|
@@ -139,12 +139,12 @@ module Aspera
|
|
|
139
139
|
return Main.result_status("renamed #{thepath} to #{newname}")
|
|
140
140
|
when :delete
|
|
141
141
|
thepath=self.options.get_next_argument('path')
|
|
142
|
-
return do_bulk_operation(thepath,'deleted','path') do |
|
|
143
|
-
raise "expecting String (path), got #{
|
|
144
|
-
node_file = @api_aoc.resolve_node_file(top_node_file,
|
|
142
|
+
return do_bulk_operation(thepath,'deleted','path') do |l_path|
|
|
143
|
+
raise "expecting String (path), got #{l_path.class.name} (#{l_path})" unless l_path.is_a?(String)
|
|
144
|
+
node_file = @api_aoc.resolve_node_file(top_node_file,l_path)
|
|
145
145
|
node_api=@api_aoc.get_node_api(node_file[:node_info],AoC::SCOPE_NODE_USER)
|
|
146
146
|
result=node_api.delete("files/#{node_file[:file_id]}")[:data]
|
|
147
|
-
{'path'=>
|
|
147
|
+
{'path'=>l_path}
|
|
148
148
|
end
|
|
149
149
|
when :transfer
|
|
150
150
|
# client side is agent
|
|
@@ -558,8 +558,23 @@ module Aspera
|
|
|
558
558
|
return {:type=>:object_list,:data=>events}
|
|
559
559
|
end
|
|
560
560
|
when :resource
|
|
561
|
-
resource_type=self.options.get_next_argument('resource',[:self,:organization,:user,:group,:client,:contact,:dropbox,:node,:operation,:package,:saml_configuration, :workspace, :dropbox_membership,:short_link,:workspace_membership
|
|
562
|
-
|
|
561
|
+
resource_type=self.options.get_next_argument('resource',[:self,:organization,:user,:group,:client,:contact,:dropbox,:node,:operation,:package,:saml_configuration, :workspace, :dropbox_membership,:short_link,:workspace_membership,:apps_new,:client_registration_token,:client_access_key,:kms_profile])
|
|
562
|
+
# get path on API
|
|
563
|
+
resource_class_path=case resource_type
|
|
564
|
+
when :self,:organization
|
|
565
|
+
"#{resource_type}"
|
|
566
|
+
when :apps_new
|
|
567
|
+
"admin/#{resource_type}"
|
|
568
|
+
when :dropbox
|
|
569
|
+
resource_type.to_s+'es'
|
|
570
|
+
when :client_registration_token,:client_access_key
|
|
571
|
+
"admin/#{resource_type}s"
|
|
572
|
+
when :kms_profile
|
|
573
|
+
"integrations/#{resource_type}s"
|
|
574
|
+
else
|
|
575
|
+
resource_type.to_s+'s'
|
|
576
|
+
end
|
|
577
|
+
# build list of supported operations
|
|
563
578
|
singleton_object=[:self,:organization].include?(resource_type)
|
|
564
579
|
global_operations=[:create,:list]
|
|
565
580
|
supported_operations=[:show,:modify]
|
|
@@ -568,7 +583,6 @@ module Aspera
|
|
|
568
583
|
supported_operations.push(:set_pub_key) if resource_type.eql?(:client)
|
|
569
584
|
supported_operations.push(:shared_folders) if [:node,:workspace].include?(resource_type)
|
|
570
585
|
command=self.options.get_next_command(supported_operations)
|
|
571
|
-
|
|
572
586
|
# require identifier for non global commands
|
|
573
587
|
if !singleton_object and !global_operations.include?(command)
|
|
574
588
|
res_id=self.options.get_option(:id)
|
|
@@ -607,8 +621,8 @@ module Aspera
|
|
|
607
621
|
when :node; default_fields.push('host','access_key')
|
|
608
622
|
when :operation; default_fields=nil
|
|
609
623
|
when :contact; default_fields=["email","name","source_id","source_type"]
|
|
610
|
-
when
|
|
611
|
-
when
|
|
624
|
+
when :apps_new; list_query={:organization_apps=>true};default_fields=['app_type','available']
|
|
625
|
+
when :client_registration_token; default_fields=['id','value','data.client_subject_scopes','created_at']
|
|
612
626
|
end
|
|
613
627
|
result=@api_aoc.read(resource_class_path,url_query(list_query))
|
|
614
628
|
self.format.display_status("Items: #{result[:data].length}/#{result[:http]['X-Total-Count']}")
|
|
@@ -639,18 +653,6 @@ module Aspera
|
|
|
639
653
|
return Node.new(@agents.merge(skip_basic_auth_options: true, node_api: api_node)).execute_action if command.eql?(:v3)
|
|
640
654
|
ak_data=api_node.call({:operation=>'GET',:subpath=>"access_keys/#{res_data['access_key']}",:headers=>{'Accept'=>'application/json'}})[:data]
|
|
641
655
|
return node_gen4_execute_action({node_info: res_data, file_id: ak_data['root_file_id']})
|
|
642
|
-
# when :info
|
|
643
|
-
# object=@api_aoc.read(resource_instance_path)[:data]
|
|
644
|
-
# access_key=object['access_key']
|
|
645
|
-
# match_list=@api_aoc.read('admin/search_nodes',{:q=>"access_key:\"#{access_key}\""})[:data]
|
|
646
|
-
# result=match_list.select{|i|i["_source"]["access_key_recursive_counts"].first["access_key"].eql?(access_key)}
|
|
647
|
-
# return Main.result_status('Private node') if result.empty?
|
|
648
|
-
# raise CliError,"more than one match" unless result.length.eql?(1)
|
|
649
|
-
# result=result.first["_source"]
|
|
650
|
-
# result.merge!(result['access_key_recursive_counts'].first)
|
|
651
|
-
# result.delete('access_key_recursive_counts')
|
|
652
|
-
# result.delete('token')
|
|
653
|
-
# return { :type=>:single_object, :data =>result}
|
|
654
656
|
when :shared_folders
|
|
655
657
|
read_params = case resource_type
|
|
656
658
|
when :workspace;{'access_id'=>"ASPERA_ACCESS_KEY_ADMIN_WS_#{res_id}",'access_type'=>'user'}
|
|
@@ -44,7 +44,7 @@ module Aspera
|
|
|
44
44
|
result={
|
|
45
45
|
:base_url => "#{publink_uri.scheme}://#{publink_uri.host}#{port_add}#{base}",
|
|
46
46
|
:subpath => subpath,
|
|
47
|
-
:query => URI::decode_www_form(publink_uri.query).inject({}){|
|
|
47
|
+
:query => URI::decode_www_form(publink_uri.query).inject({}){|h,v|h[v.first]=v.last;h}
|
|
48
48
|
}
|
|
49
49
|
Log.dump('publink',result)
|
|
50
50
|
return result
|
data/lib/aspera/cli/version.rb
CHANGED
|
@@ -54,7 +54,7 @@ module Aspera
|
|
|
54
54
|
# add sdk as first search path
|
|
55
55
|
@found_products.unshift({# SDK
|
|
56
56
|
:expected =>'SDK',
|
|
57
|
-
:app_root =>
|
|
57
|
+
:app_root =>folder_path,
|
|
58
58
|
:sub_bin =>''
|
|
59
59
|
})
|
|
60
60
|
@found_products.select! do |pl|
|
|
@@ -89,19 +89,19 @@ module Aspera
|
|
|
89
89
|
# note that there might be a .exe at the end
|
|
90
90
|
file=file.gsub('ascp','ascp4') if k.eql?(:ascp4)
|
|
91
91
|
when :ssh_bypass_key_dsa
|
|
92
|
-
file=File.join(
|
|
92
|
+
file=File.join(folder_path,'aspera_bypass_dsa.pem')
|
|
93
93
|
File.write(file,get_key('dsa',1)) unless File.exist?(file)
|
|
94
94
|
File.chmod(0400,file)
|
|
95
95
|
when :ssh_bypass_key_rsa
|
|
96
|
-
file=File.join(
|
|
96
|
+
file=File.join(folder_path,'aspera_bypass_rsa.pem')
|
|
97
97
|
File.write(file,get_key('rsa',2)) unless File.exist?(file)
|
|
98
98
|
File.chmod(0400,file)
|
|
99
99
|
when :aspera_license
|
|
100
|
-
file=File.join(
|
|
100
|
+
file=File.join(folder_path,'aspera-license')
|
|
101
101
|
File.write(file,Base64.strict_encode64("#{Zlib::Inflate.inflate(DataRepository.instance.get_bin(6))}==SIGNATURE==\n#{Base64.strict_encode64(DataRepository.instance.get_bin(7))}")) unless File.exist?(file)
|
|
102
102
|
File.chmod(0400,file)
|
|
103
103
|
when :aspera_conf
|
|
104
|
-
file=File.join(
|
|
104
|
+
file=File.join(folder_path,'aspera.conf')
|
|
105
105
|
File.write(file,%Q{<?xml version='1.0' encoding='UTF-8'?>
|
|
106
106
|
<CONF version="2">
|
|
107
107
|
<default>
|
|
@@ -120,8 +120,8 @@ module Aspera
|
|
|
120
120
|
}) unless File.exist?(file)
|
|
121
121
|
File.chmod(0400,file)
|
|
122
122
|
when :fallback_cert,:fallback_key
|
|
123
|
-
file_key=File.join(
|
|
124
|
-
file_cert=File.join(
|
|
123
|
+
file_key=File.join(folder_path,'aspera_fallback_key.pem')
|
|
124
|
+
file_cert=File.join(folder_path,'aspera_fallback_cert.pem')
|
|
125
125
|
if !File.exist?(file_key) or !File.exist?(file_cert)
|
|
126
126
|
require 'openssl'
|
|
127
127
|
# create new self signed certificate for http fallback
|
|
@@ -188,7 +188,7 @@ module Aspera
|
|
|
188
188
|
Zip::File.open(sdk_zip_path) do |zip_file|
|
|
189
189
|
zip_file.each do |entry|
|
|
190
190
|
if entry.name.include?(filter) and !entry.name.end_with?('/')
|
|
191
|
-
archive_file=File.join(
|
|
191
|
+
archive_file=File.join(folder_path,File.basename(entry.name))
|
|
192
192
|
File.open(archive_file, 'wb') do |output_stream|
|
|
193
193
|
IO.copy_stream(entry.get_input_stream, output_stream)
|
|
194
194
|
end
|
|
@@ -201,12 +201,13 @@ module Aspera
|
|
|
201
201
|
end
|
|
202
202
|
File.unlink(sdk_zip_path) rescue nil # Windows may give error
|
|
203
203
|
ascp_version='n/a'
|
|
204
|
-
if
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
204
|
+
raise "error in sdk: no ascp included" if ascp_path.nil?
|
|
205
|
+
cmd_out=%x{#{ascp_path} -A}
|
|
206
|
+
raise "An error occured when testing ascp: #{cmd_out}" unless $? == 0
|
|
207
|
+
# get version from ascp, only after full extract, as windows requires DLLs (SSL/TLS/etc...)
|
|
208
|
+
m=cmd_out.match(/ascp version (.*)/)
|
|
209
|
+
ascp_version=m[1] unless m.nil?
|
|
210
|
+
File.write(File.join(folder_path,PRODUCT_INFO),"<product><name>IBM Aspera SDK</name><version>#{ascp_version}</version></product>")
|
|
210
211
|
return ascp_version
|
|
211
212
|
end
|
|
212
213
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: aspera-cli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.0.0
|
|
4
|
+
version: 4.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Laurent Martin
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-02-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: xml-simple
|
|
@@ -301,9 +301,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
301
301
|
version: '2.4'
|
|
302
302
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
303
303
|
requirements:
|
|
304
|
-
- - "
|
|
304
|
+
- - ">="
|
|
305
305
|
- !ruby/object:Gem::Version
|
|
306
|
-
version:
|
|
306
|
+
version: '0'
|
|
307
307
|
requirements:
|
|
308
308
|
- IBM Aspera ascp installed for the user
|
|
309
309
|
rubygems_version: 3.0.3
|