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
01ce58bd
Commit
01ce58bd
authored
Aug 03, 2017
by
David Turner
Committed by
David Turner
Sep 29, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add username to authorized result, so that gitlab-shell can pass it to hooks
parent
dbcf48af
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
8 deletions
+15
-8
GITLAB_SHELL_VERSION
GITLAB_SHELL_VERSION
+2
-1
lib/api/internal.rb
lib/api/internal.rb
+7
-0
lib/gitlab/git/hook.rb
lib/gitlab/git/hook.rb
+5
-6
lib/gitlab/workhorse.rb
lib/gitlab/workhorse.rb
+1
-1
No files found.
GITLAB_SHELL_VERSION
View file @
01ce58bd
5.9.2
5.9.3
lib/api/internal.rb
View file @
01ce58bd
...
@@ -31,6 +31,12 @@ module API
...
@@ -31,6 +31,12 @@ module API
protocol
=
params
[
:protocol
]
protocol
=
params
[
:protocol
]
actor
.
update_last_used_at
if
actor
.
is_a?
(
Key
)
actor
.
update_last_used_at
if
actor
.
is_a?
(
Key
)
user
=
if
actor
.
is_a?
(
Key
)
actor
.
user
else
actor
end
access_checker_klass
=
wiki?
?
Gitlab
::
GitAccessWiki
:
Gitlab
::
GitAccess
access_checker_klass
=
wiki?
?
Gitlab
::
GitAccessWiki
:
Gitlab
::
GitAccess
access_checker
=
access_checker_klass
access_checker
=
access_checker_klass
...
@@ -47,6 +53,7 @@ module API
...
@@ -47,6 +53,7 @@ module API
{
{
status:
true
,
status:
true
,
gl_repository:
gl_repository
,
gl_repository:
gl_repository
,
gl_username:
user
&
.
username
,
repository_path:
repository_path
,
repository_path:
repository_path
,
gitaly:
gitaly_payload
(
params
[
:action
])
gitaly:
gitaly_payload
(
params
[
:action
])
}
}
...
...
lib/gitlab/git/hook.rb
View file @
01ce58bd
...
@@ -83,12 +83,11 @@ module Gitlab
...
@@ -83,12 +83,11 @@ module Gitlab
def
call_update_hook
(
gl_id
,
gl_username
,
oldrev
,
newrev
,
ref
)
def
call_update_hook
(
gl_id
,
gl_username
,
oldrev
,
newrev
,
ref
)
Dir
.
chdir
(
repo_path
)
do
Dir
.
chdir
(
repo_path
)
do
stdout
,
stderr
,
status
=
Open3
.
capture3
(
env
=
{
{
'GL_ID'
=>
gl_id
,
'GL_ID'
=>
gl_id
,
'GL_USERNAME'
=>
gl_username
'GL_USERNAME'
=>
gl_username
}
},
stdout
,
stderr
,
status
=
Open3
.
capture3
(
env
,
path
,
ref
,
oldrev
,
newrev
)
path
,
ref
,
oldrev
,
newrev
)
[
status
.
success?
,
(
stderr
.
presence
||
stdout
).
gsub
(
/\R/
,
"<br>"
).
html_safe
]
[
status
.
success?
,
(
stderr
.
presence
||
stdout
).
gsub
(
/\R/
,
"<br>"
).
html_safe
]
end
end
end
end
...
...
lib/gitlab/workhorse.rb
View file @
01ce58bd
...
@@ -22,9 +22,9 @@ module Gitlab
...
@@ -22,9 +22,9 @@ module Gitlab
params
=
{
params
=
{
GL_ID
:
Gitlab
::
GlId
.
gl_id
(
user
),
GL_ID
:
Gitlab
::
GlId
.
gl_id
(
user
),
GL_REPOSITORY
:
Gitlab
::
GlRepository
.
gl_repository
(
project
,
is_wiki
),
GL_REPOSITORY
:
Gitlab
::
GlRepository
.
gl_repository
(
project
,
is_wiki
),
GL_USERNAME
:
user
&
.
username
,
RepoPath
:
repo_path
RepoPath
:
repo_path
}
}
server
=
{
server
=
{
address:
Gitlab
::
GitalyClient
.
address
(
project
.
repository_storage
),
address:
Gitlab
::
GitalyClient
.
address
(
project
.
repository_storage
),
token:
Gitlab
::
GitalyClient
.
token
(
project
.
repository_storage
)
token:
Gitlab
::
GitalyClient
.
token
(
project
.
repository_storage
)
...
...
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