Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
1be5291a
Commit
1be5291a
authored
Feb 11, 2015
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GHE importer: moved settings login to initializer
parent
1308a8a0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
33 deletions
+30
-33
config/gitlab.yml.example
config/gitlab.yml.example
+4
-11
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+18
-0
doc/integration/github.md
doc/integration/github.md
+8
-22
No files found.
config/gitlab.yml.example
View file @
1be5291a
...
...
@@ -261,17 +261,10 @@ production: &base
# - { name: 'gitlab', app_id: 'YOUR APP ID',
# app_secret: 'YOUR APP SECRET',
# args: { scope: 'api' } }
# - { name: 'github', app_id: '01723ee0027dd2b496d9',
# app_secret: '7f4b9298d181375e51cd60e25e9f26603a4dd3cc',
# args: {
# scope: 'user:email',
# client_options: {
# site: 'https://api.github.com/',
# authorize_url: 'https://github.com/login/oauth/authorize',
# token_url: 'https://github.com/login/oauth/access_token'
# }
# }
# }
# - { name: 'github', app_id: 'YOUR APP ID',
# app_secret: 'YOUR APP SECRET',
# url: "https://github.com/",
# args: { scope: 'user:email' } }
...
...
config/initializers/1_settings.rb
View file @
1be5291a
...
...
@@ -91,6 +91,24 @@ Settings['omniauth'] ||= Settingslogic.new({})
Settings
.
omniauth
[
'enabled'
]
=
false
if
Settings
.
omniauth
[
'enabled'
].
nil?
Settings
.
omniauth
[
'providers'
]
||=
[]
# Fill out omniauth-gitlab settings. It is needed for easy set up GHE or GH by just specifying url.
github_settings
=
Settings
.
omniauth
[
'providers'
].
find
{
|
provider
|
provider
[
"name"
]
==
"github"
}
if
github_settings
[
"url"
].
include?
(
"https://github.com"
)
github_settings
[
"args"
][
"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
github_settings
[
"args"
][
"client_options"
]
=
{
"site"
=>
File
.
join
(
github_settings
[
"url"
],
"api/v3"
),
"authorize_url"
=>
File
.
join
(
github_settings
[
"url"
],
"login/oauth/authorize"
),
"token_url"
=>
File
.
join
(
github_settings
[
"url"
],
"login/oauth/access_token"
)
}
end
Settings
[
'issues_tracker'
]
||=
{}
#
...
...
doc/integration/github.md
View file @
1be5291a
...
...
@@ -32,17 +32,10 @@ To enable the GitHub OmniAuth provider you must register your application with G
1.
Under
`providers:`
uncomment (or add) lines that look like the following:
```
- { name: 'github', app_id: '01723ee0027dd2b496d9',
app_secret: '7f4b9298d181375e51cd60e25e9f26603a4dd3cc',
args: {
scope: 'user:email',
client_options: {
site: 'https://api.github.com/',
authorize_url: 'https://github.com/login/oauth/authorize',
token_url: 'https://github.com/login/oauth/access_token'
}
}
}
- { name: 'github', app_id: 'YOUR APP ID',
app_secret: 'YOUR APP SECRET',
url: "https://github.com/",
args: { scope: 'user:email' } }
```
...
...
@@ -50,17 +43,10 @@ To enable the GitHub OmniAuth provider you must register your application with G
1.
If you want to use GitHub Enterprise then your configuration should look like the following:
```
- { name: 'github', app_id: 'a4eaa26df2ff35879923',
app_secret: '2f9236c341cf8b3dc86a93652554fccd4ef84c55',
args: {
scope: 'user:email',
client_options: {
site: 'https://github.example.com/api/v3',
authorize_url: 'https://github.example.com/login/oauth/authorize',
token_url: 'https://github.example.com/login/oauth/access_token'
}
}
}
- { name: 'github', app_id: 'YOUR APP ID',
app_secret: 'YOUR APP SECRET',
url: "https://github.example.com/",
args: { scope: 'user:email' } }
```
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment