Farmbot-Web-App/config/environments/production.rb

32 lines
1.4 KiB
Ruby
Raw Normal View History

FarmBot::Application.configure do
2018-10-05 09:58:16 -06:00
config
.action_mailer
2019-05-20 14:14:16 -06:00
.default_url_options = { host: ENV.fetch("API_HOST", "my.farm.bot") }
config.active_support.deprecation = :notify
config.cache_classes = true
2016-11-23 09:40:00 -07:00
config.consider_all_requests_local = false
config.eager_load = true
config.force_ssl = true if ENV["FORCE_SSL"]
config.i18n.fallbacks = true
config.log_formatter = ::Logger::Formatter.new
config.log_level = :info
config.perform_caching = false
config.public_file_server.enabled = false
config.serve_static_assets = true
2016-11-23 09:40:00 -07:00
# HACK AHEAD! Here's why:
# 1. FarmBot Inc. Uses Sendgrid for email.
# 2. FarmBot is an open source project that must be vendor neutral.
2017-06-21 16:37:20 -06:00
# 3. Heroku uses non-neutral ENV names like "SENDGRID_PASSWORD"
2016-11-23 09:40:00 -07:00
# SOLUTION: Support neutral names like "SMTP_HOST",
# but fallback to non-neutral var names like "SENDGRID_USERNAME" if
# required.
pw = ENV['SMTP_PASSWORD'] || ENV['SENDGRID_PASSWORD']
uname = ENV['SMTP_USERNAME'] || ENV['SENDGRID_USERNAME']
2017-02-10 06:58:52 -07:00
config.action_mailer.smtp_settings = { port: ENV.fetch("SMTP_PORT", 587),
2016-11-23 09:40:00 -07:00
address: ENV['SMTP_HOST'],
user_name: uname,
password: pw }
2014-03-12 07:42:11 -06:00
end