Mercurial > zeropaste
comparison config/environments/production.rb @ 431:68eb23b52864
Rails 5 \o/
| author | nanaya <me@myconan.net> |
|---|---|
| date | Fri, 13 May 2016 03:56:07 +0900 |
| parents | 9e860754b5d6 |
| children | d31fe32da7a0 |
comparison
equal
deleted
inserted
replaced
| 430:6257da6e1aa1 | 431:68eb23b52864 |
|---|---|
| 1 Zeropaste::Application.configure do | 1 Rails.application.configure do |
| 2 # Settings specified here will take precedence over those in config/application.rb. | 2 # Settings specified here will take precedence over those in config/application.rb. |
| 3 | 3 |
| 4 # Code is not reloaded between requests. | 4 # Code is not reloaded between requests. |
| 5 config.cache_classes = true | 5 config.cache_classes = true |
| 6 | 6 |
| 7 # Eager load code on boot. This eager loads most of Rails and | 7 # Eager load code on boot. This eager loads most of Rails and |
| 8 # your application in memory, allowing both thread web servers | 8 # your application in memory, allowing both threaded web servers |
| 9 # and those relying on copy on write to perform better. | 9 # and those relying on copy on write to perform better. |
| 10 # Rake tasks automatically ignore this option for performance. | 10 # Rake tasks automatically ignore this option for performance. |
| 11 config.eager_load = true | 11 config.eager_load = true |
| 12 | 12 |
| 13 # Full error reports are disabled and caching is turned on. | 13 # Full error reports are disabled and caching is turned on. |
| 14 config.consider_all_requests_local = false | 14 config.consider_all_requests_local = false |
| 15 config.action_controller.perform_caching = true | 15 config.action_controller.perform_caching = true |
| 16 | 16 |
| 17 # Enable Rack::Cache to put a simple HTTP cache in front of your application | 17 # Disable serving static files from the `/public` folder by default since |
| 18 # Add `rack-cache` to your Gemfile before enabling this. | 18 # Apache or NGINX already handles this. |
| 19 # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid. | 19 config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? |
| 20 # config.action_dispatch.rack_cache = true | |
| 21 | |
| 22 # Disable Rails's static asset server (Apache or nginx will already do this). | |
| 23 config.serve_static_files = false | |
| 24 | 20 |
| 25 # Compress JavaScripts and CSS. | 21 # Compress JavaScripts and CSS. |
| 26 config.assets.js_compressor = :uglifier | 22 config.assets.js_compressor = :uglifier |
| 27 # config.assets.css_compressor = :sass | 23 # config.assets.css_compressor = :sass |
| 28 | 24 |
| 29 # Do not fallback to assets pipeline if a precompiled asset is missed. | 25 # Do not fallback to assets pipeline if a precompiled asset is missed. |
| 30 config.assets.compile = false | 26 config.assets.compile = false |
| 31 | 27 |
| 32 # Generate digests for assets URLs. | 28 # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb |
| 33 config.assets.digest = true | |
| 34 | 29 |
| 35 # Version of your assets, change this if you want to expire all your assets. | 30 # Enable serving of images, stylesheets, and JavaScripts from an asset server. |
| 36 config.assets.version = "1.0" | 31 # config.action_controller.asset_host = 'http://assets.example.com' |
| 37 | 32 |
| 38 # Specifies the header that your server uses for sending files. | 33 # Specifies the header that your server uses for sending files. |
| 39 # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache | 34 # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache |
| 40 # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx | 35 # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX |
| 36 | |
| 37 # Action Cable endpoint configuration | |
| 38 # config.action_cable.url = 'wss://example.com/cable' | |
| 39 # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] | |
| 40 | |
| 41 # Don't mount Action Cable in the main server process. | |
| 42 # config.action_cable.mount_path = nil | |
| 41 | 43 |
| 42 # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. | 44 # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. |
| 43 # config.force_ssl = true | 45 # config.force_ssl = true |
| 44 | 46 |
| 45 # # Default logging formatter to keep PID and timestamp | 47 # Use the lowest log level to ensure availability of diagnostic information |
| 46 config.log_formatter = Logger::Formatter.new | 48 # when problems arise. |
| 47 | 49 config.log_level = :debug |
| 48 # Set to :debug to see everything in the log. | |
| 49 config.log_level = :warn | |
| 50 config.logger = Logger.new(STDOUT) | |
| 51 | |
| 52 # Recommended by http://help.papertrailapp.com/kb/configuration/unicorn | |
| 53 config.logger.level = Logger.const_get("WARN") | |
| 54 | 50 |
| 55 # Prepend all log lines with the following tags. | 51 # Prepend all log lines with the following tags. |
| 56 # config.log_tags = [ :subdomain, :uuid ] | 52 config.log_tags = [:request_id] |
| 57 | |
| 58 # Use a different logger for distributed setups. | |
| 59 # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) | |
| 60 | 53 |
| 61 # Use a different cache store in production. | 54 # Use a different cache store in production. |
| 62 # config.cache_store = :memory_store | 55 # config.cache_store = :mem_cache_store |
| 63 | 56 |
| 64 # Enable serving of images, stylesheets, and JavaScripts from an asset server. | 57 # Use a real queuing backend for Active Job (and separate queues per environment) |
| 65 # config.action_controller.asset_host = "http://assets.example.com" | 58 # config.active_job.queue_adapter = :resque |
| 66 | 59 # config.active_job.queue_name_prefix = "zeropaste_#{Rails.env}" |
| 67 # Precompile additional assets. | 60 # config.action_mailer.perform_caching = false |
| 68 # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. | |
| 69 # config.assets.precompile += %w( search.js ) | |
| 70 | 61 |
| 71 # Ignore bad email addresses and do not raise email delivery errors. | 62 # Ignore bad email addresses and do not raise email delivery errors. |
| 72 # Set this to true and configure the email server for immediate delivery to raise delivery errors. | 63 # Set this to true and configure the email server for immediate delivery to raise delivery errors. |
| 73 # config.action_mailer.raise_delivery_errors = false | 64 # config.action_mailer.raise_delivery_errors = false |
| 74 | 65 |
| 75 # Enable locale fallbacks for I18n (makes lookups for any locale fall back to | 66 # Enable locale fallbacks for I18n (makes lookups for any locale fall back to |
| 76 # the I18n.default_locale when a translation can not be found). | 67 # the I18n.default_locale when a translation cannot be found). |
| 77 config.i18n.fallbacks = true | 68 config.i18n.fallbacks = true |
| 78 | 69 |
| 79 # Send deprecation notices to registered listeners. | 70 # Send deprecation notices to registered listeners. |
| 80 config.active_support.deprecation = :notify | 71 config.active_support.deprecation = :notify |
| 81 | 72 |
| 82 # Disable automatic flushing of the log to improve performance. | |
| 83 # config.autoflush_log = false | |
| 84 | |
| 85 # Use default logging formatter so that PID and timestamp are not suppressed. | 73 # Use default logging formatter so that PID and timestamp are not suppressed. |
| 86 config.log_formatter = ::Logger::Formatter.new | 74 config.log_formatter = ::Logger::Formatter.new |
| 75 | |
| 76 # Use a different logger for distributed setups. | |
| 77 # require 'syslog/logger' | |
| 78 # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') | |
| 79 | |
| 80 if CONFIG["log_to_stdout"] | |
| 81 logger = ActiveSupport::Logger.new(STDOUT) | |
| 82 logger.formatter = config.log_formatter | |
| 83 config.logger = ActiveSupport::TaggedLogging.new(logger) | |
| 84 end | |
| 85 | |
| 86 # Do not dump schema after migrations. | |
| 87 config.active_record.dump_schema_after_migration = false | |
| 87 end | 88 end |
