gitlab-ce白名单设置杜绝并发数过大引起的封ip故障

gitlab-ce 7.9安装手札以及上篇文章的问题解决

鸣谢

感谢ruby大神===》章鱼的一路指点,才能拨开迷雾见云天!
章鱼大人:
    国内Ansible部落原创翻译之一!
    资深运维!
    ROR大神!
    熟读各种源码,精通十八般运维技能!
    章鱼大人微博:http://weibo.com/u/2009151365?wvr=5&lf=reg
感谢官方文档!这才是最好的教材

下载

归档页面

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

如何设置白名单

参考

https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template

查看设置白名单的配置文件

    "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

后记

2015年9月5日追马于北京上地

原创文章,作者:追马,如若转载,请注明出处:http://www.178linux.com/7988

(1)
追马追马
上一篇 2015-09-06 20:00
下一篇 2015-09-09 11:06

相关推荐

  • VIM编辑器用法及练习

    VIM编辑器用法及练习 什么是vim? vim是从vi发展出来的一个文本编辑器。代码补全、编译及错误跳转等方便编程的功能特别丰富,在程序员中被广泛使用,和Emacs并列成为类Unix系统用户最喜欢的文本编辑器。 Vim的第一个版本由布莱姆·米勒在1991年发布。最初的简称是Vi IMitation,随着功能的不断增加,正式名称改成了Vi IMproved。现…

    Linux干货 2016-10-30
  • 用户、组

    用户user:  令牌token,identity   Linux用户:username/UID   管理员:root,0   普通用户:1-65535  系统用户:1-499(CENTOS6),1-999 对守护进程获取资源进行权限分配  登录用户:500(CENTOS6)+,1000+…

    Linux干货 2016-08-04
  • 学习宣言

    不妥协,不气馁,朝着自己的目标前进。

    Linux干货 2016-10-24
  • openssl基本应用

    导言: 我们知道在互联网上进行文件传输、电子邮件商务往来存在许多不安全因素,特别是对于一些大公司和一些机密文件在网络上传输,所以为了保证安全,我们必须给文件加密。今天,我们就来谈谈加密、解密、openssl的使用以及CA的实现过程。 数据的3大加密方式 对称加密 含义 指加密解密使用同一组密钥,是按数据分块以后进行加密的,前后数据块彼此之间有关联关系。 特性…

    Linux干货 2016-12-05
  • N26 第四周作业

    1、复制/etc/skel目录为/home/tuser1,要求/home/tuser1及其内部文件的属组和其它用户均没有任何访问权限。 [root@localhost ~]# cp -rv /etc/skel /home/tuser1 [root@localhost ~]# chmod&n…

    Linux干货 2017-01-23
  • 马哥教育网络班22期+第4周课程练习

    1、复制/etc/skel目录为/home/tuser1,要求/home/tuser1及其内部文件的属组和其它用户均没有任何访问权限。 [root@localhost home]# cp -r /etc/skel /home/tuser1 [root@localhost skel]# ch…

    Linux干货 2016-09-05