Last active
April 12, 2020 11:40
-
-
Save v-thomp4/3682cad7170e6b7b4df4261e82d421ba to your computer and use it in GitHub Desktop.
disable explore gitlab
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /opt/gitlab/embedded/service/gitlab-rails/app/controllers | |
cp application_controller.rb application_controller.rb.orig | |
vim application_controller.rb | |
... | |
before_action :force_authenticated_user! | |
... | |
def force_authenticated_user!(*args) | |
if (!current_user) and (["/explore", "/help"].include?(request.path)) | |
redirect_to new_user_session_path and return | |
end | |
end | |
... | |
gitlab-ctl restart unicorn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment