gitlab不小心把sign-in取消了怎么恢復


環境和版本

 

[root@linux-node1 etc]# ll /var/cache/yum/x86_64/7/gitlab-ce/packages/
total 292928
-rw-r--r-- 1 root root 299954157 Apr 22  2017 gitlab-ce-9.1.0-ce.0.el7.x86_64.rpm
[root@linux-node1 etc]# cat /etc/redhat-release 
CentOS Linux release 7.1.1503 (Core) 
[root@linux-node1 etc]# 

 

  

問題原因

在配置gitlab的過程中,本來想取消sign-up時,結果看錯了,把sign-in的勾去掉了。導致退出之后無法登錄

顯示如下,不小心把這里的勾去掉了

 

 

再次登錄提示如下
No authentication methods configured.

 

 

嘗試的解決方法

1、前期不斷試圖從配置文件里找出相關的地方,最終沒找到有用的配置

下面地方的配置都找過。尤其是gitlab.rb文件。找不到相關配置的地方

[root@linux-node2 etc]# ll /etc/gitlab/
total 76
-rw------- 1 root root 65421 Apr 23 16:32 gitlab.rb
-rw------- 1 root root  9713 Apr 10 05:17 gitlab-secrets.json
drwxr-xr-x 2 root root     6 Apr 10 05:17 trusted-certs
[root@linux-node2 etc]# ll /opt/gitlab/
total 1944
drwxr-xr-x  2 root root     103 Apr 10 05:16 bin
drwxr-xr-x 18 root root    4096 Apr 10 05:17 embedded
drwxr-xr-x  6 root root    4096 Apr 10 05:18 etc
drwxr-xr-x  2 root root    4096 Apr 10 05:19 init
-rw-r--r--  1 root root 1931990 Apr 22 21:36 LICENSE
drwxr-xr-x  2 root root    4096 Apr 10 05:16 LICENSES
drwxr-xr-x  2 root root    4096 Apr 10 05:19 service
drwxr-xr-x 15 root root    4096 Apr 10 05:19 sv
drwxr-xr-x  3 root root      20 Apr 10 05:18 var
-rw-r--r--  1 root root   19834 Apr 22 21:36 version-manifest.json
-rw-r--r--  1 root root    8769 Apr 22 21:36 version-manifest.txt
[root@linux-node2 etc]# ll /var/opt/gitlab/gitlab-rails/etc
total 44
-rw-r--r-- 1 root root   498 Apr 10 05:17 database.yml
-rw-r--r-- 1 root root   129 Apr 10 05:17 gitlab_shell_secret
-rw-r--r-- 1 root root    45 Apr 10 05:17 gitlab_workhorse_secret
-rw-r--r-- 1 root root 14427 Apr 10 05:17 gitlab.yml
-rw-r--r-- 1 root root  1383 Apr 10 05:17 rack_attack.rb
-rw-r--r-- 1 root root    59 Apr 10 05:17 resque.yml
-rw-r--r-- 1 root root  4092 Apr 10 05:17 secrets.yml
-rw-r--r-- 1 root root  1611 Apr 10 05:18 unicorn.rb
[root@linux-node2 etc]# 

嘗試修改文件/etc/gitlab/gitlab.rb,在最末尾添加如下,也不起作用

gitlab_rails['gitlab_signin_enabled'] = true

  

 

 

2、嘗試卸載gitlab,然后重裝

因為本來就是新裝的測試環境,嘗試卸載gitlab的rpm包,然后刪除/opt/gitlab  和/etc/gitlab  目錄,重裝之后沒效果,應該有還有一些目錄沒刪除干凈

嘗試gitlab-ctl reconfigure 也不起作用

 

 

3、網上搜索

鏈接如下

https://www.libaocai.com/5727.html

解決步驟如下

gitlab-psql gitlabhq_production
UPDATE application_settings set signin_enabled=true;
\q
gitlab-ctl restart

操作過程如下

[root@linux-node1 etc]# gitlab-psql gitlabhq_production
could not change directory to "/var/opt/gitlab/gitlab-rails/etc": Permission denied
psql (9.6.1)
Type "help" for help.

gitlabhq_production=# UPDATE application_settings set signin_enabled=true;
UPDATE 6
gitlabhq_production-# \q
[root@linux-node1 etc]# gitlab-ctl restart
ok: run: gitaly: (pid 79247) 1s
ok: run: gitlab-monitor: (pid 79254) 0s
ok: run: gitlab-workhorse: (pid 79258) 1s
ok: run: logrotate: (pid 79268) 0s
ok: run: nginx: (pid 79279) 0s
ok: run: node-exporter: (pid 79287) 0s
ok: run: postgres-exporter: (pid 79294) 1s
ok: run: postgresql: (pid 79309) 0s
ok: run: prometheus: (pid 79320) 1s
ok: run: redis: (pid 79331) 0s
ok: run: redis-exporter: (pid 79337) 1s
ok: run: sidekiq: (pid 79348) 0s
ok: run: unicorn: (pid 79353) 1s
[root@linux-node1 etc]# 

  

 

重啟之后,打開網頁,問題解決

http://192.168.58.11/

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM