system_report_spec.rb 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe SystemReport, current_user_id: 1, type: :model do
  4. describe 'fetch' do
  5. it 'generates system report' do
  6. expect(described_class.fetch[:system_report]).to include({
  7. 'Version' => Version.get,
  8. })
  9. end
  10. describe 'settings plugin' do
  11. let(:non_confidential_settings) do
  12. [
  13. 'ui_ticket_overview_priority_icon',
  14. 'kb_multi_lingual_support',
  15. 'kb_active',
  16. 'kb_active_publicly',
  17. 'ui_ticket_zoom_article_delete_timeframe',
  18. 'es_total_max_size_in_mb',
  19. 'system_init_done',
  20. 'maintenance_mode',
  21. 'maintenance_login',
  22. 'maintenance_login_message',
  23. 'developer_mode',
  24. 'system_online_service',
  25. 'product_name',
  26. 'product_logo',
  27. 'organization',
  28. 'locale_default',
  29. 'timezone_default',
  30. 'pretty_date_format',
  31. 'ui_ticket_zoom_article_note_new_internal',
  32. 'ui_ticket_zoom_article_visibility_confirmation_dialog',
  33. 'ui_ticket_zoom_article_email_subject',
  34. 'system_id',
  35. 'fqdn',
  36. 'websocket_backend',
  37. 'websocket_port',
  38. 'http_type',
  39. 'storage_provider',
  40. 'image_backend',
  41. 'geo_ip_backend',
  42. 'geo_location_backend',
  43. 'geo_calendar_backend',
  44. 'proxy',
  45. 'proxy_username',
  46. 'proxy_no',
  47. 'core_workflow_ajax_mode',
  48. 'ui_user_organization_selector_with_email',
  49. 'ui_ticket_zoom_article_email_full_quote',
  50. 'ui_ticket_zoom_article_email_full_quote_header',
  51. 'ui_ticket_zoom_article_twitter_initials',
  52. 'ui_ticket_zoom_attachments_preview',
  53. 'ui_ticket_zoom_sidebar_article_attachments',
  54. 'ui_ticket_create_notes',
  55. 'ui_ticket_create_default_type',
  56. 'ui_ticket_create_available_types',
  57. 'ui_sidebar_open_ticket_indicator_colored',
  58. 'ui_table_group_by_show_count',
  59. 'ui_ticket_overview_ticket_limit',
  60. 'ui_task_mananger_max_task_count',
  61. 'user_create_account',
  62. 'session_timeout',
  63. 'user_email_multiple_use',
  64. 'form_ticket_create_per_day',
  65. 'app_version',
  66. 'ticket_hook',
  67. 'ticket_hook_divider',
  68. 'ticket_hook_position',
  69. 'ticket_last_contact_behaviour',
  70. 'ticket_allow_expert_conditions',
  71. 'ticket_conditions_allow_regular_expression_operators',
  72. 'ticket_number',
  73. 'ticket_number_increment',
  74. 'ticket_number_date',
  75. 'ticket_auto_assignment',
  76. 'ticket_auto_assignment_selector',
  77. 'ticket_auto_assignment_user_ids_ignore',
  78. 'ticket_agent_default_notifications',
  79. 'ticket_subject_size',
  80. 'ticket_duplicate_detection',
  81. 'ticket_duplicate_detection_attributes',
  82. 'ticket_duplicate_detection_title',
  83. 'ticket_duplicate_detection_body',
  84. 'ticket_duplicate_detection_role_ids',
  85. 'ticket_duplicate_detection_show_tickets',
  86. 'ticket_duplicate_detection_permission_level',
  87. 'ticket_duplicate_detection_search',
  88. 'ticket_number_ignore_system_id',
  89. 'ticket_trigger_recursive',
  90. 'ticket_trigger_loop_protection_articles_per_ticket',
  91. 'ticket_trigger_loop_protection_articles_total',
  92. 'ticket_trigger_recursive_max_loop',
  93. 'customer_ticket_create',
  94. 'customer_ticket_create_group_ids',
  95. 'ticket_secondary_action',
  96. 'form_ticket_create',
  97. 'form_ticket_create_group_id',
  98. 'form_ticket_create_by_ip_per_hour',
  99. 'form_ticket_create_by_ip_per_day',
  100. 'ticket_subject_re',
  101. 'ticket_subject_fwd',
  102. 'ticket_define_email_from',
  103. 'ticket_define_email_from_separator',
  104. 'postmaster_max_size',
  105. 'postmaster_follow_up_search_in',
  106. 'postmaster_sender_based_on_reply_to',
  107. 'postmaster_sender_is_agent_search_for_customer',
  108. 'postmaster_send_reject_if_mail_too_large',
  109. 'notification_sender',
  110. 'send_no_auto_response_reg_exp',
  111. 'system_bcc',
  112. 'chat',
  113. 'chat_agent_idle_timeout',
  114. 'default_controller',
  115. 'es_url',
  116. 'es_user',
  117. 'es_index',
  118. 'es_ssl_verify',
  119. 'es_attachment_ignore',
  120. 'es_attachment_max_size_in_mb',
  121. 'es_pipeline',
  122. 'es_model_settings',
  123. 'import_mode',
  124. 'import_backend',
  125. 'import_ignore_sla',
  126. 'import_otrs_endpoint',
  127. 'import_otrs_user',
  128. 'import_zendesk_endpoint',
  129. 'import_zendesk_endpoint_username',
  130. 'import_freshdesk_endpoint',
  131. 'import_kayako_endpoint',
  132. 'import_kayako_endpoint_username',
  133. 'import_backends',
  134. 'sequencer_log_level',
  135. 'time_accounting',
  136. 'time_accounting_selector',
  137. 'time_accounting_unit',
  138. 'time_accounting_unit_custom',
  139. 'time_accounting_types',
  140. 'time_accounting_type_default',
  141. 'tag_new',
  142. 'defaults_calendar_subscriptions_tickets',
  143. '0005_postmaster_filter_trusted',
  144. '0006_postmaster_filter_auto_response_check',
  145. '0007_postmaster_filter_follow_up_check',
  146. '0008_postmaster_filter_follow_up_merged',
  147. '0009_postmaster_filter_follow_up_assignment',
  148. '0011_postmaster_sender_based_on_reply_to',
  149. '0018_postmaster_import_archive',
  150. '0012_postmaster_filter_sender_is_system_address',
  151. '0014_postmaster_filter_own_notification_loop_detection',
  152. '0015_postmaster_filter_identify_sender',
  153. '0016_postmaster_filter_secure_mailing',
  154. '0030_postmaster_filter_out_of_office_check',
  155. '0200_postmaster_filter_follow_up_possible_check',
  156. '0900_postmaster_filter_bounce_follow_up_check',
  157. '0950_postmaster_filter_bounce_delivery_permanent_failed',
  158. '0955_postmaster_filter_bounce_delivery_temporary_failed',
  159. '1000_postmaster_filter_database_check',
  160. '5000_postmaster_filter_icinga',
  161. '5100_postmaster_filter_nagios',
  162. '5300_postmaster_filter_monit',
  163. '5400_postmaster_filter_service_now_check',
  164. '5401_postmaster_filter_service_now_check',
  165. '5400_postmaster_filter_jira_check',
  166. '5401_postmaster_filter_jira_check',
  167. '5500_postmaster_internal_article_check',
  168. 'icinga_integration',
  169. 'icinga_sender',
  170. 'icinga_auto_close',
  171. 'icinga_auto_close_state_id',
  172. 'nagios_integration',
  173. 'nagios_sender',
  174. 'nagios_auto_close',
  175. 'nagios_auto_close_state_id',
  176. 'check_mk_integration',
  177. 'check_mk_group_id',
  178. 'check_mk_auto_close',
  179. 'check_mk_auto_close_state_id',
  180. 'monit_integration',
  181. 'monit_sender',
  182. 'monit_auto_close',
  183. 'monit_auto_close_state_id',
  184. 'ldap_integration',
  185. 'exchange_oauth',
  186. 'exchange_integration',
  187. 'idoit_integration',
  188. 'gitlab_integration',
  189. 'github_integration',
  190. '0100_trigger',
  191. '0100_notification',
  192. '1000_signature_detection',
  193. '6000_slack_webhook',
  194. 'slack_integration',
  195. 'sipgate_integration',
  196. 'sipgate_alternative_fqdn',
  197. 'cti_integration',
  198. 'cti_customer_last_activity',
  199. 'placetel_integration',
  200. 'clearbit_integration',
  201. '9000_clearbit_enrichment',
  202. '9100_cti_caller_id_detection',
  203. '9200_time_based_trigger',
  204. 'system_agent_limit',
  205. 'html_email_css_font',
  206. 'html_sanitizer_processing_timeout',
  207. 'Stats::TicketWaitingTime',
  208. 'Stats::TicketEscalation',
  209. 'Stats::TicketChannelDistribution',
  210. 'Stats::TicketLoadMeasure',
  211. 'Stats::TicketInProcess',
  212. 'Stats::TicketReopen',
  213. 'ui_ticket_add_article_hint',
  214. 'smime_integration',
  215. 'pgp_integration',
  216. 'datepicker_show_calendar_weeks',
  217. 'two_factor_authentication_method_security_keys',
  218. 'two_factor_authentication_method_authenticator_app',
  219. 'two_factor_authentication_enforce_role_ids',
  220. 'ticket_organization_reassignment',
  221. ]
  222. end
  223. it 'does not return confidential settings' do
  224. # This test will always fail if you add new settings.
  225. # If your setting does not contain confidential values, just add it to the non_confidential_settings variable list in the top.
  226. # If your setting DOES contain confidential values, then edit the settings plugin of the system report to exclude it.
  227. settings = described_class.fetch[:system_report]['Setting'].pluck(:name)
  228. expect((settings - non_confidential_settings)).to eq([])
  229. end
  230. end
  231. end
  232. end