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.

production.rb 4.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. # frozen_string_literal: true
  2. require 'active_support/core_ext/integer/time'
  3. Rails.application.configure do
  4. # Settings specified here will take precedence over those in config/application.rb.
  5. # Code is not reloaded between requests.
  6. config.enable_reloading = false
  7. # Eager load code on boot. This eager loads most of Rails and
  8. # your application in memory, allowing both threaded web servers
  9. # and those relying on copy on write to perform better.
  10. # Rake tasks automatically ignore this option for performance.
  11. config.eager_load = true
  12. # Full error reports are disabled and caching is turned on.
  13. config.consider_all_requests_local = false
  14. config.action_controller.perform_caching = true
  15. # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
  16. # or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
  17. # config.require_master_key = true
  18. # Disable serving static files from the `/public` folder by default since
  19. # Apache or NGINX already handles this.
  20. # config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
  21. # Enable serving of images, stylesheets, and JavaScripts from an asset server.
  22. # config.asset_host = 'http://assets.example.com'
  23. # Specifies the header that your server uses for sending files.
  24. # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
  25. # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
  26. # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
  27. # config.force_ssl = true
  28. # Prepend all log lines with the following tags.
  29. config.log_tags = [:request_id]
  30. # Use a different cache store in production.
  31. # config.cache_store = :mem_cache_store
  32. # Send deprecation notices to registered listeners.
  33. config.active_support.deprecation = :log
  34. # Log disallowed deprecations.
  35. config.active_support.disallowed_deprecation = :log
  36. # Tell Active Support which deprecation messages to disallow.
  37. config.active_support.disallowed_deprecation_warnings = []
  38. # Use default logging formatter so that PID and timestamp are not suppressed.
  39. config.log_formatter = ::Logger::Formatter.new
  40. # Use a different logger for distributed setups.
  41. # require "syslog/logger"
  42. # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
  43. if ENV["RAILS_LOG_TO_STDOUT"].present?
  44. logger = ActiveSupport::Logger.new(STDOUT)
  45. logger.formatter = config.log_formatter
  46. config.logger = ActiveSupport::TaggedLogging.new(logger)
  47. end
  48. # Do not dump schema after migrations.
  49. # config.active_record.dump_schema_after_migration = false
  50. # Inserts middleware to perform automatic connection switching.
  51. # The `database_selector` hash is used to pass options to the DatabaseSelector
  52. # middleware. The `delay` is used to determine how long to wait after a write
  53. # to send a subsequent read to the primary.
  54. #
  55. # The `database_resolver` class is used by the middleware to determine which
  56. # database is appropriate to use based on the time delay.
  57. #
  58. # The `database_resolver_context` class is used by the middleware to set
  59. # timestamps for the last write to the primary. The resolver uses the context
  60. # class timestamps to determine how long to wait before reading from the
  61. # replica.
  62. #
  63. # By default Rails will store a last write timestamp in the session. The
  64. # DatabaseSelector middleware is designed as such you can define your own
  65. # strategy for connection switching and pass that into the middleware through
  66. # these configuration options.
  67. # config.active_record.database_selector = { delay: 2.seconds }
  68. # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
  69. # config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
  70. # Disable delivery errors
  71. config.action_mailer.raise_delivery_errors = false
  72. # No email in production log
  73. config.action_mailer.logger = nil
  74. config.assets.redmine_detect_update = true
  75. end