使用htpasswd密码保护GitLab页面 [英] Password protect GitLab pages with htpasswd

查看:110
本文介绍了使用htpasswd密码保护GitLab页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过密码保护使用 GitLab页面发布的网站 ?

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

我尝试将.htpasswd文件添加到/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.

推荐答案

在自托管GitLab实例的情况下,GitLab现在支持页面访问控制:

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

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

当前默认情况下禁用页面访问控制.要启用它,您必须:

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

  1. 在/etc/gitlab/gitlab.rb

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

gitlab_pages['access_control'] = true

重新配置GitLab

Reconfigure GitLab

这篇关于使用htpasswd密码保护GitLab页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆