Commit e8079dc6d5da736b9a41131bf6ea2df6fb2e776d
1 parent
9f49ab09
Rename colab environment to production
Create a sample_production environment in case we need to use additional configuration for the new production environment.
Showing
3 changed files
with
141 additions
and
141 deletions
Show diff stats
config/environments/colab.rb
| ... | ... | @@ -1,53 +0,0 @@ |
| 1 | -Rails.application.configure do | |
| 2 | - # Settings specified here will take precedence over those in config/application.rb. | |
| 3 | - | |
| 4 | - # In the development environment your application's code is reloaded on | |
| 5 | - # every request. This slows down response time but is perfect for development | |
| 6 | - # since you don't have to restart the web server when you make code changes. | |
| 7 | - config.cache_classes = false | |
| 8 | - | |
| 9 | - # Do not eager load code on boot. | |
| 10 | - config.eager_load = false | |
| 11 | - | |
| 12 | - # Show full error reports and disable caching. | |
| 13 | - config.consider_all_requests_local = true | |
| 14 | - config.action_controller.perform_caching = false | |
| 15 | - | |
| 16 | - # Don't care if the mailer can't send. | |
| 17 | - config.action_mailer.raise_delivery_errors = false | |
| 18 | - | |
| 19 | - # Print deprecation notices to the Rails logger. | |
| 20 | - config.active_support.deprecation = :log | |
| 21 | - | |
| 22 | - # Raise an error on page load if there are pending migrations. | |
| 23 | - config.active_record.migration_error = :page_load | |
| 24 | - | |
| 25 | - # Debug mode disables concatenation and preprocessing of assets. | |
| 26 | - # This option may cause significant delays in view rendering with a large | |
| 27 | - # number of complex assets. | |
| 28 | - config.assets.debug = true | |
| 29 | - | |
| 30 | - # Asset digests allow you to set far-future HTTP expiration dates on all assets, | |
| 31 | - # yet still be able to expire them through the digest params. | |
| 32 | - config.assets.digest = true | |
| 33 | - | |
| 34 | - #Root URL for ActionMailer | |
| 35 | - config.action_mailer.default_url_options = { :host => 'localhost:3000' } | |
| 36 | - | |
| 37 | - # Enables page caching | |
| 38 | - config.action_controller.perform_caching = true | |
| 39 | - | |
| 40 | - # Adds additional error checking when serving assets at runtime. | |
| 41 | - # Checks for improperly declared sprockets dependencies. | |
| 42 | - # Raises helpful error messages. | |
| 43 | - config.assets.raise_runtime_errors = true | |
| 44 | - | |
| 45 | - # Raises error for missing translations | |
| 46 | - # config.action_view.raise_on_missing_translations = true | |
| 47 | - | |
| 48 | - # Kalibro URL | |
| 49 | - KalibroClient.configure_with(Rails.root.join('config', 'kalibro.yml')) | |
| 50 | - | |
| 51 | - # Responds on a subdirectory | |
| 52 | - config.relative_url_root = '/mezuro' | |
| 53 | -end |
config/environments/production.rb
| 1 | 1 | Rails.application.configure do |
| 2 | 2 | # Settings specified here will take precedence over those in config/application.rb. |
| 3 | 3 | |
| 4 | - # Code is not reloaded between requests. | |
| 5 | - config.cache_classes = true | |
| 4 | + # In the development environment your application's code is reloaded on | |
| 5 | + # every request. This slows down response time but is perfect for development | |
| 6 | + # since you don't have to restart the web server when you make code changes. | |
| 7 | + config.cache_classes = false | |
| 6 | 8 | |
| 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 | |
| 9 | + # Do not eager load code on boot. | |
| 10 | + config.eager_load = false | |
| 12 | 11 | |
| 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 | |
| 12 | + # Show full error reports and disable caching. | |
| 13 | + config.consider_all_requests_local = true | |
| 14 | + config.action_controller.perform_caching = false | |
| 16 | 15 | |
| 17 | - # Enable Rack::Cache to put a simple HTTP cache in front of your application | |
| 18 | - # Add `rack-cache` to your Gemfile before enabling this. | |
| 19 | - # For large-scale production use, consider using a caching reverse proxy like | |
| 20 | - # NGINX, varnish or squid. | |
| 16 | + # Don't care if the mailer can't send. | |
| 17 | + config.action_mailer.raise_delivery_errors = false | |
| 21 | 18 | |
| 22 | - # Disable serving static files from the `/public` folder by default since | |
| 23 | - # Apache or NGINX already handles this. | |
| 24 | - config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? | |
| 19 | + # Print deprecation notices to the Rails logger. | |
| 20 | + config.active_support.deprecation = :log | |
| 25 | 21 | |
| 26 | - # Compress JavaScripts and CSS. | |
| 27 | - config.assets.js_compressor = :uglifier | |
| 28 | - # config.assets.css_compressor = :sass | |
| 22 | + # Raise an error on page load if there are pending migrations. | |
| 23 | + config.active_record.migration_error = :page_load | |
| 29 | 24 | |
| 30 | - # Do not fallback to assets pipeline if a precompiled asset is missed. | |
| 31 | - config.assets.compile = false | |
| 25 | + # Debug mode disables concatenation and preprocessing of assets. | |
| 26 | + # This option may cause significant delays in view rendering with a large | |
| 27 | + # number of complex assets. | |
| 28 | + config.assets.debug = true | |
| 32 | 29 | |
| 33 | - # Generate digests for assets URLs. | |
| 30 | + # Asset digests allow you to set far-future HTTP expiration dates on all assets, | |
| 31 | + # yet still be able to expire them through the digest params. | |
| 34 | 32 | config.assets.digest = true |
| 35 | 33 | |
| 36 | - # Version of your assets, change this if you want to expire all your assets. | |
| 37 | - config.assets.version = '1.0' | |
| 38 | - | |
| 39 | - # Specifies the header that your server uses for sending files. | |
| 40 | - # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache | |
| 41 | - config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX | |
| 42 | - | |
| 43 | - # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. | |
| 44 | - # config.force_ssl = true | |
| 45 | - | |
| 46 | - # Use the lowest log level to ensure availability of diagnostic information | |
| 47 | - # when problems arise. | |
| 48 | - config.log_level = :debug | |
| 49 | - | |
| 50 | - # Prepend all log lines with the following tags. | |
| 51 | - # config.log_tags = [ :subdomain, :uuid ] | |
| 52 | - | |
| 53 | - # Use a different logger for distributed setups. | |
| 54 | - # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) | |
| 55 | - | |
| 56 | - # Use a different cache store in production. | |
| 57 | - config.cache_store = :mem_cache_store, "10.2.2.21", {expires_in: 1.day} | |
| 34 | + #Root URL for ActionMailer | |
| 35 | + config.action_mailer.default_url_options = { :host => 'localhost:3000' } | |
| 58 | 36 | |
| 59 | - # Enable serving of images, stylesheets, and JavaScripts from an asset server. | |
| 60 | - # config.action_controller.asset_host = 'http://assets.example.com' | |
| 61 | - | |
| 62 | - # Ignore bad email addresses and do not raise email delivery errors. | |
| 63 | - # Set this to true and configure the email server for immediate delivery to raise delivery errors. | |
| 64 | - # config.action_mailer.raise_delivery_errors = false | |
| 65 | - | |
| 66 | - # Enable locale fallbacks for I18n (makes lookups for any locale fall back to | |
| 67 | - # the I18n.default_locale when a translation cannot be found). | |
| 68 | - config.i18n.fallbacks = true | |
| 69 | - | |
| 70 | - # Send deprecation notices to registered listeners. | |
| 71 | - config.active_support.deprecation = :notify | |
| 72 | - | |
| 73 | - # Use default logging formatter so that PID and timestamp are not suppressed. | |
| 74 | - config.log_formatter = ::Logger::Formatter.new | |
| 37 | + # Enables page caching | |
| 38 | + config.action_controller.perform_caching = true | |
| 75 | 39 | |
| 76 | - # Root URL for ActionMailer | |
| 77 | - config.action_mailer.default_url_options = { :host => 'mezuro.org' } | |
| 40 | + # Adds additional error checking when serving assets at runtime. | |
| 41 | + # Checks for improperly declared sprockets dependencies. | |
| 42 | + # Raises helpful error messages. | |
| 43 | + config.assets.raise_runtime_errors = true | |
| 78 | 44 | |
| 79 | - # Do not dump schema after migrations. | |
| 80 | - config.active_record.dump_schema_after_migration = false | |
| 45 | + # Raises error for missing translations | |
| 46 | + # config.action_view.raise_on_missing_translations = true | |
| 81 | 47 | |
| 82 | 48 | # Kalibro URL |
| 83 | 49 | KalibroClient.configure_with(Rails.root.join('config', 'kalibro.yml')) |
| 84 | 50 | |
| 85 | - # ActionMailer SMTP | |
| 86 | - config.action_mailer.delivery_method = :smtp | |
| 87 | - config.action_mailer.smtp_settings = { | |
| 88 | - address: 'smtp.gmail.com', | |
| 89 | - port: 587, | |
| 90 | - domain: 'mezuro.org', | |
| 91 | - user_name: ENV['SMTP_USERNAME'], # Configure these as a environment vars on the production server | |
| 92 | - password: ENV['SMTP_PASSWORD'], | |
| 93 | - authentication: 'plain', | |
| 94 | - enable_starttls_auto: true } | |
| 95 | - | |
| 96 | - # Exception Notification | |
| 97 | - config.middleware.use ExceptionNotification::Rack, | |
| 98 | - :ignore_crawlers => %w{Googlebot bingbot SeznamBot Baiduspider AhrefsBot TurnitinBot Mail.RU_Bot Slurp DotBot}, | |
| 99 | - :email => { | |
| 100 | - :email_prefix => "[Prezento Error] ", | |
| 101 | - :sender_address => %{"mezurometrics" <mezurometrics@gmail.com>}, | |
| 102 | - :exception_recipients => %w{mezuro-core@lists.ime.usp.br} | |
| 103 | - } | |
| 104 | - | |
| 105 | - # Google Analytics | |
| 106 | - GA.tracker = ENV['GA_TRACKER'] | |
| 107 | - GA.script_source = :doubleclick | |
| 51 | + # Responds on a subdirectory | |
| 52 | + config.relative_url_root = '/mezuro' | |
| 108 | 53 | end | ... | ... |
| ... | ... | @@ -0,0 +1,108 @@ |
| 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 | + # Enable Rack::Cache to put a simple HTTP cache in front of your application | |
| 18 | + # Add `rack-cache` to your Gemfile before enabling this. | |
| 19 | + # For large-scale production use, consider using a caching reverse proxy like | |
| 20 | + # NGINX, varnish or squid. | |
| 21 | + | |
| 22 | + # Disable serving static files from the `/public` folder by default since | |
| 23 | + # Apache or NGINX already handles this. | |
| 24 | + config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? | |
| 25 | + | |
| 26 | + # Compress JavaScripts and CSS. | |
| 27 | + config.assets.js_compressor = :uglifier | |
| 28 | + # config.assets.css_compressor = :sass | |
| 29 | + | |
| 30 | + # Do not fallback to assets pipeline if a precompiled asset is missed. | |
| 31 | + config.assets.compile = false | |
| 32 | + | |
| 33 | + # Generate digests for assets URLs. | |
| 34 | + config.assets.digest = true | |
| 35 | + | |
| 36 | + # Version of your assets, change this if you want to expire all your assets. | |
| 37 | + config.assets.version = '1.0' | |
| 38 | + | |
| 39 | + # Specifies the header that your server uses for sending files. | |
| 40 | + # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache | |
| 41 | + config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX | |
| 42 | + | |
| 43 | + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. | |
| 44 | + # config.force_ssl = true | |
| 45 | + | |
| 46 | + # Use the lowest log level to ensure availability of diagnostic information | |
| 47 | + # when problems arise. | |
| 48 | + config.log_level = :debug | |
| 49 | + | |
| 50 | + # Prepend all log lines with the following tags. | |
| 51 | + # config.log_tags = [ :subdomain, :uuid ] | |
| 52 | + | |
| 53 | + # Use a different logger for distributed setups. | |
| 54 | + # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) | |
| 55 | + | |
| 56 | + # Use a different cache store in production. | |
| 57 | + config.cache_store = :mem_cache_store, "10.2.2.21", {expires_in: 1.day} | |
| 58 | + | |
| 59 | + # Enable serving of images, stylesheets, and JavaScripts from an asset server. | |
| 60 | + # config.action_controller.asset_host = 'http://assets.example.com' | |
| 61 | + | |
| 62 | + # Ignore bad email addresses and do not raise email delivery errors. | |
| 63 | + # Set this to true and configure the email server for immediate delivery to raise delivery errors. | |
| 64 | + # config.action_mailer.raise_delivery_errors = false | |
| 65 | + | |
| 66 | + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to | |
| 67 | + # the I18n.default_locale when a translation cannot be found). | |
| 68 | + config.i18n.fallbacks = true | |
| 69 | + | |
| 70 | + # Send deprecation notices to registered listeners. | |
| 71 | + config.active_support.deprecation = :notify | |
| 72 | + | |
| 73 | + # Use default logging formatter so that PID and timestamp are not suppressed. | |
| 74 | + config.log_formatter = ::Logger::Formatter.new | |
| 75 | + | |
| 76 | + # Root URL for ActionMailer | |
| 77 | + config.action_mailer.default_url_options = { :host => 'mezuro.org' } | |
| 78 | + | |
| 79 | + # Do not dump schema after migrations. | |
| 80 | + config.active_record.dump_schema_after_migration = false | |
| 81 | + | |
| 82 | + # Kalibro URL | |
| 83 | + KalibroClient.configure_with(Rails.root.join('config', 'kalibro.yml')) | |
| 84 | + | |
| 85 | + # ActionMailer SMTP | |
| 86 | + config.action_mailer.delivery_method = :smtp | |
| 87 | + config.action_mailer.smtp_settings = { | |
| 88 | + address: 'smtp.gmail.com', | |
| 89 | + port: 587, | |
| 90 | + domain: 'mezuro.org', | |
| 91 | + user_name: ENV['SMTP_USERNAME'], # Configure these as a environment vars on the production server | |
| 92 | + password: ENV['SMTP_PASSWORD'], | |
| 93 | + authentication: 'plain', | |
| 94 | + enable_starttls_auto: true } | |
| 95 | + | |
| 96 | + # Exception Notification | |
| 97 | + config.middleware.use ExceptionNotification::Rack, | |
| 98 | + :ignore_crawlers => %w{Googlebot bingbot SeznamBot Baiduspider AhrefsBot TurnitinBot Mail.RU_Bot Slurp DotBot}, | |
| 99 | + :email => { | |
| 100 | + :email_prefix => "[Prezento Error] ", | |
| 101 | + :sender_address => %{"mezurometrics" <mezurometrics@gmail.com>}, | |
| 102 | + :exception_recipients => %w{mezuro-core@lists.ime.usp.br} | |
| 103 | + } | |
| 104 | + | |
| 105 | + # Google Analytics | |
| 106 | + GA.tracker = ENV['GA_TRACKER'] | |
| 107 | + GA.script_source = :doubleclick | |
| 108 | +end | ... | ... |