gitlab-ce 7.9安裝手札以及上篇文章的問題解決
鳴謝
感謝ruby大神===》章魚的一路指點,才能撥開迷霧見雲天!
章魚大人:
國內Ansible部落原創翻譯之一!
資深運維!
ROR大神!
熟讀各種源碼,精通十八般運維技能!
章魚大人微博:http://weibo.com/u/2009151365?wvr=5&lf=reg
感謝官方文檔!這才是最好的教材
問題描述
每天定時403服務一小時
解決方案
1、修改nginx配置文件,proxy_pass不進行前端訪問ip進行后轉 【臨時解決方案】
2、修改/opt/gitlab/embedded/service/gitlab-rails/config/initializers/1_settings.rb添加白名單 【修改源碼的方案】
3、在/etc/gitlab/gitlab.rb中添加白名單 【本文采取方案】
下載
歸檔頁面
https://about.gitlab.com/downloads/archives/
下載7.9版本
wget https://downloads-packages.s3.amazonaws.com/ubuntu-14.04/gitlab_7.9.0-omnibus.2-1_amd64.deb
安裝指北
參考官網安裝:
https://about.gitlab.com/downloads/#ubuntu1404
http://doc.gitlab.com/ce/install/installation.html
配置文件
修改配置項
打開/etc/gitlab/gitlab.rb,將external_url = 'http://hostname'修改為自己的IP地址:http://xxx.xx.xxx.xx,,然后執行下面的命令,對GitLab進行編譯。
sudo gitlab-ctl reconfigure
登錄系統
Username: root
Password: 5iveL!fe
關於rack_attack的變遷
https://gitlab.com/gitlab-org/omnibus-gitlab/issues/480
如何設置白名單
參考
查看設置白名單的配置文件
"gitlab-rails": {
"rack_attack_git_basic_auth": {
"enabled": true,
"ip_whitelist": [
"127.0.0.1"
],
"maxretry": 300,
"findtime": 5,
"bantime": 60
},
詳細配置過程
root@zhuima:/tmp# grep -C 5 'ip_whitelist' /etc/gitlab/gitlab.rb
# gitlab_rails['rate_limit_requests_per_period'] = 10
# gitlab_rails['rate_limit_period'] = 60
gitlab_rails['rack_attack_git_basic_auth'] = {
'enabled' => true,
'ip_whitelist' => ["127.0.0.1","192.168.101.219"],
'maxretry' => 300,
'findtime' => 5,
'bantime' => 60
}
root@zhuima:/tmp# gitlab-ctl show-config | grep -C 5 ip
the ffi-yajl and yajl-ruby gems have incompatible C libyajl libs and should not be loaded in the same Ruby VM
falling back to ffi which might work (or might not, no promises)
"ci-redis": {
},
"gitlab-rails": {
"rack_attack_git_basic_auth": {
"enabled": true,
"ip_whitelist": [
"127.0.0.1",
"192.168.101.219"
],
"maxretry": 300,
"findtime": 5,
root@zhuima:/tmp#
我想說的
很多時候需要看官方文檔才行,要不然會吃虧
另外就是官方文檔的配置模板一定要詳細查看
gitlab-ce更新相關
https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG
需要更多技術性文章可以訪問馬哥教育官網歐!