require 'config_validators'
require 'open3'
-begin
- # If secret_token.rb exists here, we need to load it first.
- require_relative 'secret_token.rb'
-rescue LoadError
- # Normally secret_token.rb is missing and the secret token is
- # configured by application.yml (i.e., here!) instead.
-end
-
# Load the defaults, used by config:migrate and fallback loading
# legacy application.yml
-Open3.popen2("arvados-server", "config-defaults") do |stdin, stdout, status_thread|
- confs = YAML.load(stdout, deserialize_symbols: false)
- clusterID, clusterConfig = confs["Clusters"].first
- $arvados_config_defaults = clusterConfig
- $arvados_config_defaults["ClusterID"] = clusterID
+defaultYAML, stderr, status = Open3.capture3("arvados-server", "config-dump", "-config=-", "-skip-legacy", stdin_data: "Clusters: {xxxxx: {}}")
+if !status.success?
+ puts stderr
+ raise "error loading config: #{status}"
end
+confs = YAML.load(defaultYAML, deserialize_symbols: false)
+clusterID, clusterConfig = confs["Clusters"].first
+$arvados_config_defaults = clusterConfig
+$arvados_config_defaults["ClusterID"] = clusterID
# Load the global config file
-Open3.popen2("arvados-server", "config-dump") do |stdin, stdout, status_thread|
+Open3.popen2("arvados-server", "config-dump", "-skip-legacy") do |stdin, stdout, status_thread|
confs = YAML.load(stdout, deserialize_symbols: false)
if confs && !confs.empty?
# config-dump merges defaults with user configuration, so every
arvcfg.declare_config "ManagementToken", String, :ManagementToken
arvcfg.declare_config "TLS.Insecure", Boolean, :arvados_insecure_https
+arvcfg.declare_config "Collections.TrustAllContent", Boolean, :trust_all_content
arvcfg.declare_config "Services.Controller.ExternalURL", URI, :arvados_v1_base, ->(cfg, k, v) {
u = URI(v)
arvcfg.declare_config "Users.AnonymousUserToken", String, :anonymous_user_token
-arvcfg.declare_config "Workbench.SecretToken", String, :secret_token
arvcfg.declare_config "Workbench.SecretKeyBase", String, :secret_key_base
arvcfg.declare_config "Workbench.ApplicationMimetypesWithViewIcon", Hash, :application_mimetypes_with_view_icon, ->(cfg, k, v) {
arvcfg.declare_config "Workbench.RunningJobLogRecordsToFetch", Integer, :running_job_log_records_to_fetch
arvcfg.declare_config "Workbench.LogViewerMaxBytes", Integer, :log_viewer_max_bytes
-arvcfg.declare_config "Workbench.TrustAllContent", Boolean, :trust_all_content
+arvcfg.declare_config "Workbench.ProfilingEnabled", Boolean, :profiling_enabled
+arvcfg.declare_config "Workbench.APIResponseCompression", Boolean, :api_response_compression
arvcfg.declare_config "Workbench.UserProfileFormFields", Hash, :user_profile_form_fields, ->(cfg, k, v) {
if !v
v = []
ConfigLoader.copy_into_config $remaining_config, config
secrets.secret_key_base = $arvados_config["Workbench"]["SecretKeyBase"]
ConfigValidators.validate_wb2_url_config()
+ ConfigValidators.validate_download_config()
+
end