Commit 5472ded2 authored by Douwe Maan's avatar Douwe Maan

Fix importing projects from GitHub Enterprise Edition.

parent adbaa5c4
v 7.14 v 7.14
- Don't send "Added to group" notifications when group is LDAP synched - Don't send "Added to group" notifications when group is LDAP synched
- Fix importing projects from GitHub Enterprise Edition.
v 7.13.2 v 7.13.2
- Fix group web hook - Fix group web hook
......
...@@ -102,7 +102,7 @@ Settings.omniauth['providers'] ||= [] ...@@ -102,7 +102,7 @@ Settings.omniauth['providers'] ||= []
# Fill out omniauth-gitlab settings. It is needed for easy set up GHE or GH by just specifying url. # Fill out omniauth-gitlab settings. It is needed for easy set up GHE or GH by just specifying url.
github_default_url = "https://github.com" github_default_url = "https://github.com"
github_settings = Settings.omniauth['providers'].find{|provider| provider["name"] == "github"} github_settings = Settings.omniauth['providers'].find { |provider| provider["name"] == "github"}
if github_settings if github_settings
# For compatibility with old config files (before 7.8) # For compatibility with old config files (before 7.8)
...@@ -112,11 +112,7 @@ if github_settings ...@@ -112,11 +112,7 @@ if github_settings
end end
if github_settings["url"].include?(github_default_url) if github_settings["url"].include?(github_default_url)
github_settings["args"]["client_options"] = { github_settings["args"]["client_options"] = OmniAuth::Strategies::GitHub.default_options[:client_options]
"site" => 'https://api.github.com/',
"authorize_url" => 'https://github.com/login/oauth/authorize',
"token_url" => 'https://github.com/login/oauth/access_token'
}
else else
github_settings["args"]["client_options"] = { github_settings["args"]["client_options"] = {
"site" => File.join(github_settings["url"], "api/v3"), "site" => File.join(github_settings["url"], "api/v3"),
......
...@@ -42,11 +42,11 @@ module Gitlab ...@@ -42,11 +42,11 @@ module Gitlab
private private
def config def config
Gitlab.config.omniauth.providers.find{|provider| provider.name == "github"} Gitlab.config.omniauth.providers.find { |provider| provider.name == "github"}
end end
def github_options def github_options
OmniAuth::Strategies::GitHub.default_options[:client_options].symbolize_keys config["args"]["client_options"].deep_symbolize_keys
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment