Do not print secrets in the config:check rake task.
authorWard Vandewege <ward@curoverse.com>
Mon, 24 Mar 2014 19:55:29 +0000 (15:55 -0400)
committerWard Vandewege <ward@curoverse.com>
Mon, 24 Mar 2014 19:55:29 +0000 (15:55 -0400)
apps/workbench/lib/tasks/config_check.rake
services/api/lib/tasks/config_check.rake

index c9f12fc1a929d775104dedcce23d8e63f383dc45..b74e03d90793bda7063115ab8e2a1c79ab0e4f1a 100644 (file)
@@ -2,7 +2,11 @@ namespace :config do
   desc 'Ensure site configuration has all required settings'
   task check: :environment do
     $application_config.sort.each do |k, v|
-      $stderr.puts "%-32s %s" % [k, eval("Rails.configuration.#{k}")]
+      if /(password|secret)/.match(k) then
+        $stderr.puts "%-32s %s" % [k, '*********']
+      else
+        $stderr.puts "%-32s %s" % [k, eval("Rails.configuration.#{k}")]
+      end
     end
   end
 end
index c9f12fc1a929d775104dedcce23d8e63f383dc45..b74e03d90793bda7063115ab8e2a1c79ab0e4f1a 100644 (file)
@@ -2,7 +2,11 @@ namespace :config do
   desc 'Ensure site configuration has all required settings'
   task check: :environment do
     $application_config.sort.each do |k, v|
-      $stderr.puts "%-32s %s" % [k, eval("Rails.configuration.#{k}")]
+      if /(password|secret)/.match(k) then
+        $stderr.puts "%-32s %s" % [k, '*********']
+      else
+        $stderr.puts "%-32s %s" % [k, eval("Rails.configuration.#{k}")]
+      end
     end
   end
 end