arvcfg.declare_config "Collections.TrashSweepInterval", ActiveSupport::Duration, :trash_sweep_interval
arvcfg.declare_config "Collections.BlobSigningKey", NonemptyString, :blob_signing_key
arvcfg.declare_config "Collections.BlobSigningTTL", Integer, :blob_signature_ttl
-arvcfg.declare_config "Collections.BlobSigning", Boolean, :permit_create_collection_with_unsigned_manifest
+arvcfg.declare_config "Collections.BlobSigning", Boolean, :permit_create_collection_with_unsigned_manifest, ->(cfg, k, v) { ConfigLoader.set_cfg cfg, "Collections.BlobSigning", !v }
arvcfg.declare_config "Containers.SupportedDockerImageFormats", Array, :docker_image_formats
arvcfg.declare_config "Containers.LogReuseDecisions", Boolean, :log_reuse_decisions
arvcfg.declare_config "Containers.DefaultKeepCacheRAM", Integer, :container_default_keep_cache_ram
arvcfg.declare_config "Containers.JobsAPI.DefaultDockerImage", String, :default_docker_image_for_jobs
arvcfg.declare_config "Mail.MailchimpAPIKey", String, :mailchimp_api_key
arvcfg.declare_config "Mail.MailchimpListID", String, :mailchimp_list_id
+arvcfg.declare_config "Services.Controller.ExternalURL", URI
arvcfg.declare_config "Services.Workbench1.ExternalURL", URI, :workbench_address
arvcfg.declare_config "Services.Websocket.ExternalURL", URI, :websocket_address
arvcfg.declare_config "Services.WebDAV.ExternalURL", URI, :keep_web_service_url
arvcfg.declare_config "Services.GitHTTP.ExternalURL", URI, :git_repo_https_base
arvcfg.declare_config "Services.GitSSH.ExternalURL", URI, :git_repo_ssh_base, ->(cfg, k, v) { ConfigLoader.set_cfg cfg, "Services.GitSSH.ExternalURL", "ssh://#{v}" }
arvcfg.declare_config "RemoteClusters", Hash, :remote_hosts, ->(cfg, k, v) {
- h = {}
+ h = if cfg["RemoteClusters"] then
+ cfg["RemoteClusters"].deep_dup
+ else
+ {}
+ end
v.each do |clusterid, host|
- h[clusterid] = {
- "Host" => host,
- "Proxy" => true,
- "Scheme" => "https",
- "Insecure" => false,
- "ActivateUsers" => false
- }
+ if h[clusterid].nil?
+ h[clusterid] = {
+ "Host" => host,
+ "Proxy" => true,
+ "Scheme" => "https",
+ "Insecure" => false,
+ "ActivateUsers" => false
+ }
+ end
end
ConfigLoader.set_cfg cfg, "RemoteClusters", h
}
dbcfg.declare_config "PostgreSQL.ConnectionPool", Integer, :pool
dbcfg.declare_config "PostgreSQL.Connection.Host", String, :host
-dbcfg.declare_config "PostgreSQL.Connection.Port", Integer, :port
+dbcfg.declare_config "PostgreSQL.Connection.Port", String, :port
dbcfg.declare_config "PostgreSQL.Connection.User", String, :username
dbcfg.declare_config "PostgreSQL.Connection.Password", String, :password
dbcfg.declare_config "PostgreSQL.Connection.DBName", String, :database
application_config = {}
%w(application.default application).each do |cfgfile|
path = "#{::Rails.root.to_s}/config/#{cfgfile}.yml"
- confs = ConfigLoader.load(path)
+ confs = ConfigLoader.load(path, erb: true)
# Ignore empty YAML file:
next if confs == false
application_config.deep_merge!(confs['common'] || {})
db_config = {}
path = "#{::Rails.root.to_s}/config/database.yml"
if File.exist? path
- db_config = ConfigLoader.load(path)
+ db_config = ConfigLoader.load(path, erb: true)
end
$remaining_config = arvcfg.migrate_config(application_config, $arvados_config)
end
end
+if application_config[:host] || application_config[:port] || application_config[:scheme]
+ if !application_config[:host] || application_config[:host].empty?
+ raise "Must set 'host' when setting 'port' or 'scheme'"
+ end
+ $arvados_config.Services["Controller"]["ExternalURL"] = URI((application_config[:scheme] || "https")+"://"+application_config[:host]+
+ (if application_config[:port] then ":#{application_config[:port]}" else "" end))
+end
+
# Checks for wrongly typed configuration items, coerces properties
# into correct types (such as Duration), and optionally raise error
# for essential configuration that can't be empty.
# Rails.configuration.API["Blah"]
ConfigLoader.copy_into_config $arvados_config, config
ConfigLoader.copy_into_config $remaining_config, config
- config.secret_key_base = config.secret_token
+ secrets.secret_key_base = $arvados_config["API"]["RailsSessionSecretToken"]
end