Skip to content

Commit 3fdc59b

Browse files
committed
Raise an error in production env if host_names is using production.localhost
1 parent 9c0b457 commit 3fdc59b

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Check that the app is configured correctly. Raise some helpful errors if something is wrong.
2+
3+
if Rails.env.production? and ['localhost', 'production.localhost'].include?(Discourse.current_hostname)
4+
puts <<END
5+
6+
Discourse.current_hostname = '#{Discourse.current_hostname}'
7+
8+
Please update the host_names property in config/database.yml
9+
so that it uses the hostname of your site. Otherwise you will
10+
experience problems, like links in emails using #{Discourse.current_hostname}.
11+
12+
END
13+
14+
raise "Invalid host_names in database.yml"
15+
end

0 commit comments

Comments
 (0)