gitlab汉化及关联LDAP
gitlab汉化及关联LDAP
Ø 环境说明
公司新增AI部门,要为前端项目搭建gitlab平台,但是公司的jira和confluence等公共服务都是用LDAP来同一认证进行登录的,由于gitlab社区版本安装后是英文版,使用不是很方便,在汉化上,百度了好多办法最后终于解决了
Ø 服务器环境
系统版本
cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
关闭防火墙
systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
关闭selinux
getenforce
Disabled
第1章 安装gitlab-ce
上传rpm包然后进行安装,三条命令即可
yum localinstall gitlab-ce-9.1.4-ce.0.el7.x86_64.rpm
gitlab-ctl reconfigure
gitlab-ctl status
第2章 gitlab汉化
Ø 说明 : gitlab 9.X版本使用此方法均可
下载汉化包,本地网络如果不是太好的话,有云主机可以在云主机上下载能快一点,我这里是下载不了,最后在云服务器上下好,拉到本地,下面是下载地址
git clone https://gitlab.com/xhang/gitlab.git
如果已经克隆过,则进行更新
git fetch
查看已经安装的gitlab版本
cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
9.1.4
进入到汉化包目录
cd gitlab
生成patch用的diff文件
git diff v9.1.4 v9.1.4-zh > ../9.1.4-zh.diff
安装patch命令
yum install patch
使用patch命令将文件导入
patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < /root/9.1.4-zh.diff
重新加载配置
gitlab-ctl reconfigure
汉化后的页面
第1章 关联LDAP
在152行后加入以下关联的数据
vim /etc/gitlab/gitlab.rb +152
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: '192.168.3.67'
port: 389
uid: 'uid'
method: 'plain' # "tls" or "ssl" or "plain"
bind_dn: 'cn=root,dc=hello,dc=cn'
password: '2018'
active_directory: true
allow_username_or_email_login: false
block_auto_created_users: false
base: 'dc=hello,dc=cn'
user_filter: ''
attributes:
username: ['uid', 'userid', 'sAM 1c7c AccountName']
email: ['mail', 'email', 'userPrincipalName']
name: 'cn'
first_name: 'givenName'
last_name: 'sn'
EOS
重新加载配置
gitlab-ctl reconfigure
登录页面已经增加了LDAP登录选项
- 基于php数组中的索引数组和关联数组详解
- php关联数组与索引数组及其显示方法
- centos6上 tengine本地代理gitlab服务器部署
- centos上 svn迁移到gitlab
- git版本升级
- gitlab的安装和使用(一)
- gitlab的安装和使用(二)
- gitlab的安装和使用(三)
- jenkins+gitlab 快速部署
- GitLab10安装-部署-汉化-备份-升级
- Git批量修改历史commit中的user.name 和user.email
- gitlab仓库存储位置的修改方法--亲测有效
- 提交代码并部署到服务器上,为什么代码却没有更新?
- 一道关于数据库(经典父子级 ID 关联)更新题
- C#中枚举类型和radiobox关联操作的方法
- PHP关联数组的10个操作技巧
- 企业级Docker+Jenkins+Gitlab自动化流水线构建
- 为什么要从GitHub迁移到GitLab