$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 72960f7f0e12 gitlab/gitlab-ce:latest "/assets/wrapper" About a minute ago Up About a minute (health: starting) 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:2222->22/tcp gitlab
$ vi /data/gitlab/config/gitlab.rb 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 # # A human-friendly name for your LDAP server. It is OK to change the label later, # for instance if you find out it is too large to fit on the web page. # # Example: 'Paris' or 'Acme, Ltd.' label: 'LDAP'
host: '192.168.100.100' port: 389 # or 636 uid: 'sAMAccountName' encryption: 'plain'# "start_tls" or "simple_tls" or "plain" bind_dn: 'hipstershop\op' password: '_the_password_of_the_bind_user'
# Enable smartcard authentication against the LDAP server. Valid values # are "false", "optional", and "required". smartcard_auth: false
# This setting specifies if LDAP server is Active Directory LDAP server. # For non AD servers it skips the AD specific queries. # If your LDAP server is not AD, set this to false. active_directory: true
# If allow_username_or_email_login is enabled, GitLab will ignore everything # after the first '@' in the LDAP username submitted by the user on login. # # Example: # - the user enters '[email protected]' and 'p@ssw0rd' as LDAP credentials; # - GitLab queries the LDAP server with 'jane.doe' and 'p@ssw0rd'. # # 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
# If lowercase_usernames is enabled, GitLab will lower case the username. lowercase_usernames: false
# Base where we can search for users # # Ex. ou=People,dc=gitlab,dc=example # base: 'OU=op,DC=hipstershop,DC=cn'
# Filter LDAP users # # Format: RFC 4515 http://tools.ietf.org/search/rfc4515 # Ex. (employeeType=developer) # # Note: GitLab does not support omniauth-ldap's custom filter syntax. # user_filter: '' EOS
填写 Group name 组名为hipster,自动生成Group URL,项目组为私有,项目组和项目组内的项目只有组成员可见。
创建项目
点击 New project 在hipster组里创建一个项目
填写 Project name 项目名为shop,项目权限为私有,只有项目成员可见。
然后初始化项目
克隆新建的项目
1 2 3 4 5
$ git clone https://git.hipstershop.cn/hipster/shop.git Cloning into 'shop'... Username for'https://git.hipstershop.cn': root Password for'https://[email protected]': warning: You appear to have cloned an empty repository.