Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-workhorse
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
iv
gitlab-workhorse
Commits
3ea22ec1
Commit
3ea22ec1
authored
Jan 13, 2016
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://gitlab.com/gitlab-org/gitlab-workhorse
into refactor-upstream
parents
06cad3f5
64270207
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
3 deletions
+41
-3
CHANGELOG
CHANGELOG
+4
-0
Makefile
Makefile
+1
-1
README.md
README.md
+3
-0
VERSION
VERSION
+1
-1
internal/upstream/routes.go
internal/upstream/routes.go
+1
-1
main_test.go
main_test.go
+31
-0
No files found.
CHANGELOG
View file @
3ea22ec1
...
...
@@ -2,6 +2,10 @@
Formerly known as 'gitlab-git-http-server'.
0.5.4
Fix /api/v3/projects routing bug introduced in 0.5.2-0.5.3.
0.5.3
Fixes merge error in 0.5.2.
...
...
Makefile
View file @
3ea22ec1
...
...
@@ -2,7 +2,7 @@ PREFIX=/usr/local
VERSION
=
$(
shell
git describe
)
-
$(
shell
date
-u
+%Y%m%d.%H%M%S
)
gitlab-workhorse
:
$(wildcard *.go)
go build
-ldflags
"-X main.Version
${VERSION}
"
-o
gitlab-workhorse
go build
-ldflags
"-X main.Version
=
${VERSION}
"
-o
gitlab-workhorse
install
:
gitlab-workhorse
install
gitlab-workhorse
${PREFIX}
/bin/
...
...
README.md
View file @
3ea22ec1
...
...
@@ -53,6 +53,9 @@ gitlab-workhorse -authBackend http://localhost:8080/gitlab
## Installation
To install gitlab-workhorse you need
[
Go 1.5 or
newer
](
https://golang.org/dl
)
.
To install into
`/usr/local/bin`
run
`make install`
.
```
...
...
VERSION
View file @
3ea22ec1
0.5.
3
0.5.
4
internal/upstream/routes.go
View file @
3ea22ec1
...
...
@@ -23,7 +23,7 @@ const gitProjectPattern = `^/[^/]+/[^/]+\.git/`
const
apiPattern
=
`^/api/`
// A project ID in an API request is either a number or two strings 'namespace/project'
const
projectsAPIPattern
=
`^/api/v3/projects/(
\d+)|([^/]+/[^/]+
)/`
const
projectsAPIPattern
=
`^/api/v3/projects/(
(\d+)|([^/]+/[^/]+)
)/`
const
ciAPIPattern
=
`^/ci/api/`
// Routing table
...
...
main_test.go
View file @
3ea22ec1
...
...
@@ -276,6 +276,37 @@ func TestDownloadCacheCreate(t *testing.T) {
}
}
func
TestRegularProjectsAPI
(
t
*
testing
.
T
)
{
apiResponse
:=
"API RESPONSE"
ts
:=
testAuthServer
(
nil
,
200
,
apiResponse
)
defer
ts
.
Close
()
ws
:=
startWorkhorseServer
(
ts
.
URL
)
defer
ws
.
Close
()
for
_
,
resource
:=
range
[]
string
{
"/api/v3/projects/123/repository/not/special"
,
"/api/v3/projects/foo%2Fbar/repository/not/special"
,
"/api/v3/projects/123/not/special"
,
"/api/v3/projects/foo%2Fbar/not/special"
,
}
{
resp
,
err
:=
http
.
Get
(
ws
.
URL
+
resource
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
defer
resp
.
Body
.
Close
()
buf
:=
&
bytes
.
Buffer
{}
if
_
,
err
:=
io
.
Copy
(
buf
,
resp
.
Body
);
err
!=
nil
{
t
.
Error
(
err
)
}
if
buf
.
String
()
!=
apiResponse
{
t
.
Errorf
(
"GET %q: Expected %q, got %q"
,
resource
,
apiResponse
,
buf
.
String
())
}
if
resp
.
StatusCode
!=
200
{
t
.
Errorf
(
"GET %q: expected 200, got %d"
,
resource
,
resp
.
StatusCode
)
}
}
}
func
TestAllowedXSendfileDownload
(
t
*
testing
.
T
)
{
contentFilename
:=
"my-content"
prepareDownloadDir
(
t
)
...
...
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