GitLab 配置支持 openldap 登录

一. 普通模式

vim /etc/gitlab/gitlab.rb

gitlab_rails['ldap_enabled'] = true
gitlab_rails['prevent_ldap_sign_in'] = false

gitlab_rails['ldap_servers'] = YAML.load <<-'EOS'
  main:
    label: 'LDAP'
    host: 'host' 
    port: 389
    uid: 'uid' 
    bind_dn: 'uid=gitlab,dc=example,dc=com' 
    password: 'xxxxxxxx'
    encryption: 'plain'
    verify_certificates: false 
    active_directory: false 
    allow_username_or_email_login: false
    lowercase_usernames: false
    block_auto_created_users: false
    base: 'dc=example,dc=com'
    user_filter: ''
    attributes:
      username: ['mail']
      email: ['mail']
      name:  'displayName'
EOS

二. ssl 加密模式

vim /etc/gitlab/gitlab.rb

gitlab_rails['ldap_servers'] = YAML.load <<-'EOS'
  main:
    label: 'LDAP'
    host: 'host' 
    port: 636 
    uid: 'uid' 
    bind_dn: 'uid=gitlab,dc=example,dc=com' 
    password: 'xxxxxxxx'
    encryption: 'simple_tls'
    verify_certificates: false 
    active_directory: false 
    allow_username_or_email_login: false
    lowercase_usernames: false
    block_auto_created_users: false
    base: 'dc=example,dc=com'
    user_filter: ''
    attributes:
      username: ['mail']
      email: ['mail']
      name:  'displayName'
EOS

你可能感兴趣的:(GitLab 配置支持 openldap 登录)