20170115000001_add_proxy_settings_439.rb 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. class AddProxySettings439 < ActiveRecord::Migration
  2. def up
  3. # return if it's a new setup
  4. return if !Setting.find_by(name: 'system_init_done')
  5. Setting.create_if_not_exists(
  6. title: 'Proxy Settings',
  7. name: 'proxy',
  8. area: 'System::Network',
  9. description: 'Address of the proxy server for http and https resources.',
  10. options: {
  11. form: [
  12. {
  13. display: '',
  14. null: false,
  15. name: 'proxy',
  16. tag: 'input',
  17. placeholder: 'proxy.example.com:3128',
  18. },
  19. ],
  20. },
  21. state: '',
  22. preferences: {
  23. online_service_disable: true,
  24. controller: 'SettingsAreaProxy',
  25. prio: 1,
  26. permission: ['admin.system'],
  27. },
  28. frontend: false
  29. )
  30. Setting.create_if_not_exists(
  31. title: 'Proxy User',
  32. name: 'proxy_username',
  33. area: 'System::Network',
  34. description: 'Username for proxy connection.',
  35. options: {
  36. form: [
  37. {
  38. display: '',
  39. null: false,
  40. name: 'proxy_username',
  41. tag: 'input',
  42. },
  43. ],
  44. },
  45. state: '',
  46. preferences: {
  47. disabled: true,
  48. online_service_disable: true,
  49. prio: 2,
  50. permission: ['admin.system'],
  51. },
  52. frontend: false
  53. )
  54. Setting.create_if_not_exists(
  55. title: 'Proxy Password',
  56. name: 'proxy_password',
  57. area: 'System::Network',
  58. description: 'Password for proxy connection.',
  59. options: {
  60. form: [
  61. {
  62. display: '',
  63. null: false,
  64. name: 'proxy_passowrd',
  65. tag: 'input',
  66. },
  67. ],
  68. },
  69. state: '',
  70. preferences: {
  71. disabled: true,
  72. online_service_disable: true,
  73. prio: 3,
  74. permission: ['admin.system'],
  75. },
  76. frontend: false
  77. )
  78. end
  79. end