Gitlab 11.0.3漢化完成後,須要集成域控,現將域控的配置過程描述以下:git
gitlab目錄:/etc/gitlabssh
gitlab配置文件:/etc/gitlab/gitlab.rbide
編輯gitlab.rb文件:gitlab
在gitlab.rb文件中修改下面配置,其中:ui
1.host,是搭建的ldap的ip,根據實際狀況修改;this
2.uid,能夠配置cn,也能夠配置uid,都能識別(具體爲何沒深刻研究);rest
3.bind_dn,ldap的管理員帳號,根據實際狀況修改;server
4.password,ldap的管理員,根據實際狀況修改;ip
5.active_directory,彷佛是針對鏈接是不是ad域控的標示,由於這部分是ldap的配置,故爲false;rem
6.allow_username_or_email_login,用戶登陸是否用戶名和郵箱均可以,方便用戶故配置true;
7.base,用戶列表所在的目錄,由於新增的用戶都在ldap的People下,故這麼配置,根據實際狀況修改;
個人配置以下:
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: '**.**.**.**'
port: 389
uid: 'sAMAccountName'
bind_dn: 'cn=***,cn=Users,dc=***,dc=****,dc=COM'
password: '*****'
encryption: 'plain' # "start_tls" or "simple_tls" or "plain"
verify_certificates: true
active_directory: true
allow_username_or_email_login: true
lowercase_usernames: false
block_auto_created_users: false
base: 'OU=Users,OU=*****,DC=***,DC=*****,DC=COM'
user_filter: ''
## EE only
# group_base: ''
# admin_group: ''
# sync_ssh_keys: false
#
# secondary: # 'secondary' is the GitLab 'provider ID' of second LDAP server
# label: 'LDAP'
# host: '_your_ldap_server'
# port: 389
# uid: 'sAMAccountName'
# bind_dn: '_the_full_dn_of_the_user_you_will_bind_with'
# password: '_the_password_of_the_bind_user'
# encryption: 'plain' # "start_tls" or "simple_tls" or "plain"
# verify_certificates: true
# active_directory: true
# allow_username_or_email_login: false
# lowercase_usernames: false
# block_auto_created_users: false
# base: ''
# user_filter: ''
# ## EE only
# group_base: ''
# admin_group: ''
# sync_ssh_keys: false
EOS
配置完成後進行配置更新:
gitlab-ctl reconfigure
檢查是否配置成功:
gitlab-rake gitlab:ldap:check(列出前100個用戶)
重啓gitlab服務:
gitlab-ctl restart