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
0
Merge Requests
0
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
Kazuhiko Shiozaki
gitlab-ce
Commits
ed3298fc
Commit
ed3298fc
authored
Feb 16, 2015
by
Jakub Jirutka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow to configure gitlab_shell_secret location
parent
35729671
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
6 deletions
+12
-6
CHANGELOG
CHANGELOG
+1
-0
config/gitlab.yml.example
config/gitlab.yml.example
+4
-0
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+1
-0
config/initializers/gitlab_shell_secret_token.rb
config/initializers/gitlab_shell_secret_token.rb
+4
-4
lib/api/helpers.rb
lib/api/helpers.rb
+1
-1
spec/requests/api/internal_spec.rb
spec/requests/api/internal_spec.rb
+1
-1
No files found.
CHANGELOG
View file @
ed3298fc
...
@@ -67,6 +67,7 @@ v 7.11.0 (unreleased)
...
@@ -67,6 +67,7 @@ v 7.11.0 (unreleased)
- Spin spinner icon next to "Checking for CI status..." on MR page.
- Spin spinner icon next to "Checking for CI status..." on MR page.
- Fix reference links in dashboard activity and ATOM feeds.
- Fix reference links in dashboard activity and ATOM feeds.
- Ensure that the first added admin performs repository imports
- Ensure that the first added admin performs repository imports
- Allow to configure location of the `.gitlab_shell_secret` file. (Jakub Jirutka)
v 7.10.2
v 7.10.2
- Fix CI links on MR page
- Fix CI links on MR page
...
...
config/gitlab.yml.example
View file @
ed3298fc
...
@@ -245,6 +245,10 @@ production: &base
...
@@ -245,6 +245,10 @@ production: &base
repos_path: /home/git/repositories/
repos_path: /home/git/repositories/
hooks_path: /home/git/gitlab-shell/hooks/
hooks_path: /home/git/gitlab-shell/hooks/
# File that contains the secret key for verifying access for gitlab-shell.
# Default is '.gitlab_shell_secret' relative to Rails.root (i.e. root of the GitLab app).
# secret_file: /home/git/gitlab/.gitlab_shell_secret
# Git over HTTP
# Git over HTTP
upload_pack: true
upload_pack: true
receive_pack: true
receive_pack: true
...
...
config/initializers/1_settings.rb
View file @
ed3298fc
...
@@ -148,6 +148,7 @@ Settings.gravatar['ssl_url'] ||= 'https://secure.gravatar.com/avatar/%{hash}?
...
@@ -148,6 +148,7 @@ Settings.gravatar['ssl_url'] ||= 'https://secure.gravatar.com/avatar/%{hash}?
Settings
[
'gitlab_shell'
]
||=
Settingslogic
.
new
({})
Settings
[
'gitlab_shell'
]
||=
Settingslogic
.
new
({})
Settings
.
gitlab_shell
[
'path'
]
||=
Settings
.
gitlab
[
'user_home'
]
+
'/gitlab-shell/'
Settings
.
gitlab_shell
[
'path'
]
||=
Settings
.
gitlab
[
'user_home'
]
+
'/gitlab-shell/'
Settings
.
gitlab_shell
[
'hooks_path'
]
||=
Settings
.
gitlab
[
'user_home'
]
+
'/gitlab-shell/hooks/'
Settings
.
gitlab_shell
[
'hooks_path'
]
||=
Settings
.
gitlab
[
'user_home'
]
+
'/gitlab-shell/hooks/'
Settings
.
gitlab_shell
[
'secret_file'
]
||=
Rails
.
root
.
join
(
'.gitlab_shell_secret'
)
Settings
.
gitlab_shell
[
'receive_pack'
]
=
true
if
Settings
.
gitlab_shell
[
'receive_pack'
].
nil?
Settings
.
gitlab_shell
[
'receive_pack'
]
=
true
if
Settings
.
gitlab_shell
[
'receive_pack'
].
nil?
Settings
.
gitlab_shell
[
'upload_pack'
]
=
true
if
Settings
.
gitlab_shell
[
'upload_pack'
].
nil?
Settings
.
gitlab_shell
[
'upload_pack'
]
=
true
if
Settings
.
gitlab_shell
[
'upload_pack'
].
nil?
Settings
.
gitlab_shell
[
'repos_path'
]
||=
Settings
.
gitlab
[
'user_home'
]
+
'/repositories/'
Settings
.
gitlab_shell
[
'repos_path'
]
||=
Settings
.
gitlab
[
'user_home'
]
+
'/repositories/'
...
...
config/initializers/gitlab_shell_secret_token.rb
View file @
ed3298fc
...
@@ -5,8 +5,7 @@ require 'securerandom'
...
@@ -5,8 +5,7 @@ require 'securerandom'
# Your secret key for verifying the gitlab_shell.
# Your secret key for verifying the gitlab_shell.
secret_file
=
Rails
.
root
.
join
(
'.gitlab_shell_secret'
)
secret_file
=
Gitlab
.
config
.
gitlab_shell
.
secret_file
gitlab_shell_symlink
=
File
.
join
(
Gitlab
.
config
.
gitlab_shell
.
path
,
'.gitlab_shell_secret'
)
unless
File
.
exist?
secret_file
unless
File
.
exist?
secret_file
# Generate a new token of 16 random hexadecimal characters and store it in secret_file.
# Generate a new token of 16 random hexadecimal characters and store it in secret_file.
...
@@ -14,6 +13,7 @@ unless File.exist? secret_file
...
@@ -14,6 +13,7 @@ unless File.exist? secret_file
File
.
write
(
secret_file
,
token
)
File
.
write
(
secret_file
,
token
)
end
end
if
File
.
exist?
(
Gitlab
.
config
.
gitlab_shell
.
path
)
&&
!
File
.
exist?
(
gitlab_shell_symlink
)
link_path
=
File
.
join
(
Gitlab
.
config
.
gitlab_shell
.
path
,
'.gitlab_shell_secret'
)
FileUtils
.
symlink
(
secret_file
,
gitlab_shell_symlink
)
if
File
.
exist?
(
Gitlab
.
config
.
gitlab_shell
.
path
)
&&
!
File
.
exist?
(
link_path
)
FileUtils
.
symlink
(
secret_file
,
link_path
)
end
end
lib/api/helpers.rb
View file @
ed3298fc
...
@@ -243,7 +243,7 @@ module API
...
@@ -243,7 +243,7 @@ module API
end
end
def
secret_token
def
secret_token
File
.
read
(
Rails
.
root
.
join
(
'.gitlab_shell_secret'
)
).
chomp
File
.
read
(
Gitlab
.
config
.
gitlab_shell
.
secret_file
).
chomp
end
end
def
handle_member_errors
(
errors
)
def
handle_member_errors
(
errors
)
...
...
spec/requests/api/internal_spec.rb
View file @
ed3298fc
...
@@ -5,7 +5,7 @@ describe API::API, api: true do
...
@@ -5,7 +5,7 @@ describe API::API, api: true do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:key
)
{
create
(
:key
,
user:
user
)
}
let
(
:key
)
{
create
(
:key
,
user:
user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:secret_token
)
{
File
.
read
Rails
.
root
.
join
(
'.gitlab_shell_secret'
)
}
let
(
:secret_token
)
{
File
.
read
Gitlab
.
config
.
gitlab_shell
.
secret_file
}
describe
"GET /internal/check"
,
no_db:
true
do
describe
"GET /internal/check"
,
no_db:
true
do
it
do
it
do
...
...
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