OpenLdap集成应用

openldap集成应用

  • 集成gitlab
    • 配置邮箱验证
  • 集成nexus 3

集成gitlab

[root@gitlab ~]# vim  /etc/gitlab/gitlab.rb
...
### LDAP Settings
###! Docs: https://docs.gitlab.com/omnibus/settings/ldap.html
###! **Be careful not to break the indentation in the ldap_servers block. It is
###!   in yaml format and the spaces must be retained. Using tabs will not work.**

#此位置插入如下代码
gitlab_rails['ldap_enabled'] = true
gitlab_rails['ldap_servers'] = YAML.load <<-'EOS' ###! **remember to close this block with 'EOS' below**
main: # 'main' is the GitLab 'provider ID' of this LDAP server
    label: 'LDAP'
    host: '10.0.1.193'
    port: 389
    uid: 'uid'
    method: 'plain' # "tls" or "ssl" or "plain"
    bind_dn: 'cn=admin,dc=4kgarden,dc=com'
    password: '4kgarden'
    active_directory: false
    allow_username_or_email_login: true
    block_auto_created_users: false
    #ou要跟ldap上的ou(理解为组)匹配
    base: 'ou=People,dc=4kgarden,dc=com'
    user_filter: ''
EOS

配置邮箱验证

不验证邮箱ldap账号登陆gitlab不能创建项目

[root@gitlab ~]# vim  /etc/gitlab/gitlab.rb

#结尾处添加如下代码,第三方STMP
#Sending application email via SMT
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.exmail.qq.com"
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = "[email protected]"
gitlab_rails['smtp_password'] = "noti4K"
gitlab_rails['smtp_domain'] = "smtp.exmail.qq.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
###修改gitlab配置的发信人
gitlab_rails['gitlab_email_from'] = "[email protected]"
user["git_user_email"] = "[email protected]"

集成nexus 3

OpenLdap集成应用_第1张图片
OpenLdap集成应用_第2张图片
OpenLdap集成应用_第3张图片
OpenLdap集成应用_第4张图片
PS:ldap用户要只读和浏览权限 read browse,不然不能登陆

你可能感兴趣的:(OpenLdap集成应用)