X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/9d1876405f50e009b686bce51c2469a52d2f79ca..034d8c6cf7a261d29373233d9302aebe2a2f895a:/services/api/lib/tasks/config_check.rake diff --git a/services/api/lib/tasks/config_check.rake b/services/api/lib/tasks/config_check.rake index c421101442..4f071f11a3 100644 --- a/services/api/lib/tasks/config_check.rake +++ b/services/api/lib/tasks/config_check.rake @@ -1,12 +1,17 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + namespace :config do desc 'Ensure site configuration has all required settings' task check: :environment do + $stderr.puts "%-32s %s" % ["AppVersion (discovered)", AppVersion.hash] $application_config.sort.each do |k, v| if ENV.has_key?('QUIET') then # Make sure we still check for the variable to exist eval("Rails.configuration.#{k}") else - if /(password|secret)/.match(k) then + if /(password|secret|signing_key)/.match(k) then # Make sure we still check for the variable to exist, but don't print the value eval("Rails.configuration.#{k}") $stderr.puts "%-32s %s" % [k, '*********'] @@ -16,8 +21,8 @@ namespace :config do end end # default_trash_lifetime cannot be less than 24 hours - if $application_config['default_trash_lifetime'] < 86400 then - raise "default_trash_lifetime is %d, must be at least 86400" % $application_config['default_trash_lifetime'] + if Rails.configuration.default_trash_lifetime < 86400 then + raise "default_trash_lifetime is %d, must be at least 86400" % Rails.configuration.default_trash_lifetime end end end