From 79b4586ed4c422974e69a53be67791a1a431c2d7 Mon Sep 17 00:00:00 2001 From: Alexander Meindl Date: Sat, 8 Jan 2022 19:14:58 +0100 Subject: [PATCH] use redmine configuration for configuration variables to show on info --- app/models/additionals_info.rb | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/app/models/additionals_info.rb b/app/models/additionals_info.rb index 12b4e731..228ea66d 100644 --- a/app/models/additionals_info.rb +++ b/app/models/additionals_info.rb @@ -11,10 +11,18 @@ class AdditionalsInfo api_value: system_uptime(format: :datetime) }, redmine_plugin_kit: { label: 'Redmine Plugin Kit', value: RedminePluginKit::VERSION } } - infos['ENABLE_DEBUG'] = { value: true } if ENV['ENABLE_DEBUG'] - if ENV['ENABLE_BACKTRACE'] - infos['ENABLE_BACKTRACE'] = { value: true } - infos['RUBYOPT'] = { value: ENV['RUBYOPT'] } + + Array(Redmine::Configuration['system_infos_vars']).each do |var| + next unless ENV.key? var + + infos[var] = { value: ENV[var] } + end + + Array(Redmine::Configuration['system_infos_bool_vars']).each do |var| + next unless ENV.key? var + + value = ENV[var] + infos[var] = { value: RedminePluginKit.true?(value) } if value end infos