关闭 Gitlab 标准登陆界面
使用管理员登陆,依次找到Admin
->Settings
-> General
->Sign-in restrictions
去掉勾选允许 Web 界面的密码身份验证
重新打开 Gitlab 标准登陆界面
启动Rails console
会话
# For Omnibus installations
sudo gitlab-rails console
# For Docker installations
docker exec -it <container-id> gitlab-rails console
通过Rails console
重新打开 Gitlab 标准登陆界面
root@shawn-virtual-machine:~# docker exec -it gitlab gitlab-rails console
--------------------------------------------------------------------------------
Ruby: ruby 3.0.6p216 (2023-03-30 revision 23a532679b) [x86_64-linux]
GitLab: 15.11.0 (96ee37680b6) FOSS
GitLab Shell: 14.18.0
PostgreSQL: 13.8
------------------------------------------------------------[ booted in 23.02s ]
Loading production environment (Rails 6.1.7.2)
irb(main):001:0> Gitlab::CurrentSettings.update!(password_authentication_enabled_for_web: true)
=> true
irb(main):002:0>
参考链接:
https://archives.docs.gitlab.com/15.11/ee/user/admin_area/settings/sign_in_restrictions.html
https://archives.docs.gitlab.com/15.11/ee/user/admin_area/settings/sign_in_restrictions.html#re-enable-standard-web-sign-in-form-in-rails-console