diff --git a/docs/README.erb.md b/docs/README.erb.md index be3ff637..90d5d7b9 100644 --- a/docs/README.erb.md +++ b/docs/README.erb.md @@ -232,19 +232,27 @@ To check manually: ## FASP Protocol -Most file transfers will be done using the FASP protocol. Only two additional files are required to perform -an Aspera Transfer: +Most file transfers will be done using the FASP protocol, using `ascp`. +Only two additional files are required to perform an Aspera Transfer, which are part of Aspera SDK: * ascp * aspera-license (in same folder, or ../etc) -This can be installed directly with +This can be installed either be installing an Aspera transfer sofware, or using an embedded command: ``` $ <%=cmd%> conf ascp install ``` -Those can be found in one of IBM Aspera transfer server or client with its license file (some are free): +If a local SDK installation is prefered instead of fetching from internet: one can specify the location of the SDK file: + +``` +$ <%=cmd%> conf ascp install --sdk-url=file:///SDK.zip +``` + +The format is: `file:///`, where `` can be either a relative path (not starting with `/`), or an absolute path. + +If the embedded method is not used, the following packages are also suitable: * IBM Aspera Connect Client (Free) * IBM Aspera Desktop Client (Free) @@ -2729,6 +2737,7 @@ So, it evolved into <%=tool%>: * renamed command `nagios_check` to `health` * agent `http_gw` now supports upload + * added option `sdk_url` * 4.0.0 diff --git a/lib/aspera/cli/plugins/config.rb b/lib/aspera/cli/plugins/config.rb index da2813de..935eb6b2 100644 --- a/lib/aspera/cli/plugins/config.rb +++ b/lib/aspera/cli/plugins/config.rb @@ -107,11 +107,13 @@ def initialize(env,tool_name,help_url,version) self.options.add_opt_simple(:default,"set as default configuration for specified plugin") self.options.add_opt_simple(:secret,"access key secret for node") self.options.add_opt_simple(:secrets,"access key secret for node") + self.options.add_opt_simple(:sdk_url,"URL to get SDK") self.options.add_opt_boolean(:test_mode,"skip user validation in wizard mode") self.options.add_opt_simple(:version_check_days,Integer,"period to check neew version in days (zero to disable)") self.options.set_option(:use_generic_client,true) self.options.set_option(:test_mode,false) self.options.set_option(:version_check_days,7) + self.options.set_option(:sdk_url,'https://eudemo.asperademo.com/aspera/faspex/sdk.zip') self.options.parse_options! raise CliBadArgument,"secrets shall be Hash" unless @option_secrets.is_a?(Hash) end @@ -524,7 +526,7 @@ def execute_action_ascp return {:type=>:status, :data=>"saved to default global preset #{preset_name}"} end when :install - v=Fasp::Installation.instance.install_sdk + v=Fasp::Installation.instance.install_sdk(self.options.get_option(:sdk_url,:mandatory)) return {:type=>:status, :data=>"Installed version #{v}"} end raise "unexpected case: #{command}" diff --git a/lib/aspera/fasp/installation.rb b/lib/aspera/fasp/installation.rb index d88ad10a..aa75a01e 100644 --- a/lib/aspera/fasp/installation.rb +++ b/lib/aspera/fasp/installation.rb @@ -176,10 +176,16 @@ def bypass_keys return [:ssh_bypass_key_dsa,:ssh_bypass_key_rsa].map{|i|Installation.instance.path(i)} end - def install_sdk + def install_sdk(sdk_url) require 'zip' sdk_zip_path=File.join(Dir.tmpdir,'sdk.zip') - Aspera::Rest.new(base_url: SDK_URL).call(operation: 'GET',save_to_file: sdk_zip_path) + if sdk_url.start_with?('file:') + # require specific file scheme: the path part is "relative", or absolute if there are 4 slash + raise 'use format: file:///' unless sdk_url.start_with?('file:///') + sdk_zip_path=sdk_url.gsub(%r{^file:///},'') + else + Aspera::Rest.new(base_url: sdk_url).call(operation: 'GET',save_to_file: sdk_zip_path) + end filter="/#{Environment.architecture}/" ascp_path=nil # first ensure license file is here so that ascp invokation for version works @@ -220,9 +226,8 @@ def install_sdk PRODUCT_INFO='product-info.mf' # policy for product selection FIRST_FOUND='FIRST' - SDK_URL='https://eudemo.asperademo.com/aspera/faspex/sdk.zip' - private_constant :BIN_SUBFOLDER,:ETC_SUBFOLDER,:VARRUN_SUBFOLDER,:PRODUCT_INFO,:SDK_URL + private_constant :BIN_SUBFOLDER,:ETC_SUBFOLDER,:VARRUN_SUBFOLDER,:PRODUCT_INFO # get some specific folder from specific applications: Connect or CLI def get_product_folders(name)