gitlab配置ldap

使用gitlab 配置ldap

配置文件路径
/etc/gitlab/gitlab.rb

文件中配置的ldap 配置示例:

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: '172.1.1.1'
port: 389
uid: 'mail'
bind_dn: 'cn=ldapadm,dc=yangqianguan,dc=com'
password: '*****'
encryption: 'plain' # "start_tls" or "simple_tls" or "plain"
verify_certificates: false
active_directory: false
allow_username_or_email_login: false
block_auto_created_users: false
base: 'dc=yangqianguan,dc=com'
user_filter: ''
EOS
有个坑:
如果需要邮箱登录的话,设置 allow_username_or_email_login 该字段为 false ,配置uid: 'mail'。
If you are using "uid: 'userPrincipalName'" on ActiveDirectory you need to
disable this setting, because the userPrincipalName contains an '@'. allow_username_or_email_login: false
重新加载配置指令

sudo gitlab-ctl reconfigure

你可能感兴趣的:(gitlab配置ldap)