aspera-cli 4.4.0 → 4.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2095 -1503
- data/bin/ascli +2 -1
- data/bin/asession +4 -5
- data/docs/test_env.conf +3 -0
- data/examples/aoc.rb +4 -3
- data/examples/faspex4.rb +25 -25
- data/examples/proxy.pac +1 -1
- data/examples/transfer.rb +17 -17
- data/lib/aspera/aoc.rb +238 -185
- data/lib/aspera/ascmd.rb +93 -83
- data/lib/aspera/ats_api.rb +11 -10
- data/lib/aspera/cli/basic_auth_plugin.rb +13 -14
- data/lib/aspera/cli/extended_value.rb +42 -33
- data/lib/aspera/cli/formater.rb +142 -108
- data/lib/aspera/cli/info.rb +17 -0
- data/lib/aspera/cli/listener/line_dump.rb +3 -2
- data/lib/aspera/cli/listener/logger.rb +2 -1
- data/lib/aspera/cli/listener/progress.rb +16 -18
- data/lib/aspera/cli/listener/progress_multi.rb +18 -21
- data/lib/aspera/cli/main.rb +173 -149
- data/lib/aspera/cli/manager.rb +163 -168
- data/lib/aspera/cli/plugin.rb +43 -31
- data/lib/aspera/cli/plugins/alee.rb +6 -6
- data/lib/aspera/cli/plugins/aoc.rb +405 -370
- data/lib/aspera/cli/plugins/ats.rb +86 -79
- data/lib/aspera/cli/plugins/bss.rb +14 -16
- data/lib/aspera/cli/plugins/config.rb +580 -362
- data/lib/aspera/cli/plugins/console.rb +23 -19
- data/lib/aspera/cli/plugins/cos.rb +18 -18
- data/lib/aspera/cli/plugins/faspex.rb +201 -158
- data/lib/aspera/cli/plugins/faspex5.rb +80 -57
- data/lib/aspera/cli/plugins/node.rb +183 -166
- data/lib/aspera/cli/plugins/orchestrator.rb +71 -67
- data/lib/aspera/cli/plugins/preview.rb +92 -96
- data/lib/aspera/cli/plugins/server.rb +79 -75
- data/lib/aspera/cli/plugins/shares.rb +35 -19
- data/lib/aspera/cli/plugins/sync.rb +20 -22
- data/lib/aspera/cli/transfer_agent.rb +76 -113
- data/lib/aspera/cli/version.rb +2 -1
- data/lib/aspera/colors.rb +35 -27
- data/lib/aspera/command_line_builder.rb +48 -34
- data/lib/aspera/cos_node.rb +29 -21
- data/lib/aspera/data_repository.rb +3 -2
- data/lib/aspera/environment.rb +50 -45
- data/lib/aspera/fasp/{manager.rb → agent_base.rb} +28 -25
- data/lib/aspera/fasp/{connect.rb → agent_connect.rb} +52 -43
- data/lib/aspera/fasp/{local.rb → agent_direct.rb} +58 -72
- data/lib/aspera/fasp/{http_gw.rb → agent_httpgw.rb} +37 -43
- data/lib/aspera/fasp/{node.rb → agent_node.rb} +35 -16
- data/lib/aspera/fasp/agent_trsdk.rb +104 -0
- data/lib/aspera/fasp/error.rb +2 -1
- data/lib/aspera/fasp/error_info.rb +68 -52
- data/lib/aspera/fasp/installation.rb +152 -124
- data/lib/aspera/fasp/listener.rb +1 -0
- data/lib/aspera/fasp/parameters.rb +87 -92
- data/lib/aspera/fasp/parameters.yaml +305 -249
- data/lib/aspera/fasp/resume_policy.rb +11 -14
- data/lib/aspera/fasp/transfer_spec.rb +26 -0
- data/lib/aspera/fasp/uri.rb +22 -21
- data/lib/aspera/faspex_gw.rb +55 -89
- data/lib/aspera/hash_ext.rb +4 -3
- data/lib/aspera/id_generator.rb +8 -7
- data/lib/aspera/keychain/encrypted_hash.rb +121 -0
- data/lib/aspera/keychain/macos_security.rb +90 -0
- data/lib/aspera/log.rb +55 -37
- data/lib/aspera/nagios.rb +13 -12
- data/lib/aspera/node.rb +30 -25
- data/lib/aspera/oauth.rb +175 -226
- data/lib/aspera/open_application.rb +4 -3
- data/lib/aspera/persistency_action_once.rb +6 -6
- data/lib/aspera/persistency_folder.rb +5 -9
- data/lib/aspera/preview/file_types.rb +6 -5
- data/lib/aspera/preview/generator.rb +25 -24
- data/lib/aspera/preview/options.rb +16 -14
- data/lib/aspera/preview/utils.rb +98 -98
- data/lib/aspera/{proxy_auto_config.erb.js → proxy_auto_config.js} +23 -31
- data/lib/aspera/proxy_auto_config.rb +111 -20
- data/lib/aspera/rest.rb +154 -135
- data/lib/aspera/rest_call_error.rb +2 -2
- data/lib/aspera/rest_error_analyzer.rb +23 -25
- data/lib/aspera/rest_errors_aspera.rb +15 -14
- data/lib/aspera/ssh.rb +12 -10
- data/lib/aspera/sync.rb +42 -41
- data/lib/aspera/temp_file_manager.rb +18 -14
- data/lib/aspera/timer_limiter.rb +2 -1
- data/lib/aspera/uri_reader.rb +7 -5
- data/lib/aspera/web_auth.rb +79 -76
- metadata +116 -29
- data/docs/Makefile +0 -66
- data/docs/README.erb.md +0 -3973
- data/docs/README.md +0 -13
- data/docs/diagrams.txt +0 -49
- data/docs/doc_tools.rb +0 -58
- data/lib/aspera/api_detector.rb +0 -60
- data/lib/aspera/cli/plugins/shares2.rb +0 -114
- data/lib/aspera/secrets.rb +0 -20
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'English'
|
1
3
|
require 'singleton'
|
2
4
|
require 'aspera/log'
|
3
5
|
require 'aspera/environment'
|
@@ -6,11 +8,12 @@ require 'xmlsimple'
|
|
6
8
|
require 'zlib'
|
7
9
|
require 'base64'
|
8
10
|
require 'fileutils'
|
11
|
+
require 'openssl'
|
9
12
|
|
10
13
|
module Aspera
|
11
14
|
module Fasp
|
12
15
|
# Singleton that tells where to find ascp and other local resources (keys..) , using the "path(symb)" method.
|
13
|
-
# It is used by object :
|
16
|
+
# It is used by object : AgentDirect to find necessary resources
|
14
17
|
# By default it takes the first Aspera product found specified in product_locations
|
15
18
|
# but the user can specify ascp location by calling:
|
16
19
|
# Installation.instance.use_ascp_from_product(product_name)
|
@@ -18,26 +21,56 @@ module Aspera
|
|
18
21
|
# Installation.instance.ascp_path=""
|
19
22
|
class Installation
|
20
23
|
include Singleton
|
24
|
+
# known product names
|
21
25
|
PRODUCT_CONNECT='Aspera Connect'
|
22
26
|
PRODUCT_CLI_V1='Aspera CLI'
|
23
27
|
PRODUCT_DRIVE='Aspera Drive'
|
24
28
|
PRODUCT_ENTSRV='Enterprise Server'
|
25
|
-
|
26
|
-
|
29
|
+
# protobuf generated files from sdk
|
30
|
+
EXT_RUBY_PROTOBUF='_pb.rb'
|
31
|
+
RB_SDK_FOLDER='lib'
|
32
|
+
ONE_YEAR_SECONDS=365 * 24 * 60 * 60
|
33
|
+
DEFAULT_ASPERA_CONF=<<~END_OF_CONFIG_FILE
|
34
|
+
<?xml version='1.0' encoding='UTF-8'?>
|
35
|
+
<CONF version="2">
|
36
|
+
<default>
|
37
|
+
<file_system>
|
38
|
+
<resume_suffix>.aspera-ckpt</resume_suffix>
|
39
|
+
<partial_file_suffix>.partial</partial_file_suffix>
|
40
|
+
</file_system>
|
41
|
+
</default>
|
42
|
+
</CONF>
|
43
|
+
END_OF_CONFIG_FILE
|
44
|
+
private_constant :PRODUCT_CONNECT,:PRODUCT_CLI_V1,:PRODUCT_DRIVE,:PRODUCT_ENTSRV,:EXT_RUBY_PROTOBUF,:RB_SDK_FOLDER,:ONE_YEAR_SECONDS,:DEFAULT_ASPERA_CONF
|
27
45
|
# set ascp executable path
|
28
46
|
def ascp_path=(v)
|
29
47
|
@path_to_ascp=v
|
30
48
|
end
|
31
49
|
|
32
|
-
|
33
|
-
|
34
|
-
|
50
|
+
def ascp_path
|
51
|
+
path(:ascp)
|
52
|
+
end
|
53
|
+
|
54
|
+
def sdk_ruby_folder
|
55
|
+
ruby_pb_folder=File.join(sdk_folder,RB_SDK_FOLDER)
|
56
|
+
FileUtils.mkdir_p(ruby_pb_folder) unless Dir.exist?(ruby_pb_folder)
|
57
|
+
return ruby_pb_folder
|
35
58
|
end
|
36
59
|
|
37
60
|
# location of SDK files
|
38
|
-
def
|
39
|
-
@
|
40
|
-
|
61
|
+
def sdk_folder=(v)
|
62
|
+
@sdk_dir=v
|
63
|
+
sdk_folder
|
64
|
+
end
|
65
|
+
|
66
|
+
# backward compatibility in sample program
|
67
|
+
alias folder= sdk_folder=
|
68
|
+
|
69
|
+
# @return the path to folder where SDK is installed
|
70
|
+
def sdk_folder
|
71
|
+
raise 'SDK path was ot initialized' if @sdk_dir.nil?
|
72
|
+
FileUtils.mkdir_p(@sdk_dir) unless Dir.exist?(@sdk_dir)
|
73
|
+
@sdk_dir
|
41
74
|
end
|
42
75
|
|
43
76
|
# find ascp in named product (use value : FIRST_FOUND='FIRST' to just use first one)
|
@@ -60,9 +93,9 @@ module Aspera
|
|
60
93
|
scan_locations=product_locations.clone
|
61
94
|
# add SDK as first search path
|
62
95
|
scan_locations.unshift({
|
63
|
-
:
|
64
|
-
:
|
65
|
-
:
|
96
|
+
expected: 'SDK',
|
97
|
+
app_root: sdk_folder,
|
98
|
+
sub_bin: ''
|
66
99
|
})
|
67
100
|
# search installed products: with ascp
|
68
101
|
@found_products=scan_locations.select! do |item|
|
@@ -100,46 +133,39 @@ module Aspera
|
|
100
133
|
file=@path_to_ascp
|
101
134
|
# note that there might be a .exe at the end
|
102
135
|
file=file.gsub('ascp','ascp4') if k.eql?(:ascp4)
|
136
|
+
when :transferd
|
137
|
+
file=transferd_filepath
|
103
138
|
when :ssh_bypass_key_dsa
|
104
|
-
file=File.join(
|
139
|
+
file=File.join(sdk_folder,'aspera_bypass_dsa.pem')
|
105
140
|
File.write(file,get_key('dsa',1)) unless File.exist?(file)
|
106
141
|
File.chmod(0400,file)
|
107
142
|
when :ssh_bypass_key_rsa
|
108
|
-
file=File.join(
|
143
|
+
file=File.join(sdk_folder,'aspera_bypass_rsa.pem')
|
109
144
|
File.write(file,get_key('rsa',2)) unless File.exist?(file)
|
110
145
|
File.chmod(0400,file)
|
111
146
|
when :aspera_license
|
112
|
-
file=File.join(
|
113
|
-
File.write(file,Base64.strict_encode64("#{Zlib::Inflate.inflate(DataRepository.instance.
|
147
|
+
file=File.join(sdk_folder,'aspera-license')
|
148
|
+
File.write(file,Base64.strict_encode64("#{Zlib::Inflate.inflate(DataRepository.instance.data(6))}==SIGNATURE==\n#{Base64.strict_encode64(DataRepository.instance.data(7))}")) unless File.exist?(file)
|
114
149
|
File.chmod(0400,file)
|
115
150
|
when :aspera_conf
|
116
|
-
file=File.join(
|
117
|
-
File.write(file
|
118
|
-
<CONF version="2">
|
119
|
-
<default>
|
120
|
-
<file_system>
|
121
|
-
<resume_suffix>.aspera-ckpt</resume_suffix>
|
122
|
-
<partial_file_suffix>.partial</partial_file_suffix>
|
123
|
-
</file_system>
|
124
|
-
</default>
|
125
|
-
</CONF>
|
126
|
-
}) unless File.exist?(file)
|
151
|
+
file=File.join(sdk_folder,'aspera.conf')
|
152
|
+
File.write(file,DEFAULT_ASPERA_CONF) unless File.exist?(file)
|
127
153
|
File.chmod(0400,file)
|
128
154
|
when :fallback_cert,:fallback_key
|
129
|
-
file_key=File.join(
|
130
|
-
file_cert=File.join(
|
131
|
-
if !File.exist?(file_key)
|
155
|
+
file_key=File.join(sdk_folder,'aspera_fallback_key.pem')
|
156
|
+
file_cert=File.join(sdk_folder,'aspera_fallback_cert.pem')
|
157
|
+
if !File.exist?(file_key) || !File.exist?(file_cert)
|
132
158
|
require 'openssl'
|
133
159
|
# create new self signed certificate for http fallback
|
134
160
|
private_key = OpenSSL::PKey::RSA.new(1024)
|
135
161
|
cert = OpenSSL::X509::Certificate.new
|
136
|
-
cert.subject = cert.issuer = OpenSSL::X509::Name.parse(
|
162
|
+
cert.subject = cert.issuer = OpenSSL::X509::Name.parse('/C=US/ST=California/L=Emeryville/O=Aspera Inc./OU=Corporate/CN=Aspera Inc./emailAddress=info@asperasoft.com')
|
137
163
|
cert.not_before = Time.now
|
138
|
-
cert.not_after = Time.now +
|
164
|
+
cert.not_after = Time.now + ONE_YEAR_SECONDS
|
139
165
|
cert.public_key = private_key.public_key
|
140
166
|
cert.serial = 0x0
|
141
167
|
cert.version = 2
|
142
|
-
cert.sign(private_key, OpenSSL::Digest
|
168
|
+
cert.sign(private_key, OpenSSL::Digest.new('SHA1'))
|
143
169
|
File.write(file_key,private_key.to_pem)
|
144
170
|
File.write(file_cert,cert.to_pem)
|
145
171
|
File.chmod(0400,file_key)
|
@@ -161,7 +187,7 @@ module Aspera
|
|
161
187
|
uri_file=File.join(folder,"http#{ext}.uri")
|
162
188
|
Log.log.debug("checking connect port file: #{uri_file}")
|
163
189
|
if File.exist?(uri_file)
|
164
|
-
return File.open(uri_file)
|
190
|
+
return File.open(uri_file, &:gets).strip
|
165
191
|
end
|
166
192
|
end
|
167
193
|
raise "no connect uri file found in #{folder}"
|
@@ -175,23 +201,29 @@ module Aspera
|
|
175
201
|
|
176
202
|
# default bypass key phrase
|
177
203
|
def bypass_pass
|
178
|
-
return
|
204
|
+
return format('%08x-%04x-%04x-%04x-%04x%08x',*DataRepository.instance.data(3).unpack('NnnnnN'))
|
179
205
|
end
|
180
206
|
|
181
207
|
def bypass_keys
|
182
208
|
return [:ssh_bypass_key_dsa,:ssh_bypass_key_rsa].map{|i|Installation.instance.path(i)}
|
183
209
|
end
|
184
210
|
|
211
|
+
# use in plugin `config`
|
212
|
+
def get_ascp_version(exe_path)
|
213
|
+
return get_exe_version(exe_path,'-A')
|
214
|
+
end
|
215
|
+
|
185
216
|
# Check that specified path is ascp and get version
|
186
|
-
def
|
187
|
-
raise
|
188
|
-
|
189
|
-
|
190
|
-
cmd_out=%x
|
191
|
-
raise "An error occured when testing #{ascp_filename}: #{cmd_out}" unless
|
217
|
+
def get_exe_version(exe_path,vers_arg)
|
218
|
+
raise 'ERROR: nil arg' if exe_path.nil?
|
219
|
+
return nil unless File.exist?(exe_path)
|
220
|
+
exe_version=nil
|
221
|
+
cmd_out=%x("#{exe_path}" #{vers_arg})
|
222
|
+
raise "An error occured when testing #{ascp_filename}: #{cmd_out}" unless $CHILD_STATUS == 0
|
192
223
|
# get version from ascp, only after full extract, as windows requires DLLs (SSL/TLS/etc...)
|
193
|
-
m=cmd_out.match(/
|
194
|
-
|
224
|
+
m=cmd_out.match(/ version ([0-9.]+)/)
|
225
|
+
exe_version=m[1] unless m.nil?
|
226
|
+
return exe_version
|
195
227
|
end
|
196
228
|
|
197
229
|
# download aspera SDK or use local file
|
@@ -205,54 +237,48 @@ module Aspera
|
|
205
237
|
raise 'use format: file:///<path>' unless sdk_url.start_with?('file:///')
|
206
238
|
sdk_zip_path=sdk_url.gsub(%r{^file:///},'')
|
207
239
|
else
|
208
|
-
|
209
|
-
begin
|
210
|
-
Aspera::Rest.new(base_url: sdk_url).call(operation: 'GET',save_to_file: sdk_zip_path)
|
211
|
-
rescue Aspera::RestCallError => e
|
212
|
-
if e.response.is_a?(Net::HTTPRedirection)
|
213
|
-
if redirect_remain > 0
|
214
|
-
redirect_remain-=1
|
215
|
-
sdk_url=e.response['location']
|
216
|
-
retry
|
217
|
-
else
|
218
|
-
raise "Too many redirect"
|
219
|
-
end
|
220
|
-
else
|
221
|
-
raise e
|
222
|
-
end
|
223
|
-
end
|
240
|
+
Aspera::Rest.new(base_url: sdk_url, redirect_max: 3).call(operation: 'GET',save_to_file: sdk_zip_path)
|
224
241
|
end
|
225
|
-
# SDK is organized by architecture
|
226
|
-
filter="/#{Environment.architecture}/"
|
227
|
-
ascp_path=nil
|
228
|
-
sdk_path=folder_path
|
229
242
|
# rename old install
|
230
|
-
if
|
231
|
-
Log.log.warn(
|
232
|
-
File.rename(
|
243
|
+
if !Dir.empty?(sdk_folder)
|
244
|
+
Log.log.warn('Previous install exists, renaming folder.')
|
245
|
+
File.rename(sdk_folder,"#{sdk_folder}.#{Time.now.strftime('%Y%m%d%H%M%S')}")
|
246
|
+
# TODO: delete old archives ?
|
233
247
|
end
|
234
|
-
#
|
235
|
-
|
236
|
-
|
248
|
+
# SDK is organized by architecture
|
249
|
+
arch_filter="#{Environment.architecture}/"
|
250
|
+
# extract files from archive
|
237
251
|
Zip::File.open(sdk_zip_path) do |zip_file|
|
238
252
|
zip_file.each do |entry|
|
239
|
-
#
|
240
|
-
if entry.name.
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
253
|
+
# skip folder entries
|
254
|
+
next if entry.name.end_with?('/')
|
255
|
+
dest_folder=nil
|
256
|
+
# binaries
|
257
|
+
dest_folder=sdk_folder if entry.name.include?(arch_filter)
|
258
|
+
# ruby adapters
|
259
|
+
dest_folder=sdk_ruby_folder if entry.name.end_with?(EXT_RUBY_PROTOBUF)
|
260
|
+
next if dest_folder.nil?
|
261
|
+
File.open(File.join(dest_folder,File.basename(entry.name)), 'wb') do |output_stream|
|
262
|
+
IO.copy_stream(entry.get_input_stream, output_stream)
|
249
263
|
end
|
250
264
|
end
|
251
265
|
end
|
252
266
|
File.unlink(sdk_zip_path) rescue nil # Windows may give error
|
253
|
-
|
254
|
-
|
255
|
-
|
267
|
+
# ensure license file are generated so that ascp invokation for version works
|
268
|
+
path(:aspera_license)
|
269
|
+
path(:aspera_conf)
|
270
|
+
ascp_path=File.join(sdk_folder,ascp_filename)
|
271
|
+
raise "No #{ascp_filename} found in SDK archive" unless File.exist?(ascp_path)
|
272
|
+
FileUtils.chmod(0755,ascp_path)
|
273
|
+
FileUtils.chmod(0755,ascp_path.gsub('ascp','ascp4'))
|
274
|
+
ascp_version=get_ascp_version(File.join(sdk_folder,ascp_filename))
|
275
|
+
trd_path=transferd_filepath
|
276
|
+
Log.log.warn("No #{trd_path} in SDK archive") unless File.exist?(trd_path)
|
277
|
+
FileUtils.chmod(0755,trd_path) if File.exist?(trd_path)
|
278
|
+
transferd_version=get_exe_version(trd_path,'version')
|
279
|
+
sdk_version = transferd_version||ascp_version
|
280
|
+
File.write(File.join(sdk_folder,PRODUCT_INFO),"<product><name>IBM Aspera SDK</name><version>#{sdk_version}</version></product>")
|
281
|
+
return sdk_version
|
256
282
|
end
|
257
283
|
|
258
284
|
private
|
@@ -269,7 +295,7 @@ module Aspera
|
|
269
295
|
|
270
296
|
def initialize
|
271
297
|
@path_to_ascp=nil
|
272
|
-
@
|
298
|
+
@sdk_dir=nil
|
273
299
|
@found_products=nil
|
274
300
|
end
|
275
301
|
|
@@ -281,11 +307,13 @@ module Aspera
|
|
281
307
|
return found.first
|
282
308
|
end
|
283
309
|
|
284
|
-
#
|
285
|
-
def
|
286
|
-
|
287
|
-
|
288
|
-
|
310
|
+
# filename for ascp with optional extension (Windows)
|
311
|
+
def ascp_filename
|
312
|
+
return 'ascp'+Environment.exe_extension
|
313
|
+
end
|
314
|
+
|
315
|
+
def transferd_filepath
|
316
|
+
return File.join(sdk_folder,'asperatransferd'+Environment.exe_extension)
|
289
317
|
end
|
290
318
|
|
291
319
|
# @return product folders depending on OS fields
|
@@ -297,49 +325,49 @@ module Aspera
|
|
297
325
|
def product_locations
|
298
326
|
case Aspera::Environment.os
|
299
327
|
when Aspera::Environment::OS_WINDOWS; return [{
|
300
|
-
:
|
301
|
-
:
|
302
|
-
:
|
303
|
-
:
|
328
|
+
expected: PRODUCT_CONNECT,
|
329
|
+
app_root: File.join(ENV['LOCALAPPDATA'],'Programs','Aspera','Aspera Connect'),
|
330
|
+
log_root: File.join(ENV['LOCALAPPDATA'],'Aspera','Aspera Connect','var','log'),
|
331
|
+
run_root: File.join(ENV['LOCALAPPDATA'],'Aspera','Aspera Connect')
|
304
332
|
},{
|
305
|
-
:
|
306
|
-
:
|
307
|
-
:
|
333
|
+
expected: PRODUCT_CLI_V1,
|
334
|
+
app_root: File.join('C:','Program Files','Aspera','cli'),
|
335
|
+
log_root: File.join('C:','Program Files','Aspera','cli','var','log')
|
308
336
|
},{
|
309
|
-
:
|
310
|
-
:
|
311
|
-
:
|
337
|
+
expected: PRODUCT_ENTSRV,
|
338
|
+
app_root: File.join('C:','Program Files','Aspera','Enterprise Server'),
|
339
|
+
log_root: File.join('C:','Program Files','Aspera','Enterprise Server','var','log')
|
312
340
|
}]
|
313
341
|
when Aspera::Environment::OS_X; return [{
|
314
|
-
:
|
315
|
-
:
|
316
|
-
:
|
317
|
-
:
|
318
|
-
:
|
342
|
+
expected: PRODUCT_CONNECT,
|
343
|
+
app_root: File.join(Dir.home,'Applications','Aspera Connect.app'),
|
344
|
+
log_root: File.join(Dir.home,'Library','Logs','Aspera_Connect'),
|
345
|
+
run_root: File.join(Dir.home,'Library','Application Support','Aspera','Aspera Connect'),
|
346
|
+
sub_bin: File.join('Contents','Resources')
|
319
347
|
},{
|
320
|
-
:
|
321
|
-
:
|
322
|
-
:
|
348
|
+
expected: PRODUCT_CLI_V1,
|
349
|
+
app_root: File.join(Dir.home,'Applications','Aspera CLI'),
|
350
|
+
log_root: File.join(Dir.home,'Library','Logs','Aspera')
|
323
351
|
},{
|
324
|
-
:
|
325
|
-
:
|
326
|
-
:
|
352
|
+
expected: PRODUCT_ENTSRV,
|
353
|
+
app_root: File.join('','Library','Aspera'),
|
354
|
+
log_root: File.join(Dir.home,'Library','Logs','Aspera')
|
327
355
|
},{
|
328
|
-
:
|
329
|
-
:
|
330
|
-
:
|
331
|
-
:
|
356
|
+
expected: PRODUCT_DRIVE,
|
357
|
+
app_root: File.join('','Applications','Aspera Drive.app'),
|
358
|
+
log_root: File.join(Dir.home,'Library','Logs','Aspera_Drive'),
|
359
|
+
sub_bin: File.join('Contents','Resources')
|
332
360
|
}]
|
333
|
-
else; return [{
|
334
|
-
:
|
335
|
-
:
|
336
|
-
:
|
361
|
+
else; return [{ # other: Linux and Unix family
|
362
|
+
expected: PRODUCT_CONNECT,
|
363
|
+
app_root: File.join(Dir.home,'.aspera','connect'),
|
364
|
+
run_root: File.join(Dir.home,'.aspera','connect')
|
337
365
|
},{
|
338
|
-
:
|
339
|
-
:
|
366
|
+
expected: PRODUCT_CLI_V1,
|
367
|
+
app_root: File.join(Dir.home,'.aspera','cli')
|
340
368
|
},{
|
341
|
-
:
|
342
|
-
:
|
369
|
+
expected: PRODUCT_ENTSRV,
|
370
|
+
app_root: File.join('','opt','aspera')
|
343
371
|
}]
|
344
372
|
end
|
345
373
|
end
|
@@ -349,10 +377,10 @@ module Aspera
|
|
349
377
|
# @param id in repository 1 for dsa, 2 for rsa
|
350
378
|
def get_key(type,id)
|
351
379
|
hf=['begin','end'].map{|t|"-----#{t} #{type} private key-----".upcase}
|
352
|
-
bin=Base64.strict_encode64(DataRepository.instance.
|
353
|
-
|
380
|
+
bin=Base64.strict_encode64(DataRepository.instance.data(id))
|
381
|
+
# validate valie and generate key in connonical format
|
382
|
+
OpenSSL::PKey.const_get(type.upcase).send(:new,hf.insert(1,bin).join("\n")).to_pem
|
354
383
|
end
|
355
|
-
|
356
384
|
end # Installation
|
357
385
|
end
|
358
386
|
end
|
data/lib/aspera/fasp/listener.rb
CHANGED