1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 # This file must be loaded _after_ secret_token.rb if secret_token is
6 # defined there instead of in config/application.yml.
8 $application_config = {}
10 %w(application.default application).each do |cfgfile|
11 path = "#{::Rails.root.to_s}/config/#{cfgfile}.yml"
13 yaml = ERB.new(IO.read path).result(binding)
14 confs = YAML.load(yaml, deserialize_symbols: true)
15 $application_config.merge!(confs['common'] || {})
16 $application_config.merge!(confs[::Rails.env.to_s] || {})
20 ArvadosWorkbench::Application.configure do
22 $application_config.each do |k, v|
23 # "foo.bar: baz" --> { config.foo.bar = baz }
30 if v.nil? and cfg.respond_to?(k) and !cfg.send(k).nil?
31 # Config is nil in *.yml, but has been set already in
32 # environments/*.rb (or has a Rails default). Don't overwrite
33 # the default/upstream config with nil.
35 # After config files have been migrated, this mechanism should
37 Rails.logger.warn <<EOS
38 DEPRECATED: Inheriting config.#{ks.join '.'} from Rails config.
39 Please move this config into config/application.yml.
42 # Config variables are not allowed to be nil. Make a "naughty"
43 # list, and present it below.
49 if !nils.empty? and not ::Rails.groups.include?('assets')
51 #{::Rails.groups.include?('assets')}
52 Refusing to start in #{::Rails.env.to_s} mode with missing configuration.
54 The following configuration settings must be specified in
55 config/application.yml:
60 # Refuse to start if keep-web isn't configured
61 if not (config.keep_web_url or config.keep_web_download_url) and not ::Rails.groups.include?('assets')
63 Refusing to start in #{::Rails.env.to_s} mode with missing configuration.
65 Keep-web service must be configured in config/application.yml:
67 * keep_web_download_url