From d13669716ab0c31ce9039ae9f7f073e33a4dc40f Mon Sep 17 00:00:00 2001 From: Toon Claes Date: Tue, 19 Sep 2017 09:44:58 +0200 Subject: Create idea of read-only database In GitLab EE, a GitLab instance can be read-only (e.g. when it's a Geo secondary node). But in GitLab CE it also might be useful to have the "read-only" idea around. So port it back to GitLab CE. Also having the principle of read-only in GitLab CE would hopefully lead to less errors introduced, doing write operations when there aren't allowed for read-only calls. Closes gitlab-org/gitlab-ce#37534. --- config/application.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config/application.rb') diff --git a/config/application.rb b/config/application.rb index ca2ab83becc..31e91835b9e 100644 --- a/config/application.rb +++ b/config/application.rb @@ -154,6 +154,9 @@ module Gitlab ENV['GITLAB_PATH_OUTSIDE_HOOK'] = ENV['PATH'] ENV['GIT_TERMINAL_PROMPT'] = '0' + # Gitlab Read-only middleware support + config.middleware.insert_after ActionDispatch::Flash, 'Gitlab::Middleware::ReadOnly' + config.generators do |g| g.factory_girl false end -- cgit v1.2.3