mirror of
https://github.com/Evolix/chexpire.git
synced 2024-04-28 23:10:49 +02:00
Supports configuration variables per instance in config/chexpire.yml
This commit is contained in:
parent
f2891c2d6a
commit
d9dfb0ee0f
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -25,6 +25,7 @@
|
|||
# Ignore master key for decrypting credentials and more.
|
||||
/config/master.key
|
||||
/config/database.yml
|
||||
/config/chexpire.yml
|
||||
/public/packs
|
||||
/public/packs-test
|
||||
/node_modules
|
||||
|
|
|
@ -14,6 +14,7 @@ addons:
|
|||
|
||||
before_install:
|
||||
- cp config/database.example.yml config/database.yml
|
||||
- cp config/chexpire.test.yml config/chexpire.yml
|
||||
|
||||
install:
|
||||
- bundle install
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class ApplicationMailer < ActionMailer::Base
|
||||
default from: "from@example.com"
|
||||
default from: Rails.configuration.chexpire.fetch("mailer_default_from")
|
||||
layout "mailer"
|
||||
end
|
||||
|
|
|
@ -31,5 +31,7 @@ module Chexpire
|
|||
end
|
||||
|
||||
config.time_zone = "Europe/Paris"
|
||||
|
||||
config.chexpire = config_for(:chexpire)
|
||||
end
|
||||
end
|
||||
|
|
13
config/chexpire.example.yml
Normal file
13
config/chexpire.example.yml
Normal file
|
@ -0,0 +1,13 @@
|
|||
default: &default
|
||||
mailer_default_from: "from@example.org"
|
||||
|
||||
production:
|
||||
<<: *default
|
||||
host: "example.org"
|
||||
|
||||
development:
|
||||
<<: *default
|
||||
host: "chexpire.local"
|
||||
|
||||
# test configuration included in file used by CI services
|
||||
<%= IO.read Rails.root.join("config", "chexpire.test.yml") %>
|
3
config/chexpire.test.yml
Normal file
3
config/chexpire.test.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
test:
|
||||
mailer_default_from: "contact@chexpire.org"
|
||||
host: "localhost"
|
|
@ -37,6 +37,8 @@ Rails.application.configure do
|
|||
|
||||
config.action_mailer.perform_caching = false
|
||||
|
||||
config.action_mailer.default_url_options = { host: config.chexpire.fetch("host"), port: 3000 }
|
||||
|
||||
# Print deprecation notices to the Rails logger.
|
||||
config.active_support.deprecation = :log
|
||||
|
||||
|
|
|
@ -66,6 +66,8 @@ 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.default_url_options = { host: config.chexpire.fetch("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
|
||||
|
|
|
@ -38,6 +38,8 @@ Rails.application.configure do
|
|||
# ActionMailer::Base.deliveries array.
|
||||
config.action_mailer.delivery_method = :test
|
||||
|
||||
config.action_mailer.default_url_options = { host: config.chexpire.fetch("host"), port: 3000 }
|
||||
|
||||
# Print deprecation notices to the stderr.
|
||||
config.active_support.deprecation = :stderr
|
||||
|
||||
|
|
Loading…
Reference in a new issue