Skip to content
GitLab
Next
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 55.3k
    • Issues 55.3k
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1.6k
    • Merge requests 1.6k
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Terraform modules
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #18165
Closed
Open
Issue created May 17, 2017 by Chris@MrChrisW☯Contributor

Disable "explore" and "help"

Description

Some organizations prefer to have all GitLab related data private, currently on the sign-in page we offer two links that can be accessed by non-authenticated users.

  • /help
  • /explore

There's also /public and /explore/groups.

Proposal

  • When the Public option is set as a restricted visibility setting in /admin/application_settings, require authentication for /explore, /help, and /public for non-authenticated users.
  • When selected:
    • Redirect unauthenticated users to the sign in page.
    • Remove the Explore link from the sign in page.
    • Redirect an unauthenticated user attempting to access /help to https://docs.gitlab.com/.

Links / references

  • https://gitlab.com/gitlab-org/gitlab-ce/issues/12658 (discussed)
  • https://gitlab.zendesk.com/agent/tickets/76430

Workaround - taken from https://gitlab.com/gitlab-org/gitlab-ce/issues/12658#note_4346566

Only applies to explore

diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 99a45e5..7a08f0c 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -13,6 +13,7 @@ class ApplicationController < ActionController::Base
   before_action :authenticate_user_from_private_token!
   before_action :authenticate_user!
   before_action :validate_user_service_ticket!
+  before_action :force_authenticated_user!
   before_action :check_password_expiration
   before_action :ldap_security_check
   before_action :sentry_context
@@ -87,6 +88,12 @@ class ApplicationController < ActionController::Base
     logger.error "\n#{exception.class.name} (#{exception.message}):\n#{application_trace.join}"
   end

+  def force_authenticated_user!(*args)
+    if (!current_user) and (["/users/sign_in", "/users/password/new", "/users/password", "/users/password/edit"].exclude?(request.path))
+        redirect_to new_user_session_path and return
+    end
+  end
+
   def after_sign_in_path_for(resource)
     stored_location_for(:redirect) || stored_location_for(resource) || root_path
   end
Edited Dec 02, 2019 by Jeremy Watson (ex-GitLab)
Assignee
Assign to
Time tracking