Commit e260f91c authored by Jacob Vosmaer (GitLab)'s avatar Jacob Vosmaer (GitLab)

Merge branch 'v0.7.6-add-protocol-to-git-command' into 'master'

Added GL_PROTOCOL as an ENV variable to gitCommand

With this MR we are now populating an ENV variable called `GL_PROTOCOL` when calling the `gitCommand` method. This will allow GitLab to allow or deny the request based on the allowed Git access protocols defined in the Application Settings.

This MR is needed for:

gitlab-org/gitlab-shell!62 

gitlab-org/gitlab-ce!4696

gitlab-org/gitlab-ce#18601

See merge request !51
parents 6a4ac36e 1ab32aa0
......@@ -6,6 +6,9 @@ v0.7.6
Add the capability to inject `git format-patch` output.
Add the protocol used (HTTP) to the gitCommand call in order to check
for restricted protocol access on GitLab's side.
v0.7.5
Add the capability to inject `git diff` output as HTTP response bodies
......
......@@ -18,6 +18,7 @@ func gitCommand(gl_id string, name string, args ...string) *exec.Cmd {
fmt.Sprintf("PATH=%s", os.Getenv("PATH")),
fmt.Sprintf("LD_LIBRARY_PATH=%s", os.Getenv("LD_LIBRARY_PATH")),
fmt.Sprintf("GL_ID=%s", gl_id),
fmt.Sprintf("GL_PROTOCOL=http"),
}
// If we don't do something with cmd.Stderr, Git errors will be lost
cmd.Stderr = os.Stderr
......
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