You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

application.rb 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. # frozen_string_literal: true
  2. require File.expand_path('../boot', __FILE__)
  3. require 'rails'
  4. # Pick the frameworks you want:
  5. require 'active_model/railtie'
  6. require 'active_job/railtie'
  7. require 'active_record/railtie'
  8. # require 'active_storage/engine'
  9. require 'action_controller/railtie'
  10. require 'action_mailer/railtie'
  11. require 'action_view/railtie'
  12. require 'action_cable/engine'
  13. # require 'sprockets/railtie'
  14. require 'rails/test_unit/railtie'
  15. Bundler.require(*Rails.groups)
  16. module RedmineApp
  17. class Application < Rails::Application
  18. # Settings in config/environments/* take precedence over those specified here.
  19. # Application configuration should go into files in config/initializers
  20. # -- all .rb files in that directory are automatically loaded.
  21. # Adds `lib` to `config.autoload_paths` and `config.eager_load_paths`.
  22. config.autoload_lib(ignore: %w(tasks generators plugins))
  23. # Only load the plugins named here, in the order given (default is alphabetical).
  24. # :all can be used as a placeholder for all plugins not explicitly named.
  25. # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
  26. config.active_support.remove_deprecated_time_with_zone_name = true
  27. config.active_support.cache_format_version = 7.0
  28. config.active_record.store_full_sti_class = true
  29. config.active_record.default_timezone = :local
  30. config.active_record.yaml_column_permitted_classes = [
  31. Date,
  32. Time,
  33. Symbol,
  34. ActiveSupport::HashWithIndifferentAccess,
  35. ActionController::Parameters
  36. ]
  37. config.action_mailer.delivery_job = "ActionMailer::MailDeliveryJob"
  38. # Stop appending "utf8=✓" to form URLs
  39. config.action_view.default_enforce_utf8 = false
  40. # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
  41. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
  42. # config.time_zone = 'Central Time (US & Canada)'
  43. # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
  44. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
  45. # config.i18n.default_locale = :de
  46. config.i18n.enforce_available_locales = true
  47. config.i18n.fallbacks = true
  48. config.i18n.default_locale = 'en'
  49. # Configure the default encoding used in templates for Ruby 1.9.
  50. config.encoding = "utf-8"
  51. # Configure sensitive parameters which will be filtered from the log file.
  52. config.filter_parameters += [:password]
  53. config.action_mailer.perform_deliveries = false
  54. # Do not include all helpers
  55. config.action_controller.include_all_helpers = false
  56. # Add forgery protection
  57. config.action_controller.default_protect_from_forgery = true
  58. # Sets the Content-Length header on responses with fixed-length bodies
  59. config.middleware.insert_before Rack::Sendfile, Rack::ContentLength
  60. # Verify validity of user sessions
  61. config.redmine_verify_sessions = true
  62. # Specific cache for search results, the default file store cache is not
  63. # a good option as it could grow fast. A memory store (32MB max) is used
  64. # as the default. If you're running multiple server processes, it's
  65. # recommended to switch to a shared cache store (eg. mem_cache_store).
  66. # See http://guides.rubyonrails.org/caching_with_rails.html#cache-stores
  67. # for more options (same options as config.cache_store).
  68. config.redmine_search_cache_store = :memory_store
  69. # Sets default plugin directory
  70. config.redmine_plugins_directory = 'plugins'
  71. # Paths for plugin and theme assets. Nothing is set here, as the actual
  72. # configuration is performed in the initializer.
  73. config.assets.redmine_extension_paths = []
  74. # Configure log level here so that additional environment file
  75. # can change it (environments/ENV.rb would take precedence over it)
  76. config.log_level = Rails.env.production? ? :info : :debug
  77. config.session_store(
  78. :cookie_store,
  79. :key => '_redmine_session',
  80. :path => config.relative_url_root || '/',
  81. :same_site => :lax
  82. )
  83. if File.exist?(File.join(File.dirname(__FILE__), 'additional_environment.rb'))
  84. instance_eval File.read(File.join(File.dirname(__FILE__), 'additional_environment.rb'))
  85. end
  86. end
  87. end