20211118081558_maintenance_improve_sipgate_integration_handling.rb 816 B

1234567891011121314151617181920212223242526272829
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class MaintenanceImproveSipgateIntegrationHandling < ActiveRecord::Migration[6.0]
  3. def change
  4. return if !Setting.exists?(name: 'system_init_done')
  5. Setting.create_if_not_exists(
  6. title: 'sipgate.io Token',
  7. name: 'sipgate_token',
  8. area: 'Integration::Sipgate',
  9. description: 'Token for Sipgate.',
  10. options: {
  11. form: [
  12. {
  13. display: '',
  14. null: false,
  15. name: 'sipgate_token',
  16. tag: 'input',
  17. },
  18. ],
  19. },
  20. state: ENV['SIPGATE_TOKEN'] || SecureRandom.urlsafe_base64(20),
  21. preferences: {
  22. permission: ['admin.integration'],
  23. },
  24. frontend: false
  25. )
  26. end
  27. end