Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2018-07-30 23:05:06 +0300
committerRobert Speicher <robert@gitlab.com>2018-07-30 23:05:06 +0300
commit1adfb156e85c270470fb10792cead9ff31b6687c (patch)
tree05fb3cee1eb9ab9f0b62c166379ae5942e087ba1 /config
parent934f1f69022ab39b62161d26c4d1d485bd66b09f (diff)
parent22d44ae9a699c418aba442cd99eec8f58d5fa006 (diff)
Merge branch 'sh-simplify-liveness-check' into 'master'
Add /-/health basic health check endpoint See merge request gitlab-org/gitlab-ce!20456
Diffstat (limited to 'config')
-rw-r--r--config/application.rb4
-rw-r--r--config/routes.rb1
2 files changed, 5 insertions, 0 deletions
diff --git a/config/application.rb b/config/application.rb
index b9d4f6765e3..a086e860e16 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -154,6 +154,10 @@ module Gitlab
config.action_view.sanitized_allowed_protocols = %w(smb)
+ # This middleware needs to precede ActiveRecord::QueryCache and other middlewares that
+ # connect to the database.
+ config.middleware.insert_after "Rails::Rack::Logger", "Gitlab::Middleware::BasicHealthCheck"
+
config.middleware.insert_after Warden::Manager, Rack::Attack
# Allow access to GitLab API from other domains
diff --git a/config/routes.rb b/config/routes.rb
index e0a9139b1b4..aac3a77c4f1 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -46,6 +46,7 @@ Rails.application.routes.draw do
get 'health_check(/:checks)' => 'health_check#index', as: :health_check
scope path: '-' do
+ # '/-/health' implemented by BasicHealthMiddleware
get 'liveness' => 'health#liveness'
get 'readiness' => 'health#readiness'
post 'storage_check' => 'health#storage_check'