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

相关推荐

  • 选择判断专题脚本编程_第九周练习

    Q1:写一个脚本,判断当前系统上所有用户的shell是否为可登录shell(即用户的shell不是/sbin/nologin);分别这两类用户的个数;通过字符串比较来实现; #!/bin/bash # declare -i y=0 declare -i n=0 for i in $(cut…

    Linux干货 2016-12-25
  • 第十九周作业

    1、描述Tomcat的架构; 核心架构图: 架构简介: Server是管理Service接口的,是Tomcat的一个顶级容器。管理着多个Service; Service 是服务,管理着一个Container和多个Connector,Service的存在依赖于Server; Container : 一个或者多个Container 可以对应一个Connector…

    2017-06-23
  • 逻辑卷小结

    逻辑卷 逻辑卷:把不同大小的物理设备,抽象成一个完整的文件系统,方便对物理设备的管理与应用。 其基本步骤为: 1.将指定的设备设置为物理卷     物理卷是指定大小的固定得物理区域 2.用一个或者多个物理卷创建一个卷组 3.创建逻辑卷     在物理卷上创建的逻辑卷由物理区域组成…

    Linux干货 2016-09-01
  • Linux发展史

    摘要:Linux无处不在的存在于我们的周围,家庭、公司、学校等等。现在的Linux已经从最初示很少的一段代码,发展成全世界应用范围最广的操作系统。本文将为大家展现Linux的发展史。 一、Linux的是什么       Linux是一套可以免费使用和自由传播的类Unix操作系统操作系统,是一个基于POSIX和UNIX的多用户、多…

    Linux干货 2016-10-18
  • 分布式文件系统之MogileFS

    MogileFS是一个开源的分布式文件存储系统,由LiveJournal旗下的Danga Interactive公司开发。Danga团队开发了包括 Memcached、MogileFS、Perlbal 等多个知名的开源项目。目前使用MogileFS 的公司非常多,如日本排名先前的几个互联公司及国内的yupoo(又拍)、digg、豆瓣、1号店、大众点评、搜狗和…

    Linux干货 2017-06-16