原因:是由于 ip 被封禁的原因
打开/etc/gitlab/gitlab.rb
找到 gitlab_rails['rack_attack_git_basic_auth'] 将注释打开
添加 ip_whitelist 白名单列表
gitlab_rails['rack_attack_git_basic_auth'] = {
'enabled' => true,
'ip_whitelist' => ["127.0.0.1","xxx.xxx.xxx.xxx"],
'maxretry' => 300,
'findtime' => 5,
'bantime' => 60
}
澳门人威尼斯3966的解决方案:
执行
gitlab-ctl reconfigure
再次访问 forbidden 提示就不在了
抱歉,出错了:
traceback (most recent call last):
file "class/flask_sockets.py", line 30, in __call__
handler, values = adapter.match()
file "/www/server/panel/pyenv/lib/python3.7/site-packages/werkzeug/routing.py", line 1945, in match
raise notfound()
werkzeug.exceptions.notfound: 404 not found: the requested url was not found on the server. if you entered the url manually please check your spelling and try again.
during handling of the above exception, another exception occurred:
traceback (most recent call last):
file "class/panelplugin.py", line 1707, in a
plugin_main = __import__(get.name'_main')
file "plugin/gitlab/gitlab_main.py", line 112
except exception,ex:
^
syntaxerror: invalid synta
澳门人威尼斯3966的解决方案:进入 ssh 执行此命令即可
wget-o/www/server/panel/plugin/gitlab/gitlab_main.pyhttp://download.bt.cn/install/plugin/gitlab/gitlab_main.py
此问题的原因是宝塔把 gitlab 的 nginx 启动文件名改成了 gitlab-web, 但是运行 gitlab-ctl reconfigure 会把一个配置文件里面的 gitlab-web 还原回 nginx
所以我们只需要改回去就好了。
宝塔后台打开/opt/gitlab/sv/nginx/run
把
exec chpst -p /opt/gitlab/embedded/sbin/nginx -p /var/opt/gitlab/nginx
改为
exec chpst -p /opt/gitlab/embedded/sbin/gitlab-web -p /var/opt/gitlab/nginx
然后保存退出,运行 gitlab-ctl restart 即可