环境:
1.ubuntu18
编辑下列文件:/etc/gitlab/gitlab.rb
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: 'ldap的ip地址'
port: 389
# uid: 'sAMAccountName'
uid: 'uid'
bind_dn: 'cn=test,dc=example,dc=com'
password: 'test'
encryption: 'plain' # "start_tls" or "simple_tls" or "plain"
# verify_certificates: true
# active_directory: true
allow_username_or_email_login: false
lowercase_usernames: true
block_auto_created_users: true #这个配置为true,这样即使用户ldap用户能登录,也必须要gitlab的admin用户允许才可以登录。
base: 'ou=testGroup,dc=example,dc=com'
user_filter: ''
# ## EE only
# group_base: ''
# admin_group: ''
# sync_ssh_keys: false
配置好之后,执行下面的操作
# 重新配置 gitlab-ctl reconfigure # 测试ldap配置,列出ldap中的前100名用户 gitlab-rake gitlab:ldap:check # 重启服务器 gitlab-ctl restart
这里有一个问题,原来没有执行【gitlab-rake gitlab:ldap:check】,ldap怎么都登录不了,执行了之后就可以了,原因不明,可能是bug。
#将一个git仓库,全部转移到另一个仓库 git clone --bare git://192.168.10.XX/git_repo/project_name.git cd project_name.git #git push --mirror git@192.168.20.XX/path/to/path/new_project_name.git git push --mirror https://account:password@192.168.20.XX/path/to/path/new_project_name.git
沪公网安备 31011502001064号