aspera-cli 4.14.0 → 4.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +54 -3
- data/CONTRIBUTING.md +7 -7
- data/README.md +1457 -880
- data/bin/ascli +18 -9
- data/bin/asession +12 -14
- data/examples/proxy.pac +1 -1
- data/lib/aspera/aoc.rb +198 -127
- data/lib/aspera/ascmd.rb +24 -14
- data/lib/aspera/cli/basic_auth_plugin.rb +9 -6
- data/lib/aspera/cli/error.rb +17 -0
- data/lib/aspera/cli/extended_value.rb +47 -12
- data/lib/aspera/cli/formatter.rb +260 -171
- data/lib/aspera/cli/hints.rb +80 -0
- data/lib/aspera/cli/main.rb +101 -147
- data/lib/aspera/cli/manager.rb +160 -124
- data/lib/aspera/cli/plugin.rb +70 -59
- data/lib/aspera/cli/plugins/alee.rb +0 -1
- data/lib/aspera/cli/plugins/aoc.rb +239 -273
- data/lib/aspera/cli/plugins/ats.rb +8 -5
- data/lib/aspera/cli/plugins/bss.rb +2 -2
- data/lib/aspera/cli/plugins/config.rb +516 -375
- data/lib/aspera/cli/plugins/console.rb +40 -0
- data/lib/aspera/cli/plugins/cos.rb +4 -5
- data/lib/aspera/cli/plugins/faspex.rb +99 -84
- data/lib/aspera/cli/plugins/faspex5.rb +179 -148
- data/lib/aspera/cli/plugins/node.rb +219 -153
- data/lib/aspera/cli/plugins/orchestrator.rb +52 -17
- data/lib/aspera/cli/plugins/preview.rb +46 -32
- data/lib/aspera/cli/plugins/server.rb +57 -17
- data/lib/aspera/cli/plugins/shares.rb +34 -12
- data/lib/aspera/cli/sync_actions.rb +68 -0
- data/lib/aspera/cli/transfer_agent.rb +45 -55
- data/lib/aspera/cli/transfer_progress.rb +74 -0
- data/lib/aspera/cli/version.rb +1 -1
- data/lib/aspera/colors.rb +3 -1
- data/lib/aspera/command_line_builder.rb +14 -11
- data/lib/aspera/cos_node.rb +3 -2
- data/lib/aspera/environment.rb +17 -6
- data/lib/aspera/fasp/agent_aspera.rb +126 -0
- data/lib/aspera/fasp/agent_base.rb +31 -77
- data/lib/aspera/fasp/agent_connect.rb +21 -22
- data/lib/aspera/fasp/agent_direct.rb +88 -102
- data/lib/aspera/fasp/agent_httpgw.rb +196 -192
- data/lib/aspera/fasp/agent_node.rb +41 -34
- data/lib/aspera/fasp/agent_trsdk.rb +75 -34
- data/lib/aspera/fasp/error_info.rb +2 -2
- data/lib/aspera/fasp/faux_file.rb +52 -0
- data/lib/aspera/fasp/installation.rb +43 -184
- data/lib/aspera/fasp/management.rb +244 -0
- data/lib/aspera/fasp/parameters.rb +59 -26
- data/lib/aspera/fasp/parameters.yaml +75 -8
- data/lib/aspera/fasp/products.rb +162 -0
- data/lib/aspera/fasp/transfer_spec.rb +1 -1
- data/lib/aspera/fasp/uri.rb +4 -4
- data/lib/aspera/faspex_gw.rb +2 -2
- data/lib/aspera/faspex_postproc.rb +2 -2
- data/lib/aspera/hash_ext.rb +2 -2
- data/lib/aspera/json_rpc.rb +49 -0
- data/lib/aspera/line_logger.rb +23 -0
- data/lib/aspera/log.rb +57 -16
- data/lib/aspera/node.rb +97 -14
- data/lib/aspera/oauth.rb +36 -18
- data/lib/aspera/open_application.rb +4 -4
- data/lib/aspera/persistency_folder.rb +2 -2
- data/lib/aspera/preview/file_types.rb +4 -2
- data/lib/aspera/preview/generator.rb +22 -35
- data/lib/aspera/preview/options.rb +2 -0
- data/lib/aspera/preview/terminal.rb +24 -13
- data/lib/aspera/preview/utils.rb +19 -26
- data/lib/aspera/rest.rb +103 -72
- data/lib/aspera/rest_call_error.rb +1 -1
- data/lib/aspera/rest_error_analyzer.rb +15 -14
- data/lib/aspera/rest_errors_aspera.rb +37 -34
- data/lib/aspera/secret_hider.rb +14 -16
- data/lib/aspera/ssh.rb +4 -1
- data/lib/aspera/sync.rb +128 -122
- data/lib/aspera/temp_file_manager.rb +10 -3
- data/lib/aspera/web_auth.rb +10 -7
- data/lib/aspera/web_server_simple.rb +9 -4
- data.tar.gz.sig +0 -0
- metadata +33 -15
- metadata.gz.sig +0 -0
- data/lib/aspera/cli/listener/line_dump.rb +0 -19
- data/lib/aspera/cli/listener/logger.rb +0 -22
- data/lib/aspera/cli/listener/progress.rb +0 -50
- data/lib/aspera/cli/listener/progress_multi.rb +0 -84
- data/lib/aspera/cli/plugins/sync.rb +0 -44
- data/lib/aspera/fasp/listener.rb +0 -13
@@ -0,0 +1,244 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Aspera
|
4
|
+
module Fasp
|
5
|
+
# executes a local "ascp", connects mgt port, equivalent of "Fasp Manager"
|
6
|
+
class Management
|
7
|
+
# cspell: disable
|
8
|
+
OPERATIONS = %w[
|
9
|
+
NOP
|
10
|
+
START
|
11
|
+
QUERY
|
12
|
+
QUERYRSP
|
13
|
+
STATS
|
14
|
+
STOP
|
15
|
+
ERROR
|
16
|
+
CANCEL
|
17
|
+
DONE
|
18
|
+
RATE
|
19
|
+
FILEERROR
|
20
|
+
SESSION
|
21
|
+
NOTIFICATION
|
22
|
+
INIT
|
23
|
+
VLINK
|
24
|
+
NOTIFICATION
|
25
|
+
PUT
|
26
|
+
WRITE
|
27
|
+
CLOSE
|
28
|
+
SKIP
|
29
|
+
ARGSTOP
|
30
|
+
]
|
31
|
+
|
32
|
+
PARAMETERS = %w[
|
33
|
+
Type
|
34
|
+
File
|
35
|
+
Size
|
36
|
+
Written
|
37
|
+
Bytescont
|
38
|
+
Rate
|
39
|
+
Loss
|
40
|
+
Query
|
41
|
+
Code
|
42
|
+
Password
|
43
|
+
Progress
|
44
|
+
Remaining
|
45
|
+
Elapsed
|
46
|
+
RexInfo
|
47
|
+
BlockInfo
|
48
|
+
DiskInfo
|
49
|
+
RateInfo
|
50
|
+
MinRate
|
51
|
+
Description
|
52
|
+
Elapsedusec
|
53
|
+
ServiceLevel
|
54
|
+
SessionId
|
55
|
+
User
|
56
|
+
Host
|
57
|
+
Encryption
|
58
|
+
Adaptive
|
59
|
+
Direction
|
60
|
+
Remote
|
61
|
+
Port
|
62
|
+
UserStr
|
63
|
+
CommandId
|
64
|
+
StartByte
|
65
|
+
EndByte
|
66
|
+
Token
|
67
|
+
Cookie
|
68
|
+
QueryResponse
|
69
|
+
Source
|
70
|
+
Destination
|
71
|
+
BWMeasurement
|
72
|
+
BWInfo
|
73
|
+
PMTU
|
74
|
+
TransferBytes
|
75
|
+
FileBytes
|
76
|
+
Operation
|
77
|
+
Delay
|
78
|
+
PreTransferFiles
|
79
|
+
PreTransferDirs
|
80
|
+
PreTransferSpecial
|
81
|
+
PreTransferFailed
|
82
|
+
PartialPreTransferBytes
|
83
|
+
PreTransferBytes
|
84
|
+
Priority
|
85
|
+
Transport
|
86
|
+
VlinkID
|
87
|
+
VlinkOn
|
88
|
+
VlinkCapIn
|
89
|
+
VlinkCapOut
|
90
|
+
ManifestFile
|
91
|
+
ArgScansAttempted
|
92
|
+
ArgScansCompleted
|
93
|
+
PathScansAttempted
|
94
|
+
PathScansFailed
|
95
|
+
PathScansIrregular
|
96
|
+
PathScansExcluded
|
97
|
+
DirScansCompleted
|
98
|
+
FileScansCompleted
|
99
|
+
DirCreatesAttempted
|
100
|
+
DirCreatesFailed
|
101
|
+
DirCreatesPassed
|
102
|
+
TransfersAttempted
|
103
|
+
TransfersFailed
|
104
|
+
TransfersPassed
|
105
|
+
TransfersSkipped
|
106
|
+
FallbackProtocol
|
107
|
+
RetryTimeout
|
108
|
+
PreTransferExcluded
|
109
|
+
XferId
|
110
|
+
XferRetry
|
111
|
+
Tags
|
112
|
+
FaspFileArgIndex
|
113
|
+
ArgTransfersStatus
|
114
|
+
ArgTransfersAttempted
|
115
|
+
ArgTransfersFailed
|
116
|
+
ArgTransfersPassed
|
117
|
+
ArgTransfersSkipped
|
118
|
+
FaspFileID
|
119
|
+
RateCap
|
120
|
+
MinRateCap
|
121
|
+
PolicyCap
|
122
|
+
PriorityCap
|
123
|
+
RateLock
|
124
|
+
MinRateLock
|
125
|
+
PolicyLock
|
126
|
+
FileChecksum
|
127
|
+
ServerHostname
|
128
|
+
ServerNodeId
|
129
|
+
ClientNodeId
|
130
|
+
ServerClusterId
|
131
|
+
ClientClusterId
|
132
|
+
FileChecksumType
|
133
|
+
ServerDocroot
|
134
|
+
ClientDocroot
|
135
|
+
NodeUser
|
136
|
+
ClientUser
|
137
|
+
SourcePrefix
|
138
|
+
RemoteAddress
|
139
|
+
TCPPort
|
140
|
+
Cipher
|
141
|
+
ResumePolicy
|
142
|
+
CreatePolicy
|
143
|
+
ManifestPolicy
|
144
|
+
Precalc
|
145
|
+
OverwritePolicy
|
146
|
+
RTTAutocorrect
|
147
|
+
TimePolicy
|
148
|
+
ManifestPath
|
149
|
+
ManifestInprogress
|
150
|
+
PartialFiles
|
151
|
+
FilesEncrypt
|
152
|
+
FilesDecrypt
|
153
|
+
DatagramSize
|
154
|
+
PrepostCommand
|
155
|
+
XoptFlags
|
156
|
+
VLinkVersion
|
157
|
+
PeerVLinkVersion
|
158
|
+
VLinkLocalEnabled
|
159
|
+
VLinkLocalId
|
160
|
+
VLinkLocalCL
|
161
|
+
VLinkRemoteEnabled
|
162
|
+
VLinkRemoteId
|
163
|
+
VLRemoteCL
|
164
|
+
DSPipelineDepth
|
165
|
+
PeerDSPipelineDepth
|
166
|
+
LocalIP
|
167
|
+
SourceBase
|
168
|
+
ReadBlockSize
|
169
|
+
WriteBlockSize
|
170
|
+
ClusterNumNodes
|
171
|
+
ClusterNodeId
|
172
|
+
MoveRange
|
173
|
+
MoveRangeLow
|
174
|
+
MoveRangeHigh
|
175
|
+
Keepalive
|
176
|
+
TestLogin
|
177
|
+
UseProxy
|
178
|
+
ProxyIP
|
179
|
+
RateControlAlgorithm
|
180
|
+
ClientMacAddress
|
181
|
+
Offset
|
182
|
+
ChunkSize
|
183
|
+
PostTransferValidation
|
184
|
+
OverwritePolicyCap
|
185
|
+
ExtraCreatePolicy]
|
186
|
+
# Management port start message
|
187
|
+
MGT_HEADER = 'FASPMGR 2'
|
188
|
+
# fields description for JSON generation
|
189
|
+
# spellchecker: disable
|
190
|
+
INTEGER_FIELDS = %w[Bytescont FaspFileArgIndex StartByte Rate MinRate Port Priority RateCap MinRateCap TCPPort CreatePolicy TimePolicy
|
191
|
+
DatagramSize XoptFlags VLinkVersion PeerVLinkVersion DSPipelineDepth PeerDSPipelineDepth ReadBlockSize WriteBlockSize
|
192
|
+
ClusterNumNodes ClusterNodeId Size Written Loss FileBytes PreTransferBytes TransferBytes PMTU Elapsedusec ArgScansAttempted
|
193
|
+
ArgScansCompleted PathScansAttempted FileScansCompleted TransfersAttempted TransfersPassed Delay].freeze
|
194
|
+
BOOLEAN_FIELDS = %w[Encryption Remote RateLock MinRateLock PolicyLock FilesEncrypt FilesDecrypt VLinkLocalEnabled VLinkRemoteEnabled
|
195
|
+
MoveRange Keepalive TestLogin UseProxy Precalc RTTAutocorrect].freeze
|
196
|
+
# cspell: enable
|
197
|
+
|
198
|
+
class << self
|
199
|
+
# translates legacy event into enhanced (JSON) event
|
200
|
+
def enhanced_event_format(event)
|
201
|
+
return event.keys.each_with_object({}) do |e, h|
|
202
|
+
# capital_to_snake_case
|
203
|
+
new_name = e
|
204
|
+
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
|
205
|
+
.gsub(/([a-z\d])(usec)$/, '\1_\2')
|
206
|
+
.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
|
207
|
+
.downcase
|
208
|
+
value = event[e]
|
209
|
+
value = value.to_i if INTEGER_FIELDS.include?(e)
|
210
|
+
value = value.eql?('Yes') if BOOLEAN_FIELDS.include?(e)
|
211
|
+
h[new_name] = value
|
212
|
+
end
|
213
|
+
end
|
214
|
+
end # class << self
|
215
|
+
|
216
|
+
def initialize
|
217
|
+
@event_build = nil
|
218
|
+
@last_event = nil
|
219
|
+
end
|
220
|
+
attr_reader :last_event
|
221
|
+
|
222
|
+
def process_line(line)
|
223
|
+
# Log.log.debug{"line=[#{line}]"}
|
224
|
+
case line
|
225
|
+
when MGT_HEADER
|
226
|
+
# begin event
|
227
|
+
@event_build = {}
|
228
|
+
when /^([^:]+): (.*)$/
|
229
|
+
# event field
|
230
|
+
@event_build[Regexp.last_match(1)] = Regexp.last_match(2)
|
231
|
+
when ''
|
232
|
+
# empty line is separator to end event information
|
233
|
+
raise 'unexpected empty line' if @event_build.nil?
|
234
|
+
@last_event = @event_build
|
235
|
+
@event_build = nil
|
236
|
+
return @last_event
|
237
|
+
else
|
238
|
+
raise "unexpected line:[#{line}]"
|
239
|
+
end # case
|
240
|
+
return nil
|
241
|
+
end
|
242
|
+
end
|
243
|
+
end
|
244
|
+
end
|
@@ -4,6 +4,9 @@ require 'aspera/log'
|
|
4
4
|
require 'aspera/command_line_builder'
|
5
5
|
require 'aspera/temp_file_manager'
|
6
6
|
require 'aspera/fasp/error'
|
7
|
+
require 'aspera/fasp/installation'
|
8
|
+
require 'aspera/cli/formatter'
|
9
|
+
require 'aspera/rest'
|
7
10
|
require 'securerandom'
|
8
11
|
require 'base64'
|
9
12
|
require 'json'
|
@@ -16,11 +19,11 @@ module Aspera
|
|
16
19
|
# translate transfer specification to ascp parameter list
|
17
20
|
class Parameters
|
18
21
|
# Agents shown in manual for parameters (sub list)
|
19
|
-
SUPPORTED_AGENTS = %i[direct node connect].freeze
|
22
|
+
SUPPORTED_AGENTS = %i[direct node connect trsdk httpgw].freeze
|
20
23
|
# Short names of columns in manual
|
21
24
|
SUPPORTED_AGENTS_SHORT = SUPPORTED_AGENTS.map{|a|a.to_s[0].to_sym}
|
22
25
|
FILE_LIST_OPTIONS = ['--file-list', '--file-pair-list'].freeze
|
23
|
-
SUPPORTED_OPTIONS = %i[ascp_args wss].freeze
|
26
|
+
SUPPORTED_OPTIONS = %i[ascp_args wss check_ignore quiet].freeze
|
24
27
|
|
25
28
|
private_constant :SUPPORTED_AGENTS, :FILE_LIST_OPTIONS
|
26
29
|
|
@@ -28,7 +31,7 @@ module Aspera
|
|
28
31
|
# Temp folder for file lists, must contain only file lists
|
29
32
|
# because of garbage collection takes any file there
|
30
33
|
# this could be refined, as , for instance, on macos, temp folder is already user specific
|
31
|
-
@file_list_folder = TempFileManager.instance.new_file_path_global('asession_filelists')
|
34
|
+
@file_list_folder = TempFileManager.instance.new_file_path_global('asession_filelists') # cspell:disable-line
|
32
35
|
@param_description_cache = nil
|
33
36
|
# @return normalized description of transfer spec parameters, direct from yaml
|
34
37
|
def description
|
@@ -48,7 +51,7 @@ module Aspera
|
|
48
51
|
param = {name: name, type: [options[:accepted_types]].flatten.join(','), description: options[:desc]}
|
49
52
|
# add flags for supported agents in doc
|
50
53
|
SUPPORTED_AGENTS.each do |a|
|
51
|
-
param[a.to_s[0].to_sym] = options[:agents].nil? || options[:agents].include?(a)
|
54
|
+
param[a.to_s[0].to_sym] = Cli::Formatter.tick(options[:agents].nil? || options[:agents].include?(a))
|
52
55
|
end
|
53
56
|
# only keep lines that are usable in supported agents
|
54
57
|
next if SUPPORTED_AGENTS_SHORT.inject(true){|m, j|m && param[j].empty?}
|
@@ -66,9 +69,12 @@ module Aspera
|
|
66
69
|
else
|
67
70
|
raise "error: #{param}"
|
68
71
|
end.map{|n|"{#{n}}"}.join('|')
|
69
|
-
|
70
|
-
"#{options[:cli][:switch]} #{
|
71
|
-
|
72
|
+
conversion_tag = options[:cli].key?(:convert) ? '(conversion)' : ''
|
73
|
+
"#{options[:cli][:switch]} #{conversion_tag}#{values}"
|
74
|
+
when :special then Cli::Formatter.special('special')
|
75
|
+
when :ignore then Cli::Formatter.special('ignored')
|
76
|
+
else
|
77
|
+
param[:d].eql?(tick_yes) ? '' : 'n/a'
|
72
78
|
end
|
73
79
|
if options.key?(:enum)
|
74
80
|
param[:description] += "\nAllowed values: #{options[:enum].join(', ')}"
|
@@ -121,11 +127,12 @@ module Aspera
|
|
121
127
|
def initialize(job_spec, options)
|
122
128
|
@job_spec = job_spec
|
123
129
|
# check necessary options
|
124
|
-
|
130
|
+
missing_options = SUPPORTED_OPTIONS - options.keys
|
131
|
+
raise "Internal: missing options: #{missing_options.join(', ')}" unless missing_options.empty?
|
125
132
|
@options = SUPPORTED_OPTIONS.each_with_object({}){|o, h| h[o] = options[o]}
|
126
|
-
Log.dump(:
|
127
|
-
raise 'ascp
|
128
|
-
raise 'ascp
|
133
|
+
Log.log.debug{Log.dump(:parameters_options, @options)}
|
134
|
+
raise 'ascp arguments must be an Array' unless @options[:ascp_args].is_a?(Array)
|
135
|
+
raise 'ascp arguments must be an Array of String' if @options[:ascp_args].any?{|i|!i.is_a?(String)}
|
129
136
|
@builder = Aspera::CommandLineBuilder.new(@job_spec, self.class.description)
|
130
137
|
end
|
131
138
|
|
@@ -133,7 +140,7 @@ module Aspera
|
|
133
140
|
# is the file list provided through EX_ parameters?
|
134
141
|
ascp_file_list_provided = self.class.ts_has_ascp_file_list(@job_spec, @options[:ascp_args])
|
135
142
|
# set if paths is mandatory in ts
|
136
|
-
@builder.params_definition['paths'][:mandatory] = !@job_spec.key?('keepalive') && !ascp_file_list_provided
|
143
|
+
@builder.params_definition['paths'][:mandatory] = !@job_spec.key?('keepalive') && !ascp_file_list_provided # cspell:words keepalive
|
137
144
|
# get paths in transfer spec (after setting if it is mandatory)
|
138
145
|
ts_paths_array = @builder.read_param('paths')
|
139
146
|
if ascp_file_list_provided && !ts_paths_array.nil?
|
@@ -160,13 +167,14 @@ module Aspera
|
|
160
167
|
# if there is one destination in paths, then use file-pair-list
|
161
168
|
if is_pair_list
|
162
169
|
option = '--file-pair-list'
|
163
|
-
lines = ts_paths_array.each_with_object([]){|e, m|m.push(e['source'], e['destination'] || e['source'])
|
170
|
+
lines = ts_paths_array.each_with_object([]){|e, m|m.push(e['source'], e['destination'] || e['source']) }
|
164
171
|
else
|
165
172
|
option = '--file-list'
|
166
173
|
lines = ts_paths_array.map{|i|i['source']}
|
167
174
|
end
|
168
175
|
file_list_file = Aspera::TempFileManager.instance.new_file_path_in_folder(self.class.file_list_folder)
|
169
|
-
|
176
|
+
Log.log.debug{Log.dump(:file_list, lines)}
|
177
|
+
File.write(file_list_file, lines.join("\n"), encoding: 'UTF-8')
|
170
178
|
Log.log.debug{"#{option}=\n#{File.read(file_list_file)}".red}
|
171
179
|
end
|
172
180
|
end
|
@@ -184,17 +192,14 @@ module Aspera
|
|
184
192
|
env: {},
|
185
193
|
ascp_version: :ascp
|
186
194
|
}
|
187
|
-
# some ssh credentials are required to avoid interactive password input
|
188
|
-
if !@job_spec.key?('remote_password') &&
|
189
|
-
!@job_spec.key?('ssh_private_key') &&
|
190
|
-
!@job_spec.key?('EX_ssh_key_paths')
|
191
|
-
raise Fasp::Error, 'required: password or ssh key (value or path)'
|
192
|
-
end
|
193
195
|
|
194
196
|
# special cases
|
195
197
|
@job_spec.delete('source_root') if @job_spec.key?('source_root') && @job_spec['source_root'].empty?
|
196
198
|
|
197
|
-
#
|
199
|
+
# notify multi-session was already used, anyway it was deleted by agent direct
|
200
|
+
raise 'internal error' if @builder.read_param('multi_session')
|
201
|
+
|
202
|
+
# use web socket secure for session ?
|
198
203
|
if @builder.read_param('wss_enabled') && (@options[:wss] || !@job_spec.key?('fasp_port'))
|
199
204
|
# by default use web socket session if available, unless removed by user
|
200
205
|
@builder.add_command_line_options(['--ws-connect'])
|
@@ -204,12 +209,30 @@ module Aspera
|
|
204
209
|
@job_spec.delete('fasp_port')
|
205
210
|
@job_spec.delete('EX_ssh_key_paths')
|
206
211
|
@job_spec.delete('sshfp')
|
207
|
-
|
208
|
-
|
209
|
-
|
212
|
+
if @options[:check_ignore]&.call(@job_spec['remote_host'], @job_spec['wss_port'])
|
213
|
+
http_session = Rest.start_http_session("https://#{@job_spec['remote_host']}:#{@job_spec['wss_port']}")
|
214
|
+
# wss_api = Rest.new(base_url: "/v1/transfer")
|
215
|
+
# wss_api.read('start') rescue nil
|
216
|
+
wss_cert_file = TempFileManager.instance.new_file_path_global('wss_cert')
|
217
|
+
File.write(wss_cert_file, http_session.peer_cert.to_pem)
|
218
|
+
http_session.finish
|
219
|
+
env_args[:args].unshift('-i', wss_cert_file)
|
220
|
+
Log.log.debug{"CA certs for wss: remote cert: #{wss_cert_file}"}
|
221
|
+
else
|
222
|
+
# set location for CA bundle to be the one of Ruby, see env var SSL_CERT_FILE / SSL_CERT_DIR
|
223
|
+
@options[:trusted_certs].each do |file|
|
224
|
+
env_args[:args].unshift('-i', file)
|
225
|
+
Log.log.debug{"trusted certs for wss: #{file}"}
|
226
|
+
end
|
227
|
+
end
|
210
228
|
else
|
211
229
|
# remove unused parameter (avoid warning)
|
212
230
|
@job_spec.delete('wss_port')
|
231
|
+
# add SSH bypass keys when authentication is token and no auth is provided
|
232
|
+
if @job_spec.key?('token') && !@job_spec.key?('remote_password')
|
233
|
+
# @job_spec['remote_password'] = Installation.instance.ssh_cert_uuid # not used: no passphrase
|
234
|
+
Installation.instance.aspera_token_ssh_key_paths.each { |key| env_args[:args].unshift('-i', key) }
|
235
|
+
end
|
213
236
|
end
|
214
237
|
|
215
238
|
# process parameters as specified in table
|
@@ -225,7 +248,7 @@ module Aspera
|
|
225
248
|
end
|
226
249
|
# get list of files to transfer and build arg for ascp
|
227
250
|
process_file_list
|
228
|
-
# optional
|
251
|
+
# optional arguments, at the end to override previous ones (to allow override)
|
229
252
|
@builder.add_command_line_options(@builder.read_param('EX_ascp_args'))
|
230
253
|
@builder.add_command_line_options(@options[:ascp_args])
|
231
254
|
# process destination folder
|
@@ -235,7 +258,17 @@ module Aspera
|
|
235
258
|
# destination MUST be last command line argument to ascp
|
236
259
|
@builder.add_command_line_options([destination_folder])
|
237
260
|
|
238
|
-
|
261
|
+
Log.log.debug{"ascp args: #{env_args}"}
|
262
|
+
|
263
|
+
@builder.add_env_args(env_args)
|
264
|
+
|
265
|
+
env_args[:args].unshift('-q') if @options[:quiet]
|
266
|
+
|
267
|
+
# add fallback cert and key as arguments if needed
|
268
|
+
if ['1', 1, true, 'force'].include?(@job_spec['http_fallback'])
|
269
|
+
env_args[:args].unshift('-Y', Installation.instance.path(:fallback_private_key))
|
270
|
+
env_args[:args].unshift('-I', Installation.instance.path(:fallback_certificate))
|
271
|
+
end
|
239
272
|
|
240
273
|
return env_args
|
241
274
|
end
|
@@ -2,13 +2,13 @@
|
|
2
2
|
# accepted_types : accepted types for non-enum
|
3
3
|
# default : default value if not specified
|
4
4
|
# enum : set with list of values for enum types accepted in transfer spec
|
5
|
-
# agents : supported agents (for doc only)
|
5
|
+
# agents : supported agents (for doc only), if not specified: all
|
6
6
|
# required : optional, default: false
|
7
7
|
# cli.type : ascp: type of parameter, one of CLI_OPTION_TYPES
|
8
8
|
# cli.switch : ascp: switch for ascp command line
|
9
9
|
# cli.convert : ascp: transform value: either a Hash with conversion values, or name of class
|
10
10
|
# cli.variable : ascp: name of env var
|
11
|
-
# cspell:words dgram
|
11
|
+
# cspell:words dgram dnat dnats faspmgr asperanoded xattrs keepalive datagram
|
12
12
|
---
|
13
13
|
cipher:
|
14
14
|
:desc: "In transit encryption type."
|
@@ -79,7 +79,11 @@ destination_root:
|
|
79
79
|
:cli:
|
80
80
|
:type: :special
|
81
81
|
destination_root_id:
|
82
|
-
:desc:
|
82
|
+
:desc: |-
|
83
|
+
The file ID of the destination root directory.
|
84
|
+
Required when using Bearer token auth for the destination node.
|
85
|
+
|
86
|
+
|
83
87
|
:accepted_types: :string
|
84
88
|
:agents:
|
85
89
|
- :sdk
|
@@ -177,7 +181,7 @@ multi_session:
|
|
177
181
|
|
178
182
|
:accepted_types: :int
|
179
183
|
:cli:
|
180
|
-
:type: :
|
184
|
+
:type: :special
|
181
185
|
:switch: "-C"
|
182
186
|
multi_session_threshold:
|
183
187
|
:desc: |-
|
@@ -227,15 +231,37 @@ precalculate_job_size:
|
|
227
231
|
:cli:
|
228
232
|
:type: :opt_without_arg
|
229
233
|
preserve_access_time:
|
234
|
+
:desc: |-
|
235
|
+
Preserve the source-file access timestamps at the destination.
|
236
|
+
Because source access times are updated by the transfer operation,
|
237
|
+
the timestamp that is preserved is the one just before to the transfer.
|
238
|
+
|
239
|
+
|
230
240
|
:cli:
|
231
241
|
:type: :opt_without_arg
|
232
242
|
preserve_creation_time:
|
243
|
+
:desc: |-
|
244
|
+
(Windows only) Preserve source-file creation timestamps at the destination.
|
245
|
+
Only Windows systems retain information about creation time.
|
246
|
+
If the destination is not a Windows computer, this option is ignored.
|
247
|
+
|
248
|
+
|
233
249
|
:cli:
|
234
250
|
:type: :opt_without_arg
|
235
251
|
preserve_modification_time:
|
252
|
+
:desc: |-
|
253
|
+
Set the modification time, the last time a file or directory was modified (written), of a transferred file
|
254
|
+
to the modification of the source file or directory.
|
255
|
+
Preserve source-file modification timestamps at the destination.
|
256
|
+
|
257
|
+
|
236
258
|
:cli:
|
237
259
|
:type: :opt_without_arg
|
238
260
|
preserve_times:
|
261
|
+
:desc: Preserve file timestamps.
|
262
|
+
:agents:
|
263
|
+
- :sdk
|
264
|
+
- :node
|
239
265
|
:cli:
|
240
266
|
:type: :opt_without_arg
|
241
267
|
rate_policy:
|
@@ -437,6 +463,7 @@ use_ascp4:
|
|
437
463
|
:cli:
|
438
464
|
:type: :special
|
439
465
|
use_system_ssh:
|
466
|
+
:desc: TODO, comment...
|
440
467
|
:accepted_types: :string
|
441
468
|
:agents:
|
442
469
|
- :sdk
|
@@ -454,22 +481,46 @@ source_root:
|
|
454
481
|
:switch: "--source-prefix64"
|
455
482
|
:convert: Aspera::Fasp::Parameters.convert_base64
|
456
483
|
min_rate_cap_kbps:
|
484
|
+
:desc: |-
|
485
|
+
The highest minimum rate that an incoming transfer can request, in kilobits per second.
|
486
|
+
Client minimum rate requests that exceed the minimum rate cap are ignored.
|
487
|
+
The default value of unlimited applies no cap to the minimum rate. (Default: 0)
|
488
|
+
|
489
|
+
|
457
490
|
:accepted_types: :int
|
458
491
|
:cli:
|
459
492
|
:type: :ignore
|
460
493
|
lock_rate_policy:
|
494
|
+
:desc: If true, lock the rate policy to the default value.
|
461
495
|
:accepted_types: :bool
|
496
|
+
:agents:
|
497
|
+
- :sdk
|
498
|
+
- :connect
|
462
499
|
:cli:
|
463
500
|
:type: :ignore
|
464
501
|
lock_target_rate_kbps:
|
502
|
+
:desc: |-
|
503
|
+
If true, lock the target transfer rate to the default value set for target_rate_kbps.
|
504
|
+
If false, users can adjust the transfer rate up to the value set for target_rate_cap_kbps.
|
505
|
+
|
506
|
+
|
465
507
|
:accepted_types: :bool
|
466
508
|
:cli:
|
467
509
|
:type: :ignore
|
468
510
|
lock_min_rate_kbps:
|
511
|
+
:desc: |-
|
512
|
+
If true, lock the minimum transfer rate to the value set for min_rate_kbps.
|
513
|
+
If false, users can adjust the transfer rate up to the value set for target_rate_cap_kbps.
|
514
|
+
|
515
|
+
|
469
516
|
:accepted_types: :bool
|
517
|
+
:agents:
|
518
|
+
- :sdk
|
519
|
+
- :connect
|
470
520
|
:cli:
|
471
521
|
:type: :ignore
|
472
522
|
apply_local_docroot:
|
523
|
+
:desc: Apply local docroot to source paths.
|
473
524
|
:agents:
|
474
525
|
- :direct
|
475
526
|
- :sdk
|
@@ -561,7 +612,7 @@ remove_empty_source_directory:
|
|
561
612
|
:type: :opt_without_arg
|
562
613
|
EX_at_rest_password:
|
563
614
|
:desc: Content protection password
|
564
|
-
:deprecation: "Use standard spec parameter: content_protection_password"
|
615
|
+
:deprecation: "(4.13) Use standard spec parameter: content_protection_password"
|
565
616
|
:agents:
|
566
617
|
- :direct
|
567
618
|
:cli:
|
@@ -573,6 +624,7 @@ EX_proxy_password:
|
|
573
624
|
May be overridden by password in URL provided in parameter: proxy.
|
574
625
|
|
575
626
|
|
627
|
+
:deprecation: (4.14) Use env var ASPERA_PROXY_PASS
|
576
628
|
:agents:
|
577
629
|
- :direct
|
578
630
|
:cli:
|
@@ -580,14 +632,17 @@ EX_proxy_password:
|
|
580
632
|
:variable: ASPERA_PROXY_PASS
|
581
633
|
EX_license_text:
|
582
634
|
:desc: "License file text override.\nBy default ascp looks for license file near executable."
|
635
|
+
:deprecation: (4.14) Use env var ASPERA_SCP_LICENSE
|
583
636
|
:agents:
|
584
637
|
- :direct
|
585
638
|
:cli:
|
586
639
|
:type: :envvar
|
587
640
|
:variable: ASPERA_SCP_LICENSE
|
588
641
|
keepalive:
|
642
|
+
:desc: The session is running in persistent session mode.
|
589
643
|
:agents:
|
590
|
-
- :
|
644
|
+
- :sdk
|
645
|
+
- :direct
|
591
646
|
:cli:
|
592
647
|
:type: :opt_without_arg
|
593
648
|
dgram_size:
|
@@ -610,6 +665,7 @@ sshfp:
|
|
610
665
|
:switch: "--check-sshfp"
|
611
666
|
EX_http_proxy_url:
|
612
667
|
:desc: Specify the proxy server address used by HTTP Fallback
|
668
|
+
:deprecation: (4.14) TODO, use proxy option ?
|
613
669
|
:agents:
|
614
670
|
- :direct
|
615
671
|
:cli:
|
@@ -617,6 +673,7 @@ EX_http_proxy_url:
|
|
617
673
|
:switch: "-x"
|
618
674
|
EX_ssh_key_paths:
|
619
675
|
:desc: Use public key authentication for SSH and specify the private key file paths
|
676
|
+
:deprecation: (4.14) Use option transfer_info.ascp_args
|
620
677
|
:accepted_types: :array
|
621
678
|
:agents:
|
622
679
|
- :direct
|
@@ -625,6 +682,7 @@ EX_ssh_key_paths:
|
|
625
682
|
:switch: "-i"
|
626
683
|
EX_http_transfer_jpeg:
|
627
684
|
:desc: HTTP transfers as JPEG file
|
685
|
+
:deprecation: (4.14) Use option transfer_info.ascp_args
|
628
686
|
:accepted_types: :int
|
629
687
|
:default: '0'
|
630
688
|
:agents:
|
@@ -634,6 +692,7 @@ EX_http_transfer_jpeg:
|
|
634
692
|
:switch: "-j"
|
635
693
|
EX_no_read:
|
636
694
|
:desc: no read source
|
695
|
+
:deprecation: (4.14) Use option transfer_info.ascp_args
|
637
696
|
:agents:
|
638
697
|
- :direct
|
639
698
|
:cli:
|
@@ -641,12 +700,14 @@ EX_no_read:
|
|
641
700
|
:switch: "--no-read"
|
642
701
|
EX_no_write:
|
643
702
|
:desc: no write on destination
|
703
|
+
:deprecation: (4.14) Use option transfer_info.ascp_args
|
644
704
|
:agents:
|
645
705
|
- :direct
|
646
706
|
:cli:
|
647
707
|
:type: :opt_without_arg
|
648
708
|
:switch: "--no-write"
|
649
709
|
target_rate_percentage:
|
710
|
+
:desc: "TODO: remove ?"
|
650
711
|
:cli:
|
651
712
|
:type: :ignore
|
652
713
|
rate_policy_allowed:
|
@@ -661,15 +722,18 @@ rate_policy_allowed:
|
|
661
722
|
:cli:
|
662
723
|
:type: :ignore
|
663
724
|
fasp_url:
|
725
|
+
:desc: Only used in Faspex.
|
664
726
|
:agents:
|
665
727
|
- :unknown
|
666
728
|
:cli:
|
667
729
|
:type: :ignore
|
668
730
|
lock_min_rate:
|
731
|
+
:desc: "TODO: remove ?"
|
669
732
|
:accepted_types: :bool
|
670
733
|
:cli:
|
671
734
|
:type: :ignore
|
672
735
|
lock_target_rate:
|
736
|
+
:desc: "TODO: remove ?"
|
673
737
|
:accepted_types: :bool
|
674
738
|
:cli:
|
675
739
|
:type: :ignore
|
@@ -684,13 +748,15 @@ cipher_allowed:
|
|
684
748
|
:cli:
|
685
749
|
:type: :ignore
|
686
750
|
obfuscate_file_names:
|
751
|
+
:desc: HTTP Gateway obfuscates file names when set to true.
|
687
752
|
:accepted_types: :bool
|
688
753
|
:agents:
|
689
|
-
- :
|
754
|
+
- :httpgw
|
690
755
|
:cli:
|
691
756
|
:type: :ignore
|
692
757
|
EX_file_list:
|
693
758
|
:desc: source file list
|
759
|
+
:deprecation: (4.14) Use command line file list, or option transfer_info.ascp_args
|
694
760
|
:agents:
|
695
761
|
- :direct
|
696
762
|
:cli:
|
@@ -698,6 +764,7 @@ EX_file_list:
|
|
698
764
|
:switch: "--file-list"
|
699
765
|
EX_file_pair_list:
|
700
766
|
:desc: source file pair list
|
767
|
+
:deprecation: (4.14) Use command line file pair list, or option transfer_info.ascp_args
|
701
768
|
:agents:
|
702
769
|
- :direct
|
703
770
|
:cli:
|
@@ -705,7 +772,7 @@ EX_file_pair_list:
|
|
705
772
|
:switch: "--file-pair-list"
|
706
773
|
EX_ascp_args:
|
707
774
|
:desc: Add native command line arguments to ascp
|
708
|
-
:deprecation: Use
|
775
|
+
:deprecation: (4.13) Use option transfer_info.ascp_args
|
709
776
|
:accepted_types: :array
|
710
777
|
:agents:
|
711
778
|
- :direct
|