setting.rb 705 B

12345678910111213141516171819
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class SystemReport::Plugin::Setting < SystemReport::Plugin
  3. SENSITIVE_SETTING_NAMES = %w[secret auth_ password pw credential endpoint_key _config _token recovery_codes pwd].freeze
  4. DESCRIPTION = __('Current state of configured settings (excluding passwords and tokens)').freeze
  5. def fetch
  6. ::Setting.all.each_with_object([]) do |setting, result|
  7. next if SENSITIVE_SETTING_NAMES.any? { |word| setting.name.include?(word) }
  8. result << {
  9. name: setting.name,
  10. current_value: setting.state_current['value'],
  11. initial_value: setting.state_initial['value'],
  12. }
  13. end
  14. end
  15. end