summaryrefslogtreecommitdiff
path: root/config/environments
diff options
context:
space:
mode:
authorblackst0ne <blackst0ne.ru@gmail.com>2018-03-22 09:37:57 +1100
committerblackst0ne <blackst0ne.ru@gmail.com>2018-03-22 09:37:57 +1100
commit36bedfb7f37931a33d9af586296404c02c3ab80e (patch)
tree9ca6e11053aea141c50030cb6e1de04c24b3432f /config/environments
parent5ae91f323d054341c0d012de85835ef40f1bf9f8 (diff)
downloadgitlab-ce-36bedfb7f37931a33d9af586296404c02c3ab80e.tar.gz
[Rails5] Update files by `rails app:update`blackst0ne-rails5-update-files-by-rails-app-update
Diffstat (limited to 'config/environments')
-rw-r--r--config/environments/production.rb6
-rw-r--r--config/environments/test.rb8
2 files changed, 12 insertions, 2 deletions
diff --git a/config/environments/production.rb b/config/environments/production.rb
index c5cbfcf64cf..9941987929c 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -9,7 +9,11 @@ Rails.application.configure do
config.action_controller.perform_caching = true
# Disable Rails's static asset server (Apache or nginx will already do this)
- config.serve_static_files = false
+ if Gitlab.rails5?
+ config.public_file_server.enabled = false
+ else
+ config.serve_static_files = false
+ end
# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
diff --git a/config/environments/test.rb b/config/environments/test.rb
index d09e51e766a..1849c984351 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -18,7 +18,13 @@ Rails.application.configure do
# Configure static asset server for tests with Cache-Control for performance
config.assets.compile = false if ENV['CI']
- config.serve_static_files = true
+
+ if Gitlab.rails5?
+ config.public_file_server.enabled = true
+ else
+ config.serve_static_files = true
+ end
+
config.static_cache_control = "public, max-age=3600"
# Show full error reports and disable caching