2019-05-03 06:17:27 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2013-03-05 05:06:46 +08:00
|
|
|
# Check that the app is configured correctly. Raise some helpful errors if something is wrong.
|
|
|
|
|
2013-03-26 01:33:13 +08:00
|
|
|
if defined?(Rails::Server) && Rails.env.production? # Only run these checks when starting up a production server
|
|
|
|
if %w[localhost production.localhost].include?(Discourse.current_hostname)
|
DEV: Correctly tag heredocs (#16061)
This allows text editors to use correct syntax coloring for the heredoc sections.
Heredoc tag names we use:
languages: SQL, JS, RUBY, LUA, HTML, CSS, SCSS, SH, HBS, XML, YAML/YML, MF, ICS
other: MD, TEXT/TXT, RAW, EMAIL
2022-03-01 03:50:55 +08:00
|
|
|
puts <<~TEXT
|
2013-03-05 05:06:46 +08:00
|
|
|
|
2013-03-26 01:33:13 +08:00
|
|
|
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}.
|
|
|
|
|
DEV: Correctly tag heredocs (#16061)
This allows text editors to use correct syntax coloring for the heredoc sections.
Heredoc tag names we use:
languages: SQL, JS, RUBY, LUA, HTML, CSS, SCSS, SH, HBS, XML, YAML/YML, MF, ICS
other: MD, TEXT/TXT, RAW, EMAIL
2022-03-01 03:50:55 +08:00
|
|
|
TEXT
|
2013-03-26 01:33:13 +08:00
|
|
|
|
|
|
|
raise "Invalid host_names in database.yml"
|
|
|
|
end
|
|
|
|
|
|
|
|
if !Dir.glob(File.join(Rails.root, "public", "assets", "application*.js")).present?
|
DEV: Correctly tag heredocs (#16061)
This allows text editors to use correct syntax coloring for the heredoc sections.
Heredoc tag names we use:
languages: SQL, JS, RUBY, LUA, HTML, CSS, SCSS, SH, HBS, XML, YAML/YML, MF, ICS
other: MD, TEXT/TXT, RAW, EMAIL
2022-03-01 03:50:55 +08:00
|
|
|
puts <<~TEXT
|
2013-03-26 01:33:13 +08:00
|
|
|
|
|
|
|
Assets have not been precompiled. Please run the following command
|
|
|
|
before starting the rails server in production mode:
|
|
|
|
|
|
|
|
rake assets:precompile
|
2013-03-05 05:06:46 +08:00
|
|
|
|
DEV: Correctly tag heredocs (#16061)
This allows text editors to use correct syntax coloring for the heredoc sections.
Heredoc tag names we use:
languages: SQL, JS, RUBY, LUA, HTML, CSS, SCSS, SH, HBS, XML, YAML/YML, MF, ICS
other: MD, TEXT/TXT, RAW, EMAIL
2022-03-01 03:50:55 +08:00
|
|
|
TEXT
|
2013-03-05 05:06:46 +08:00
|
|
|
|
2013-03-26 01:33:13 +08:00
|
|
|
raise "Assets have not been precompiled"
|
|
|
|
end
|
2015-04-25 01:10:43 +08:00
|
|
|
end
|