Password protect GitLab pages with htpasswd

纵然是瞬间 提交于 2019-12-13 17:06:31

问题


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.


回答1:


See this answer to a very similar question. (Full disclosure, it was my question and answer).

This gitlab repo shows a working example here.

Uses static password protection and is also discussed in this issue.




回答2:


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



来源:https://stackoverflow.com/questions/41106344/password-protect-gitlab-pages-with-htpasswd

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!