summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-04-13 17:18:02 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-04-13 17:18:02 +0300
commit4ab717ea6a65beca3e069ca8590c22c49085dc8c (patch)
tree80f163711240e5f6b7288be276c05f2df80a39ca /config
parentecb58dacd614de66c00c8df673abb96fafa5d452 (diff)
parentf39b150a02836f620fe77e1731064b5e6e01b5b1 (diff)
downloadgitlab-ce-4ab717ea6a65beca3e069ca8590c22c49085dc8c.tar.gz
Merge branch 'ldap_migration'
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Conflicts: db/schema.rb
Diffstat (limited to 'config')
-rw-r--r--config/gitlab.yml.example9
-rw-r--r--config/initializers/1_settings.rb6
2 files changed, 13 insertions, 2 deletions
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
index 3d91b67e748..46b9f05cc17 100644
--- a/config/gitlab.yml.example
+++ b/config/gitlab.yml.example
@@ -105,6 +105,15 @@ production: &base
ldap:
enabled: false
servers:
+ ##########################################################################
+ #
+ # Since GitLab 7.4, LDAP servers get ID's (below the ID is 'main'). GitLab
+ # Enterprise Edition now supports connecting to multiple LDAP servers.
+ #
+ # If you are updating from the old (pre-7.4) syntax, you MUST give your
+ # old server the ID 'main'.
+ #
+ ##########################################################################
main: # 'main' is the GitLab 'provider ID' of this LDAP server
## label
#
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index e6b00c531ac..d5cddb8dbf0 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -66,10 +66,11 @@ Settings.ldap['enabled'] = false if Settings.ldap['enabled'].nil?
# backwards compatibility, we only have one host
if Settings.ldap['enabled'] || Rails.env.test?
if Settings.ldap['host'].present?
+ # We detected old LDAP configuration syntax. Update the config to make it
+ # look like it was entered with the new syntax.
server = Settings.ldap.except('sync_time')
- server['provider_name'] = 'ldap'
Settings.ldap['servers'] = {
- 'ldap' => server
+ 'main' => server
}
end
@@ -82,6 +83,7 @@ if Settings.ldap['enabled'] || Rails.env.test?
end
end
+
Settings['omniauth'] ||= Settingslogic.new({})
Settings.omniauth['enabled'] = false if Settings.omniauth['enabled'].nil?
Settings.omniauth['providers'] ||= []