作者:嘻嘻嘻嘻 | 来源:互联网 | 2023-05-22 20:47
我在干净的Debian(debian-7.8.0-amd64)安装上使用GitLab CE Omnibus软件包(gitlab_7.7.2-omnibus.5.4.2.ci-1_amd64).
我按照https://about.gitlab.com/downloads/上的安装过程进行操作,一切正常.
我修改了/etc/gitlab/gitlab.rb以使用单个LDAP服务器进行身份验证.哪个也按预期工作.
但是当我尝试使用辅助LDAP连接时,"gitlab-ctl reconfigure"给出了输出:
---- Begin output of /opt/gitlab/bin/gitlab-rake cache:clear ----
STDOUT:
STDERR: rake aborted!
Devise::OmniAuth::StrategyNotFound: Could not find a strategy with name `Ldapsecondary'. Please ensure it is required or explicitly set it using the :strategy_class option .
Tasks: TOP => cache:clear => environment
(See full trace by running task with --trace)
---- End output of /opt/gitlab/bin/gitlab-rake cache:clear ----
所以,问题是我可以使用LDAP连接'main',但我不能使用'secondary'连接.
是否有可能同时在CE版本中使用两个不同的LDAP连接?
我是ruby [在轨道上]的新手.我在/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/ldap/config.rb中找到了一些东西,但是我无法调试任何东西.
这是我在/etc/gitlab/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: 'First Company'
host: '192.168.100.1'
port: 389
uid: 'sAMAccountName'
method: 'tls' # "tls" or "ssl" or "plain"
bind_dn: 'debian@firstcompany.local'
password: 'Passw0rd'
active_directory: true
allow_username_or_email_login: false
base: 'dc=firstcompany,dc=local'
user_filter: '(&(objectClass=person)(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))'
## EE only
group_base: ''
admin_group: ''
sync_ssh_keys: false
secondary: # 'secondary' is the GitLab 'provider ID' of second LDAP server
label: 'Second Company'
host: '192.168.200.1'
port: 389
uid: 'sAMAccountName'
method: 'tls' # "tls" or "ssl" or "plain"
bind_dn: 'debian@secondcompany.local'
password: 'Passw0rd'
active_directory: true
allow_username_or_email_login: false
base: 'dc=secondcompany,dc=local'
user_filter: '(&(objectClass=person)(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))'
## EE only
group_base: ''
admin_group: ''
sync_ssh_keys: false
EOS
非常感谢你!
1> 小智..:
多个LDAP服务器是EE的一项功能,因此在CE中设置配置不会执行任何操作。您可以在GitLab文档中看到该功能。