20220121101413_setting_updates.rb 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. class SettingUpdates < ActiveRecord::Migration[6.0]
  3. def change
  4. return if !Setting.exists?(name: 'system_init_done')
  5. settings_update = [
  6. {
  7. title: '2 lower case and 2 upper case characters',
  8. name: 'password_min_2_lower_2_upper_characters',
  9. description: 'Password needs to contain 2 lower case and 2 upper case characters.',
  10. },
  11. {
  12. title: 'User email for multiple users',
  13. name: 'user_email_multiple_use',
  14. description: 'Allow using one email address for multiple users.',
  15. },
  16. {
  17. title: 'sipgate.io alternative FQDN',
  18. name: 'sipgate_alternative_fqdn',
  19. description: 'Alternative FQDN for callbacks if you operate Zammad in an internal network.',
  20. },
  21. {
  22. title: 'Auto Assignment',
  23. name: 'ticket_auto_assignment',
  24. },
  25. {
  26. title: 'BCC address for all outgoing emails',
  27. name: 'system_bcc',
  28. description: 'To archive all outgoing emails from Zammad to external, you can store a BCC email address here.',
  29. },
  30. {
  31. title: 'Additional follow-up detection',
  32. name: 'postmaster_follow_up_search_in',
  33. description: 'By default, the follow-up check is done via the subject of an email. This setting lets you add more fields for which the follow-up check will be executed.',
  34. },
  35. {
  36. title: 'Note - default visibility',
  37. name: 'ui_ticket_zoom_article_note_new_internal',
  38. description: 'Defines the default visibility for new notes.',
  39. },
  40. {
  41. title: 'Defines postmaster filter.',
  42. name: '0014_postmaster_filter_own_notification_loop_detection',
  43. description: 'Defines postmaster filter to check if the email is a self-created notification email, then ignore it to prevent email loops.',
  44. },
  45. {
  46. title: 'HTTP type',
  47. name: 'http_type',
  48. description: 'Defines the HTTP protocol of your instance.',
  49. },
  50. {
  51. title: 'Defines the timeframe during which a self-created note can be deleted.',
  52. name: 'ui_ticket_zoom_article_delete_timeframe',
  53. },
  54. {
  55. title: 'Import Endpoint',
  56. name: 'import_freshdesk_endpoint',
  57. description: 'Defines a Freshdesk endpoint to import users, tickets, states, and articles.',
  58. },
  59. {
  60. title: 'Import Endpoint',
  61. name: 'import_kayako_endpoint',
  62. description: 'Defines a Kayako endpoint to import users, tickets, states, and articles.',
  63. },
  64. {
  65. title: 'Import Endpoint',
  66. name: 'import_otrs_endpoint',
  67. description: 'Defines an OTRS endpoint to import users, tickets, states, and articles.',
  68. },
  69. {
  70. title: 'Import Endpoint',
  71. name: 'import_zendesk_endpoint',
  72. description: 'Defines a Zendesk endpoint to import users, tickets, states, and articles.',
  73. },
  74. {
  75. title: 'Stats Backend',
  76. name: 'Stats::TicketWaitingTime',
  77. description: 'Defines a dashboard stats backend that gets scheduled automatically.',
  78. },
  79. {
  80. title: 'Stats Backend',
  81. name: 'Stats::TicketEscalation',
  82. description: 'Defines a dashboard stats backend that gets scheduled automatically.',
  83. },
  84. {
  85. title: 'Stats Backend',
  86. name: 'Stats::TicketChannelDistribution',
  87. description: 'Defines a dashboard stats backend that gets scheduled automatically.',
  88. },
  89. {
  90. title: 'Stats Backend',
  91. name: 'Stats::TicketLoadMeasure',
  92. description: 'Defines a dashboard stats backend that gets scheduled automatically.',
  93. },
  94. {
  95. title: 'Stats Backend',
  96. name: 'Stats::TicketInProcess',
  97. description: 'Defines a dashboard stats backend that gets scheduled automatically.',
  98. },
  99. {
  100. title: 'Stats Backend',
  101. name: 'Stats::TicketReopen',
  102. description: 'Defines a dashboard stats backend that gets scheduled automatically.',
  103. },
  104. {
  105. title: 'Import Password for HTTP basic authentication',
  106. name: 'import_otrs_password',
  107. description: 'Defines HTTP basic authentication password (only if OTRS is protected via HTTP basic auth).',
  108. },
  109. {
  110. title: 'Developer System',
  111. name: 'developer_mode',
  112. description: 'Defines if the application is in developer mode (all users have the same password and password reset will work without email delivery).',
  113. },
  114. {
  115. title: 'Group selection for ticket creation',
  116. name: 'form_ticket_create_group_id',
  117. description: 'Defines the group of tickets created via web form.',
  118. },
  119. {
  120. title: 'Limit tickets by IP per day',
  121. name: 'form_ticket_create_by_ip_per_day',
  122. description: 'Defines a limit for how many tickets can be created via web form from one IP address per day.',
  123. },
  124. {
  125. title: 'Limit tickets by IP per hour',
  126. name: 'form_ticket_create_by_ip_per_hour',
  127. description: 'Defines a limit for how many tickets can be created via web form from one IP address per hour.',
  128. },
  129. {
  130. title: 'Limit tickets per day',
  131. name: 'form_ticket_create_per_day',
  132. description: 'Defines a limit for how many tickets can be created via web form per day.',
  133. },
  134. {
  135. title: 'Defines postmaster filter.',
  136. name: '5400_postmaster_filter_jira_check',
  137. description: 'Defines postmaster filter to identify Jira mails for correct follow-ups.',
  138. },
  139. {
  140. title: 'Defines postmaster filter.',
  141. name: '5401_postmaster_filter_jira_check',
  142. description: 'Defines postmaster filter to identify Jira mails for correct follow-ups.',
  143. },
  144. {
  145. title: 'Defines postmaster filter.',
  146. name: '0950_postmaster_filter_bounce_delivery_permanent_failed',
  147. description: 'Defines postmaster filter to identify postmaster bounces; and disables sending notification if delivery fails permanently.',
  148. },
  149. {
  150. title: 'Defines postmaster filter.',
  151. name: '0955_postmaster_filter_bounce_delivery_temporary_failed',
  152. description: 'Defines postmaster filter to identify postmaster bounces; and reopens tickets if delivery fails permanently.',
  153. },
  154. {
  155. title: 'Defines postmaster filter.',
  156. name: '0900_postmaster_filter_bounce_follow_up_check',
  157. description: 'Defines postmaster filter to identify postmaster bounces; and handles them as follow-up of the original tickets',
  158. },
  159. {
  160. title: 'Defines postmaster filter.',
  161. name: '5400_postmaster_filter_service_now_check',
  162. description: 'Defines postmaster filter to identify ServiceNow mails for correct follow-ups.',
  163. },
  164. {
  165. title: 'Defines postmaster filter.',
  166. name: '5401_postmaster_filter_service_now_check',
  167. description: 'Defines postmaster filter to identify ServiceNow mails for correct follow-ups.',
  168. },
  169. {
  170. title: 'Defines postmaster filter.',
  171. name: '0005_postmaster_filter_trusted',
  172. description: 'Defines postmaster filter to remove X-Zammad headers from untrustworthy sources.',
  173. },
  174. {
  175. title: 'HTML Email CSS Font',
  176. name: 'html_email_css_font',
  177. description: 'Defines the CSS font information for HTML emails.',
  178. },
  179. {
  180. title: 'Geo IP Service',
  181. name: 'geo_ip_backend',
  182. description: 'Defines the backend for geo IP lookups. Also shows location of an IP address if it is traceable.',
  183. },
  184. {
  185. title: 'CTI config',
  186. name: 'cti_config',
  187. description: 'Defines the CTI config.',
  188. },
  189. {
  190. title: 'Set agent limit',
  191. name: 'system_agent_limit',
  192. description: 'Defines the agent limit.',
  193. },
  194. {
  195. title: 'Product Name',
  196. name: 'product_name',
  197. description: 'Defines the name of the application, shown in the web interface, tabs, and title bar of the web browser.',
  198. },
  199. {
  200. title: 'Define postmaster filter.',
  201. name: '5500_postmaster_internal_article_check',
  202. description: 'Defines postmaster filter which sets the articles visibility to internal if it is a rely to an internal article or the last outgoing email is internal.',
  203. },
  204. {
  205. title: 'CTI customer last activity',
  206. name: 'cti_customer_last_activity',
  207. description: 'Defines the duration of customer activity (in seconds) on a call until the user profile dialog is shown.',
  208. },
  209. {
  210. title: 'Slack config',
  211. name: 'slack_config',
  212. description: 'Defines the Slack config.',
  213. },
  214. {
  215. title: 'Auto-close state',
  216. name: 'icinga_auto_close_state_id',
  217. description: 'Defines the state of auto-closed tickets.',
  218. },
  219. {
  220. title: 'Auto-close state',
  221. name: 'nagios_auto_close_state_id',
  222. description: 'Defines the state of auto-closed tickets.',
  223. },
  224. {
  225. title: 'Auto-close state',
  226. name: 'check_mk_auto_close_state_id',
  227. description: 'Defines the state of auto-closed tickets.',
  228. },
  229. {
  230. title: 'Auto-close state',
  231. name: 'check_mk_auto_close_state_id',
  232. description: 'Defines the state of auto-closed tickets.',
  233. },
  234. {
  235. title: 'Locale',
  236. name: 'locale_default',
  237. description: 'Defines the default system language.',
  238. },
  239. {
  240. title: 'Timezone',
  241. name: 'timezone_default',
  242. description: 'Defines the default system timezone.',
  243. },
  244. {
  245. title: 'Defines transaction backend.',
  246. name: '9100_cti_caller_id_detection',
  247. description: 'Defines the transaction backend which detects caller IDs in objects and stores them for CTI lookups.',
  248. },
  249. {
  250. title: 'User Organization Selector - email',
  251. name: 'ui_user_organization_selector_with_email',
  252. description: 'Defines if the email should be displayed in the result of the user/organization widget.',
  253. },
  254. {
  255. title: 'GitHub App Credentials',
  256. name: 'auth_github_credentials',
  257. description: 'Enables user authentication via GitHub.',
  258. },
  259. {
  260. title: 'Customer selection based on sender and receiver list',
  261. name: 'postmaster_sender_is_agent_search_for_customer',
  262. description: 'If the sender is an agent, set the first user in the recipient list as the customer.',
  263. },
  264. {
  265. title: 'Import API key for requesting the Freshdesk API',
  266. name: 'import_freshdesk_endpoint_key',
  267. description: 'Defines Freshdesk endpoint authentication API key.',
  268. },
  269. {
  270. title: 'Import API key for requesting the Zendesk API',
  271. name: 'import_zendesk_endpoint_key',
  272. description: 'Defines Zendesk endpoint authentication API key.',
  273. },
  274. {
  275. title: 'Knowledge Base active',
  276. name: 'kb_active',
  277. description: 'Defines if Knowledge Base navbar button is enabled.',
  278. },
  279. {
  280. title: 'Knowledge Base active publicly',
  281. name: 'kb_active_publicly',
  282. description: 'Defines if Knowledge Base navbar button is enabled for users without Knowledge Base permission.',
  283. },
  284. {
  285. title: 'Knowledge Base multilingual support',
  286. name: 'kb_multi_lingual_support',
  287. description: 'Support of multilingual Knowledge Base.',
  288. },
  289. {
  290. title: 'Maximum Email Size',
  291. name: 'postmaster_max_size',
  292. description: 'Defines the maximum accepted email size in MB.',
  293. },
  294. {
  295. title: 'Maximum failed logins',
  296. name: 'password_max_login_failed',
  297. description: 'Defines after how many failed logins accounts will be deactivated.',
  298. },
  299. {
  300. title: 'Sender based on Reply-To header',
  301. name: 'postmaster_sender_based_on_reply_to',
  302. description: 'Set/overwrite sender/from of email based on "Reply-To" header. Useful to set correct customer if email is received from a third-party system on behalf of a customer.',
  303. },
  304. {
  305. title: 'Ticket Last Contact Behaviour',
  306. name: 'ticket_last_contact_behaviour',
  307. description: 'Sets the last customer contact based on either the last contact of the customer in general or on the last contact of the customer that has not received a response.',
  308. },
  309. {
  310. title: 'CTI Token',
  311. name: 'cti_token',
  312. description: 'Token for CTI.',
  313. },
  314. {
  315. title: 'CTI integration',
  316. name: 'cti_integration',
  317. description: 'Defines if generic CTI integration is enabled or not.',
  318. },
  319. {
  320. title: 'Placetel Token',
  321. name: 'placetel_token',
  322. description: 'Defines the token for Placetel.',
  323. },
  324. ]
  325. settings_update.each do |setting|
  326. fetched_setting = Setting.find_by(name: setting[:name])
  327. next if !fetched_setting
  328. if setting[:title]
  329. # "Updating title of #{setting[:name]} to #{setting[:title]}"
  330. fetched_setting.title = setting[:title]
  331. end
  332. if setting[:description]
  333. # "Updating description of #{setting[:name]} to #{setting[:description]}"
  334. fetched_setting.description = setting[:description]
  335. end
  336. fetched_setting.save!
  337. end
  338. end
  339. end