5

Is there a way to password protect a website published using GitLab pages?

I tried adding an .htpasswd file to the root of the /pages directory, but that just makes the file available to everyone who goes to https://username.gitlab.io/mysite/.htpasswd.

ostrokach
  • 17,993
  • 11
  • 78
  • 90
  • hi, did u find any solution? – JuHwon Feb 09 '17 at 15:57
  • its not wise to make a .htpasswd file accessible by the web. did you find any solution to password protect the gitlab pages project? – JuHwon Feb 09 '17 at 16:18
  • @JuHwon I couldn't find a solution that didn't involve using AWS or Heroku. But this feature may be added to GitLab EE at some point in the future: https://gitlab.com/gitlab-org/gitlab-ee/issues/624. – ostrokach Feb 09 '17 at 17:10
  • To expand on the Heroku option, you could check out [jekyll-auth](https://github.com/benbalter/jekyll-auth). – ostrokach Feb 09 '17 at 17:26

1 Answers1

3

GitLab now supports access control for pages in case of self managed GitLab instances:

https://docs.gitlab.com/ce/administration/pages/#access-control

Pages access control is currently disabled by default. To enable it, you must:

  1. Enable it in /etc/gitlab/gitlab.rb

    gitlab_pages['access_control'] = true

  2. Reconfigure GitLab

Community
  • 1
  • 1
Kyra
  • 245
  • 1
  • 2
  • 8