2015-02-08 94 views
4

我在一個乾淨的Debian(debian-7.8.0-amd64)安裝上使用GitLab CE Omnibus軟件包(gitlab_7.7.2-omnibus.5.4.2.ci-1_amd64)。GitLab LDAP中繼策略

我按照安裝過程https://about.gitlab.com/downloads/和一切工作正常。

我修改了/etc/gitlab/gitlab.rb以使用單個LDAP服務器進行身份驗證。 其中也按預期工作。

但是當我試圖用輔助LDAP連接「gitlab-CTL重新配置」給我的輸出:

---- 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連接「主」,但我不能使用「次要」連接。

是否有可能一次在CE版本中使用兩個不同的LDAP連接?

我是紅寶石新[軌道]。我在/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: '[email protected].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: '[email protected]' 
    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 

非常感謝您!

回答

3

多個LDAP服務器是一個EE功能,因此在CE中設置配置將不會執行任何操作。您可以看到功能in GitLab documentation