123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- require_relative 'boot'
- require 'rails/all'
- require_relative 'issue_2656_workaround_for_rails_issue_33600'
- if ENV['ENABLE_EXPERIMENTAL_MOBILE_FRONTEND'] != 'true'
- ENV['VITE_RUBY_SKIP_ASSETS_PRECOMPILE_EXTENSION'] = 'true'
- end
- Bundler.setup
- Bundler.require(*Rails.groups)
- EmailAddressValidator = EmailAddress
- Object.send(:remove_const, :EmailAddress)
- if ArgvHelper.argv.any? { |e| e.start_with? 'assets:' } || Rails.groups.exclude?('production')
- Bundler.load.current_dependencies.select do |dep|
- require dep.name if dep.groups.include?(:assets)
- end
- end
- module Zammad
- class Application < Rails::Application
-
- config.load_defaults 6.1
- Rails.autoloaders.each do |autoloader|
- autoloader.ignore "#{config.root}/app/frontend"
- autoloader.do_not_eager_load "#{config.root}/lib/core_ext"
- autoloader.collapse "#{config.root}/lib/omniauth"
- autoloader.collapse "#{config.root}/lib/generators"
- autoloader.inflector.inflect(
- 'github_database' => 'GithubDatabase',
- 'otrs' => 'OTRS',
- 'db' => 'DB',
- )
- end
-
-
-
-
-
- config.add_autoload_paths_to_load_path = false
- config.autoload_paths += %W[#{config.root}/lib]
-
-
- config.eager_load_paths += %W[#{config.root}/lib] if ArgvHelper.argv[0].eql? 'zeitwerk:check'
- config.active_job.queue_adapter = :delayed_job
- config.active_record.use_yaml_unsafe_load = true
-
- config.log_formatter = ::Logger::Formatter.new
-
- config.api_path = '/api/v1'
-
- if ENV['MEMCACHE_SERVERS'].present?
- require 'dalli'
- config.cache_store = [:mem_cache_store, ENV['MEMCACHE_SERVERS'], { expires_in: 7.days }]
- else
- config.cache_store = [:zammad_file_store, Rails.root.join('tmp', "cache_file_store_#{Rails.env}"), { expires_in: 7.days }]
- end
-
-
-
- config.websocket_session_store = ENV['REDIS_URL'].present? && ENV['ZAMMAD_WEBSOCKET_SESSION_STORE_FORCE_FS_BACKEND'].blank? ? :redis : :file
-
- config.preferences_default_by_permission = {
- 'ticket.agent' => {
- notification_config: {
- matrix: {
- create: {
- criteria: {
- owned_by_me: true,
- owned_by_nobody: true,
- subscribed: true,
- no: false,
- },
- channel: {
- email: true,
- online: true,
- }
- },
- update: {
- criteria: {
- owned_by_me: true,
- owned_by_nobody: true,
- subscribed: true,
- no: false,
- },
- channel: {
- email: true,
- online: true,
- }
- },
- reminder_reached: {
- criteria: {
- owned_by_me: true,
- owned_by_nobody: false,
- subscribed: false,
- no: false,
- },
- channel: {
- email: true,
- online: true,
- }
- },
- escalation: {
- criteria: {
- owned_by_me: true,
- owned_by_nobody: false,
- subscribed: false,
- no: false,
- },
- channel: {
- email: true,
- online: true,
- }
- }
- }
- }
- }
- }
- end
- end
|