Add 'apps/arv-web/' from commit 'f9732ad8460d013c2f28363655d0d1b91894dca5'
[arvados.git] / services / api / lib / tasks / config_check.rake
1 namespace :config do
2   desc 'Ensure site configuration has all required settings'
3   task check: :environment do
4     $application_config.sort.each do |k, v|
5       if ENV.has_key?('QUIET') then
6         # Make sure we still check for the variable to exist
7         eval("Rails.configuration.#{k}")
8       else
9         if /(password|secret)/.match(k) then
10           # Make sure we still check for the variable to exist, but don't print the value
11           eval("Rails.configuration.#{k}")
12           $stderr.puts "%-32s %s" % [k, '*********']
13         else
14           $stderr.puts "%-32s %s" % [k, eval("Rails.configuration.#{k}")]
15         end
16       end
17     end
18     # default_trash_lifetime cannot be less than 24 hours
19     if Rails.configuration.default_trash_lifetime < 86400 then
20       raise "default_trash_lifetime is %d, must be at least 86400" % Rails.configuration.default_trash_lifetime
21     end
22   end
23 end