mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
Raise an error in production env if host_names is using production.localhost
This commit is contained in:
parent
9c0b4572a3
commit
3fdc59b1d9
1 changed files with 15 additions and 0 deletions
15
config/initializers/verify_config.rb
Normal file
15
config/initializers/verify_config.rb
Normal file
|
@ -0,0 +1,15 @@
|
|||
# Check that the app is configured correctly. Raise some helpful errors if something is wrong.
|
||||
|
||||
if Rails.env.production? and ['localhost', 'production.localhost'].include?(Discourse.current_hostname)
|
||||
puts <<END
|
||||
|
||||
Discourse.current_hostname = '#{Discourse.current_hostname}'
|
||||
|
||||
Please update the host_names property in config/database.yml
|
||||
so that it uses the hostname of your site. Otherwise you will
|
||||
experience problems, like links in emails using #{Discourse.current_hostname}.
|
||||
|
||||
END
|
||||
|
||||
raise "Invalid host_names in database.yml"
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue