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
646de543
Commit
646de543
authored
Mar 19, 2016
by
Jacob Vosmaer
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Be compatible with GOPATH
parent
285f47a7
Changes
33
Hide whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
94 additions
and
81 deletions
+94
-81
.gitignore
.gitignore
+1
-0
Makefile
Makefile
+24
-12
authorization_test.go
authorization_test.go
+3
-3
cmd/gitlab-zip-cat/main.go
cmd/gitlab-zip-cat/main.go
+1
-1
cmd/gitlab-zip-metadata/main.go
cmd/gitlab-zip-metadata/main.go
+1
-1
internal/api/api.go
internal/api/api.go
+2
-2
internal/artifacts/artifact_download.go
internal/artifacts/artifact_download.go
+3
-3
internal/artifacts/artifact_download_test.go
internal/artifacts/artifact_download_test.go
+3
-3
internal/artifacts/artifacts_upload.go
internal/artifacts/artifacts_upload.go
+4
-4
internal/artifacts/artifacts_upload_test.go
internal/artifacts/artifacts_upload_test.go
+5
-5
internal/badgateway/roundtripper.go
internal/badgateway/roundtripper.go
+1
-1
internal/git/archive.go
internal/git/archive.go
+2
-2
internal/git/blob.go
internal/git/blob.go
+2
-2
internal/git/git-http.go
internal/git/git-http.go
+3
-3
internal/lfs/lfs.go
internal/lfs/lfs.go
+2
-2
internal/proxy/proxy.go
internal/proxy/proxy.go
+2
-2
internal/sendfile/sendfile.go
internal/sendfile/sendfile.go
+1
-1
internal/staticpages/deploy_page.go
internal/staticpages/deploy_page.go
+1
-1
internal/staticpages/deploy_page_test.go
internal/staticpages/deploy_page_test.go
+1
-1
internal/staticpages/error_pages.go
internal/staticpages/error_pages.go
+1
-1
internal/staticpages/error_pages_test.go
internal/staticpages/error_pages_test.go
+1
-1
internal/staticpages/servefile.go
internal/staticpages/servefile.go
+2
-2
internal/staticpages/servefile_test.go
internal/staticpages/servefile_test.go
+1
-1
internal/upload/uploads.go
internal/upload/uploads.go
+1
-1
internal/upload/uploads_test.go
internal/upload/uploads_test.go
+3
-3
internal/upstream/development_test.go
internal/upstream/development_test.go
+1
-1
internal/upstream/handlers.go
internal/upstream/handlers.go
+1
-1
internal/upstream/handlers_test.go
internal/upstream/handlers_test.go
+1
-1
internal/upstream/routes.go
internal/upstream/routes.go
+8
-8
internal/upstream/upstream.go
internal/upstream/upstream.go
+3
-3
main.go
main.go
+1
-1
main_test.go
main_test.go
+4
-4
proxy_test.go
proxy_test.go
+4
-4
No files found.
.gitignore
View file @
646de543
...
...
@@ -4,3 +4,4 @@ testdata/scratch
testdata/public
gitlab-zip-cat
gitlab-zip-metadata
_build
Makefile
View file @
646de543
PREFIX
=
/usr/local
VERSION
=
$(
shell
git describe
)
-
$(
shell
date
-u
+%Y%m%d.%H%M%S
)
GOBUILD
=
go build
-ldflags
"-X main.Version=
${VERSION}
"
GOPATH
=
$(
shell
pwd
)
/_build
GOBUILD
=
GOPATH
=
${GOPATH}
go build
-ldflags
"-X main.Version=
${VERSION}
"
PKG
=
gitlab.com/gitlab-org/gitlab-workhorse
all
:
gitlab-zip-cat gitlab-zip-metadata gitlab-workhorse
all
:
clean-build
gitlab-zip-cat gitlab-zip-metadata gitlab-workhorse
gitlab-zip-cat
:
$(shell find cmd/gitlab-zip-cat/ -name '*.go')
${GOBUILD}
-o
$@
.
/cmd/
$@
gitlab-zip-cat
:
_build
$(shell find cmd/gitlab-zip-cat/ -name '*.go')
${GOBUILD}
-o
$@
${PKG}
/cmd/
$@
gitlab-zip-metadata
:
$(shell find cmd/gitlab-zip-metadata/ -name '*.go')
${GOBUILD}
-o
$@
.
/cmd/
$@
gitlab-zip-metadata
:
_build
$(shell find cmd/gitlab-zip-metadata/ -name '*.go')
${GOBUILD}
-o
$@
${PKG}
/cmd/
$@
gitlab-workhorse
:
$(shell find . -name '*.go
')
${GOBUILD}
-o
$@
gitlab-workhorse
:
_build $(shell find . -name '*.go' | grep -v '^
\.
/_
')
${GOBUILD}
-o
$@
${PKG}
install
:
gitlab-workhorse gitlab-zip-cat gitlab-zip-metadata
mkdir
-p
$(DESTDIR)${PREFIX}
/bin/
install
gitlab-workhorse gitlab-zip-cat gitlab-zip-metadata
${DESTDIR}${PREFIX}
/bin/
_build
:
mkdir
-p
$@
/src/
${PKG}
tar
-cf
-
--exclude
src
--exclude
.git
.
|
\
(
cd
$@
/src/
${PKG}
&&
tar
-xf
-
)
touch
$@
.PHONY
:
test
test
:
testdata/data/group/test.git clean-workhorse all
go
fmt
.
/... |
awk
'{ print } END { if (NR > 0) { print "Please run go fmt"; exit 1 } }'
support/path go
test
.
/...
test
:
testdata/data/group/test.git clean-
build clean-
workhorse all
GOPATH
=
${GOPATH}
go
fmt
${PKG}
/... |
awk
'{ print } END { if (NR > 0) { print "Please run go fmt"; exit 1 } }'
GOPATH
=
${GOPATH}
support/path go
test
${PKG}
/...
@
echo
SUCCESS
coverage
:
testdata/data/group/test.git
...
...
@@ -38,9 +46,13 @@ testdata/data:
mkdir
-p
$@
.PHONY
:
clean
clean
:
clean-workhorse
clean
:
clean-workhorse
clean-build
rm
-rf
testdata/data testdata/scratch
.PHONY
:
clean-workhorse
clean-workhorse
:
rm
-f
gitlab-workhorse gitlab-zip-cat gitlab-zip-metadata
.PhONY
:
clean-build
clean-build
:
rm
-rf
_build
\ No newline at end of file
authorization_test.go
View file @
646de543
package
main
import
(
"./internal/api"
"./internal/helper"
"./internal/testhelper"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
"net/http"
"net/http/httptest"
"regexp"
...
...
cmd/gitlab-zip-cat/main.go
View file @
646de543
package
main
import
(
"../../internal/zipartifacts"
"archive/zip"
"flag"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/zipartifacts"
"io"
"os"
)
...
...
cmd/gitlab-zip-metadata/main.go
View file @
646de543
package
main
import
(
"../../internal/zipartifacts"
"flag"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/zipartifacts"
"os"
)
...
...
internal/api/api.go
View file @
646de543
package
api
import
(
"../badgateway"
"../helper"
"encoding/json"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/badgateway"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"io"
"io/ioutil"
"net/http"
...
...
internal/artifacts/artifact_download.go
View file @
646de543
package
artifacts
import
(
"../api"
"../helper"
"../zipartifacts"
"bufio"
"errors"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/zipartifacts"
"io"
"mime"
"net/http"
...
...
internal/artifacts/artifact_download_test.go
View file @
646de543
package
artifacts
import
(
"../api"
"../helper"
"../testhelper"
"archive/zip"
"encoding/base64"
"encoding/json"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
"io/ioutil"
"net/http"
"net/http/httptest"
...
...
internal/artifacts/artifacts_upload.go
View file @
646de543
package
artifacts
import
(
"../api"
"../helper"
"../upload"
"../zipartifacts"
"errors"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/upload"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/zipartifacts"
"io/ioutil"
"mime/multipart"
"net/http"
...
...
internal/artifacts/artifacts_upload_test.go
View file @
646de543
package
artifacts
import
(
"../api"
"../helper"
"../proxy"
"../testhelper"
"../zipartifacts"
"archive/zip"
"bytes"
"compress/gzip"
"encoding/json"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/proxy"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/zipartifacts"
"io"
"io/ioutil"
"mime/multipart"
...
...
internal/badgateway/roundtripper.go
View file @
646de543
package
badgateway
import
(
"../helper"
"bytes"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"io/ioutil"
"net"
"net/http"
...
...
internal/git/archive.go
View file @
646de543
...
...
@@ -5,9 +5,9 @@ In this file we handle 'git archive' downloads
package
git
import
(
"../helper"
"../senddata"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/senddata"
"io"
"io/ioutil"
"log"
...
...
internal/git/blob.go
View file @
646de543
package
git
import
(
"../helper"
"../senddata"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/senddata"
"io"
"log"
"net/http"
...
...
internal/git/git-http.go
View file @
646de543
...
...
@@ -5,11 +5,11 @@ In this file we handle the Git 'smart HTTP' protocol
package
git
import
(
"../api"
"../delay"
"../helper"
"errors"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/delay"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"io"
"log"
"net/http"
...
...
internal/lfs/lfs.go
View file @
646de543
...
...
@@ -5,13 +5,13 @@ In this file we handle git lfs objects downloads and uploads
package
lfs
import
(
"../api"
"../helper"
"bytes"
"crypto/sha256"
"encoding/hex"
"errors"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"io"
"io/ioutil"
"net/http"
...
...
internal/proxy/proxy.go
View file @
646de543
package
proxy
import
(
"
..
/badgateway"
"
..
/helper"
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/badgateway"
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/helper"
"net/http"
"net/http/httputil"
"net/url"
...
...
internal/sendfile/sendfile.go
View file @
646de543
...
...
@@ -7,7 +7,7 @@ via the X-Sendfile mechanism. All that is needed in the Rails code is the
package
sendfile
import
(
"
..
/helper"
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/helper"
"log"
"net/http"
)
...
...
internal/staticpages/deploy_page.go
View file @
646de543
package
staticpages
import
(
"
..
/helper"
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/helper"
"io/ioutil"
"net/http"
"path/filepath"
...
...
internal/staticpages/deploy_page_test.go
View file @
646de543
package
staticpages
import
(
"
..
/testhelper"
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/testhelper"
"io/ioutil"
"net/http"
"net/http/httptest"
...
...
internal/staticpages/error_pages.go
View file @
646de543
package
staticpages
import
(
"../helper"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"io/ioutil"
"log"
"net/http"
...
...
internal/staticpages/error_pages_test.go
View file @
646de543
package
staticpages
import
(
"../testhelper"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
"io/ioutil"
"net/http"
"net/http/httptest"
...
...
internal/staticpages/servefile.go
View file @
646de543
package
staticpages
import
(
"
..
/helper"
"
..
/urlprefix"
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/helper"
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/urlprefix"
"log"
"net/http"
"os"
...
...
internal/staticpages/servefile_test.go
View file @
646de543
package
staticpages
import
(
"../testhelper"
"bytes"
"compress/gzip"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
"io/ioutil"
"net/http"
"net/http/httptest"
...
...
internal/upload/uploads.go
View file @
646de543
package
upload
import
(
"../helper"
"bytes"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"io"
"io/ioutil"
"mime/multipart"
...
...
internal/upload/uploads_test.go
View file @
646de543
package
upload
import
(
"../helper"
"../proxy"
"../testhelper"
"bytes"
"errors"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/proxy"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
"io"
"io/ioutil"
"mime/multipart"
...
...
internal/upstream/development_test.go
View file @
646de543
package
upstream
import
(
"
..
/testhelper"
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/testhelper"
"net/http"
"net/http/httptest"
"testing"
...
...
internal/upstream/handlers.go
View file @
646de543
package
upstream
import
(
"../helper"
"compress/gzip"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"io"
"net/http"
)
...
...
internal/upstream/handlers_test.go
View file @
646de543
package
upstream
import
(
"../testhelper"
"bytes"
"compress/gzip"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
"io/ioutil"
"net/http"
"net/http/httptest"
...
...
internal/upstream/routes.go
View file @
646de543
package
upstream
import
(
apipkg
"
..
/api"
"
..
/artifacts"
"
..
/git"
"
..
/lfs"
proxypkg
"
..
/proxy"
"
..
/senddata"
"
..
/sendfile"
"
..
/staticpages"
apipkg
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/api"
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/artifacts"
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/git"
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/lfs"
proxypkg
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/proxy"
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/senddata"
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/sendfile"
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/staticpages"
"net/http"
"regexp"
)
...
...
internal/upstream/upstream.go
View file @
646de543
...
...
@@ -7,10 +7,10 @@ In this file we handle request routing and interaction with the authBackend.
package
upstream
import
(
"../badgateway"
"../helper"
"../urlprefix"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/badgateway"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/urlprefix"
"net/http"
"net/url"
"strings"
...
...
main.go
View file @
646de543
...
...
@@ -14,9 +14,9 @@ In this file we start the web server and hand off to the upstream type.
package
main
import
(
"./internal/upstream"
"flag"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/upstream"
"log"
"net"
"net/http"
...
...
main_test.go
View file @
646de543
package
main
import
(
"./internal/api"
"./internal/helper"
"./internal/testhelper"
"./internal/upstream"
"bytes"
"encoding/base64"
"encoding/json"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/upstream"
"io"
"io/ioutil"
"log"
...
...
proxy_test.go
View file @
646de543
package
main
import
(
"./internal/badgateway"
"./internal/helper"
"./internal/proxy"
"./internal/testhelper"
"bytes"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/badgateway"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/proxy"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
"io"
"net"
"net/http"
...
...
iv
@iv
mentioned in commit
a79fd7ad
·
Jan 20, 2017
mentioned in commit
a79fd7ad
mentioned in commit a79fd7ad3ef41939933a2496478f7f2fa6ba9939
Toggle commit list
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