123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- def env_trusted_proxies
- return nil if ENV['RAILS_TRUSTED_PROXIES'].blank?
- if ENV['RAILS_TRUSTED_PROXIES'].strip.start_with?('[')
-
-
- eval(ENV['RAILS_TRUSTED_PROXIES'])
- else
-
- ENV['RAILS_TRUSTED_PROXIES'].split(',').compact_blank
- end
- end
- Rails.application.configure do
-
-
- config.cache_classes = true
-
-
-
-
- config.eager_load = true
-
- config.consider_all_requests_local = false
- config.action_controller.perform_caching = true
-
-
-
-
-
- config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
-
- config.assets.js_compressor = :terser
-
-
- config.assets.compile = false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- config.log_level = :info
-
- config.log_tags = [ :request_id ]
-
-
-
-
-
- config.action_mailer.perform_caching = false
-
-
-
-
-
- config.i18n.fallbacks = true
-
- config.dependency_loading = true
-
- config.active_support.deprecation = :notify
-
-
-
-
-
- if ENV['RAILS_LOG_TO_STDOUT'].present?
- logger = ActiveSupport::Logger.new($stdout)
- logger.formatter = config.log_formatter
- config.logger = ActiveSupport::TaggedLogging.new(logger)
- end
-
- config.active_record.dump_schema_after_migration = false
-
-
- config.action_dispatch.trusted_proxies = env_trusted_proxies || ['127.0.0.1', '::1']
- end
|