Skip to content

Instantly share code, notes, and snippets.

@v-thomp4
Last active April 12, 2020 11:40
Show Gist options
  • Save v-thomp4/3682cad7170e6b7b4df4261e82d421ba to your computer and use it in GitHub Desktop.
Save v-thomp4/3682cad7170e6b7b4df4261e82d421ba to your computer and use it in GitHub Desktop.
disable explore gitlab
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