gitlab 搭建

gitlab 搭建

安装CentOS 7

用U盘安装 CentOS 7

CentOS 7 跟以前的版本有些不同,使用老毛桃,软碟通或者其他的启动U盘制作工具制作的镜像无法启动,需要使用Fedora Media Writer 制作安装镜像

https://wiki.centos.org/zh/Ho...

安装gitlab

按照官方的安装方法通过增加yum.repo源来安装
https://about.gitlab.com/inst...

yum.repo 地址

也可以手工增加repo地址 /etc/yum.repo.d/gitlab-ce.repo

https://packages.gitlab.com/i...

[gitlab_gitlab-ce]
name=gitlab_gitlab-ce
baseurl=https://packages.gitlab.com/gitlab/gitlab-ce/el/7/$basearch
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

[gitlab_gitlab-ce-source]
name=gitlab_gitlab-ce-source
baseurl=https://packages.gitlab.com/gitlab/gitlab-ce/el/7/SRPMS
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

使用ldap登录

在企业里面一般使用ldap来管理内部用户,使用ldap用户登录就可以不用注册了,一套用户登录所有系统。

配置文件

/etc/gitlab/gitlab.rb

gitlab_rails['ldap_enabled'] = true

###! **remember to close this block with 'EOS' below**
gitlab_rails['ldap_servers'] = YAML.load <<-'EOS'
  main: # 'main' is the GitLab 'provider ID' of this LDAP server
    label: 'LDAP'
    host: '_your_ldap_server'
    port: 3268
    uid: 'sAMAccountName'
    method: 'plain' # "tls" or "ssl" or "plain"
    bind_dn: '_the_full_dn_of_the_user_you_will_bind_with '
    password: '_the_password_of_the_bind_user '
    active_directory: true
    allow_username_or_email_login: false
    block_auto_created_users: false
    base: ''
    user_filter: ''
    attributes:
      username: ['sAMAccountName']
      email:    ['mail']
      name:       'cn'
      first_name: 'givenName'
      last_name:  'sn'
EOS

/var/opt/gitlab/gitlab-rails/etc/gitlab.yml

ldap:
    enabled: true
    sync_time:
    host: _your_ldap_server
    port: 3268
    uid: sAMAccountName
    method:  plain # "tls" or "ssl" or "plain"
    bind_dn: '_the_full_dn_of_the_user_you_will_bind_with'
    password: '_the_password_of_the_bind_user'
    active_directory: true
    allow_username_or_email_login: false
    base: ''
    user_filter:

测试配置文件

sudo gitlab-rake gitlab:ldap:check

参考

https://docs.gitlab.com/ee/ad...

gitlab 服务

查看服务状态和重启服务

sudo gitlab-ctl status
sudo gitlab-ctl restart
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值