From 9f46baf52dbdd5454122b19440bb71ee423a2c3e Mon Sep 17 00:00:00 2001 From: Hugo Peixoto Date: Sat, 16 Jul 2022 16:17:04 +0100 Subject: [PATCH] Add example env and production initialization --- config/environments/production.rb | 18 ++++++++++++++++++ env.example | 14 ++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 env.example diff --git a/config/environments/production.rb b/config/environments/production.rb index a2885ed..af267b8 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -57,6 +57,24 @@ Rails.application.configure do # Set this to true and configure the email server for immediate delivery to raise delivery errors. # config.action_mailer.raise_delivery_errors = false + config.action_mailer.smtp_settings = { + address: ENV['SMTP_ADDRESS'], + port: 587, + domain: ENV['SMTP_DOMAIN'], + user_name: ENV['SMTP_USERNAME'], + password: ENV['SMTP_PASSWORD'], + authentication: 'plain', + enable_starttls_auto: true, + } + + config.action_mailer.default_url_options = { + host: ENV['BASE_HOST'], + } + + config.action_mailer.default_url_options = { + host: ENV['BASE_HOST'], + } + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation cannot be found). config.i18n.fallbacks = true diff --git a/env.example b/env.example new file mode 100644 index 0000000..0854696 --- /dev/null +++ b/env.example @@ -0,0 +1,14 @@ +DATABASE_URL=postgres://username:password@example.org/dbname +SMTP_ADDRESS=smtp.example.org +SMTP_DOMAIN=example.org +SMTP_USERNAME=username +SMTP_PASSWORD=password +SMTP_FROM_ADDRESS=example@example.org +SMTP_FROM_NAME=Example Name + +IFTHENPAY_KEY=XXXX-XXXXXX +IFTHENPAY_ACCOUNTS=MBWAY|XXX-XXXXXX;XXXXX|XXX + +BASE_HOST=example.org +RAILS_LOG_TO_STDOUT=true +RAILS_ENV=production