|
| 1 | +Rails.application.configure do |
| 2 | + # Settings specified here will take precedence over those in config/application.rb. |
| 3 | + |
| 4 | + # Code is not reloaded between requests. |
| 5 | + config.cache_classes = true |
| 6 | + |
| 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 | + |
| 13 | + # Full error reports are disabled and caching is turned on. |
| 14 | + config.consider_all_requests_local = false |
| 15 | + config.action_controller.perform_caching = true |
| 16 | + |
| 17 | + # Attempt to read encrypted secrets from `config/secrets.yml.enc`. |
| 18 | + # Requires an encryption key in `ENV["RAILS_MASTER_KEY"]` or |
| 19 | + # `config/secrets.yml.key`. |
| 20 | + config.read_encrypted_secrets = true |
| 21 | + |
| 22 | + # Disable serving static files from the `/public` folder by default since |
| 23 | + # Apache or NGINX already handles this. |
| 24 | + config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? |
| 25 | + |
| 26 | + # Debug mode disables concatenation and preprocessing of assets. |
| 27 | + # This option may cause significant delays in view rendering with a large |
| 28 | + # number of complex assets. |
| 29 | + config.assets.debug = true |
| 30 | + |
| 31 | + # Suppress logger output for asset requests. |
| 32 | + #config.assets.quiet = true |
| 33 | + |
| 34 | + # Compress JavaScripts and CSS. |
| 35 | + config.assets.js_compressor = Sprockets::UglifierCompressor.new(comments: :copyright) |
| 36 | + # config.assets.css_compressor = :sass |
| 37 | + |
| 38 | + # Do not fallback to assets pipeline if a precompiled asset is missed. |
| 39 | + config.assets.compile = false |
| 40 | + |
| 41 | + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb |
| 42 | + |
| 43 | + # Enable serving of images, stylesheets, and JavaScripts from an asset server. |
| 44 | + # config.action_controller.asset_host = 'http://assets.example.com' |
| 45 | + |
| 46 | + # Specifies the header that your server uses for sending files. |
| 47 | + # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache |
| 48 | + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX |
| 49 | + |
| 50 | + # Mount Action Cable outside main process or domain |
| 51 | + # config.action_cable.mount_path = nil |
| 52 | + # config.action_cable.url = 'wss://example.com/cable' |
| 53 | + # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] |
| 54 | + |
| 55 | + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. |
| 56 | + config.force_ssl = true |
| 57 | + |
| 58 | + # Use the lowest log level to ensure availability of diagnostic information |
| 59 | + # when problems arise. |
| 60 | + config.log_level = :debug |
| 61 | + |
| 62 | + # Prepend all log lines with the following tags. |
| 63 | + config.log_tags = [ :request_id ] |
| 64 | + |
| 65 | + # Use a different cache store in production. |
| 66 | + # config.cache_store = :mem_cache_store |
| 67 | + # config.cache_store = :memory_store |
| 68 | + |
| 69 | + # Use a real queuing backend for Active Job (and separate queues per environment) |
| 70 | + # config.active_job.queue_adapter = :resque |
| 71 | + # config.active_job.queue_name_prefix = "coderdojo_jp_#{Rails.env}" |
| 72 | + config.action_mailer.perform_caching = false |
| 73 | + |
| 74 | + # Ignore bad email addresses and do not raise email delivery errors. |
| 75 | + # Set this to true and configure the email server for immediate delivery to raise delivery errors. |
| 76 | + # config.action_mailer.raise_delivery_errors = false |
| 77 | + |
| 78 | + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to |
| 79 | + # the I18n.default_locale when a translation cannot be found). |
| 80 | + config.i18n.fallbacks = true |
| 81 | + |
| 82 | + # Send deprecation notices to registered listeners. |
| 83 | + config.active_support.deprecation = :notify |
| 84 | + |
| 85 | + # Use default logging formatter so that PID and timestamp are not suppressed. |
| 86 | + config.log_formatter = ::Logger::Formatter.new |
| 87 | + |
| 88 | + # Use a different logger for distributed setups. |
| 89 | + # require 'syslog/logger' |
| 90 | + # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') |
| 91 | + |
| 92 | + if ENV["RAILS_LOG_TO_STDOUT"].present? |
| 93 | + logger = ActiveSupport::Logger.new(STDOUT) |
| 94 | + logger.formatter = config.log_formatter |
| 95 | + config.logger = ActiveSupport::TaggedLogging.new(logger) |
| 96 | + end |
| 97 | + |
| 98 | + # Do not dump schema after migrations. |
| 99 | + config.active_record.dump_schema_after_migration = false |
| 100 | + |
| 101 | + # Redirect if not in correct domains |
| 102 | + config.middleware.use Rack::HostRedirect, { |
| 103 | + %w(coderdojo-japan.herokuapp.com www.coderdojo.jp) => 'coderdojo.jp' |
| 104 | + } |
| 105 | +end |
0 commit comments