Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 20 additions & 15 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "active_support/core_ext/integer/time"
require 'active_support/core_ext/integer/time'

Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
Expand All @@ -15,8 +15,13 @@
# Turn on fragment caching in view templates.
config.action_controller.perform_caching = true

# Ignore Accept header for format negotiation.
# Prevents UnknownFormat errors from crawlers/scripts sending non-HTML Accept headers.
# See: https://github.com/rails/rails/commit/2f4aaed7b3feb3be787a316fab3144c06bb21a27
config.action_dispatch.ignore_accept_header = true

# Cache assets for far-future expiry since they are all digest stamped.
config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" }
config.public_file_server.headers = { 'cache-control' => "public, max-age=#{1.year.to_i}" }

config.assets.js_compressor = :terser

Expand All @@ -39,14 +44,14 @@
# config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }

# Log to STDOUT with the current request id as a default log tag.
config.log_tags = [ :request_id ]
config.log_tags = [:request_id]
config.logger = ActiveSupport::TaggedLogging.logger(STDOUT)

# Change to "debug" to log everything (including potentially personally-identifiable information!).
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
config.log_level = ENV.fetch('RAILS_LOG_LEVEL', 'info')

# Prevent health checks from clogging up the logs.
config.silence_healthcheck_path = "/up"
config.silence_healthcheck_path = '/up'

# Don't log any deprecations.
config.active_support.report_deprecations = false
Expand All @@ -70,15 +75,15 @@

# Specify outgoing SMTP server. Remember to add smtp/* credentials via rails credentials:edit.
config.action_mailer.smtp_settings = {
port: '587',
address: 'smtp.sendgrid.net',
user_name: ENV['SENDGRID_USERNAME'],
password: ENV['SENDGRID_PASSWORD'],
domain: 'heroku.com',
authentication: :plain,
enable_starttls_auto: true
}
ActionMailer::Base.delivery_method = :smtp
port: '587',
address: 'smtp.sendgrid.net',
user_name: ENV['SENDGRID_USERNAME'],
password: ENV['SENDGRID_PASSWORD'],
domain: 'heroku.com',
authentication: :plain,
enable_starttls_auto: true
}
ActionMailer::Base.delivery_method = :smtp

# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
Expand All @@ -88,7 +93,7 @@
config.active_record.dump_schema_after_migration = false

# Only use :id for inspections in production.
config.active_record.attributes_for_inspect = [ :id ]
config.active_record.attributes_for_inspect = [:id]

# Enable DNS rebinding protection and other `Host` header attacks.
# config.hosts = [
Expand Down