【Ubuntu18.04】Gitlab用ldap的用户登陆

Gitlab用ldap的用户登陆

连接Gitlab和ldap

cd /etc/gitlab
vim /gitlab.rb

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

###! **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.17.236.53'
      port: 389
      uid: 'cn'
      bind_dn: 'cn=admin,dc=ldap,dc=com'
      password: '123456'
      encryption: 'plain' # "start_tls" or "simple_tls" or "plain"
#     verify_certificates: true
#     smartcard_auth: false
      active_directory: true
      allow_username_or_email_login: false
#     lowercase_usernames: false
#     block_auto_created_users: false
      base: 'dc=ldap,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
#     smartcard_auth: false
#     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的端口

找到关键字:external_url 'http://127.0.0.1'
将其内容改为:external_url 'http://<服务器地址或域名>:11000'
找到关键字:unicorn['port'] = 8080
将其内容改为:unicorn['port'] = 11001
找到关键字:prometheus['listen_address'] = 'localhost:9090'
将其内容改为:prometheus['listen_address'] = 'localhost:11002'

猜你喜欢

转载自blog.csdn.net/lengyer/article/details/114065540