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
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-workhorse
Commits
646de543
Commit
646de543
authored
Mar 19, 2016
by
Jacob Vosmaer
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
...
@@ -4,3 +4,4 @@ testdata/scratch
testdata/public
testdata/public
gitlab-zip-cat
gitlab-zip-cat
gitlab-zip-metadata
gitlab-zip-metadata
_build
Makefile
View file @
646de543
PREFIX
=
/usr/local
PREFIX
=
/usr/local
VERSION
=
$(
shell
git describe
)
-
$(
shell
date
-u
+%Y%m%d.%H%M%S
)
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')
gitlab-zip-cat
:
_build
$(shell find cmd/gitlab-zip-cat/ -name '*.go')
${GOBUILD}
-o
$@
.
/cmd/
$@
${GOBUILD}
-o
$@
${PKG}
/cmd/
$@
gitlab-zip-metadata
:
$(shell find cmd/gitlab-zip-metadata/ -name '*.go')
gitlab-zip-metadata
:
_build
$(shell find cmd/gitlab-zip-metadata/ -name '*.go')
${GOBUILD}
-o
$@
.
/cmd/
$@
${GOBUILD}
-o
$@
${PKG}
/cmd/
$@
gitlab-workhorse
:
$(shell find . -name '*.go
')
gitlab-workhorse
:
_build $(shell find . -name '*.go' | grep -v '^
\.
/_
')
${GOBUILD}
-o
$@
${GOBUILD}
-o
$@
${PKG}
install
:
gitlab-workhorse gitlab-zip-cat gitlab-zip-metadata
install
:
gitlab-workhorse gitlab-zip-cat gitlab-zip-metadata
mkdir
-p
$(DESTDIR)${PREFIX}
/bin/
mkdir
-p
$(DESTDIR)${PREFIX}
/bin/
install
gitlab-workhorse gitlab-zip-cat gitlab-zip-metadata
${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
.PHONY
:
test
test
:
testdata/data/group/test.git clean-workhorse all
test
:
testdata/data/group/test.git clean-
build clean-
workhorse all
go
fmt
.
/... |
awk
'{ print } END { if (NR > 0) { print "Please run go fmt"; exit 1 } }'
GOPATH
=
${GOPATH}
go
fmt
${PKG}
/... |
awk
'{ print } END { if (NR > 0) { print "Please run go fmt"; exit 1 } }'
support/path go
test
.
/...
GOPATH
=
${GOPATH}
support/path go
test
${PKG}
/...
@
echo
SUCCESS
@
echo
SUCCESS
coverage
:
testdata/data/group/test.git
coverage
:
testdata/data/group/test.git
...
@@ -38,9 +46,13 @@ testdata/data:
...
@@ -38,9 +46,13 @@ testdata/data:
mkdir
-p
$@
mkdir
-p
$@
.PHONY
:
clean
.PHONY
:
clean
clean
:
clean-workhorse
clean
:
clean-workhorse
clean-build
rm
-rf
testdata/data testdata/scratch
rm
-rf
testdata/data testdata/scratch
.PHONY
:
clean-workhorse
.PHONY
:
clean-workhorse
clean-workhorse
:
clean-workhorse
:
rm
-f
gitlab-workhorse gitlab-zip-cat gitlab-zip-metadata
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
package
main
import
(
import
(
"./internal/api"
"./internal/helper"
"./internal/testhelper"
"fmt"
"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"
"net/http/httptest"
"net/http/httptest"
"regexp"
"regexp"
...
...
cmd/gitlab-zip-cat/main.go
View file @
646de543
package
main
package
main
import
(
import
(
"../../internal/zipartifacts"
"archive/zip"
"archive/zip"
"flag"
"flag"
"fmt"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/zipartifacts"
"io"
"io"
"os"
"os"
)
)
...
...
cmd/gitlab-zip-metadata/main.go
View file @
646de543
package
main
package
main
import
(
import
(
"../../internal/zipartifacts"
"flag"
"flag"
"fmt"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/zipartifacts"
"os"
"os"
)
)
...
...
internal/api/api.go
View file @
646de543
package
api
package
api
import
(
import
(
"../badgateway"
"../helper"
"encoding/json"
"encoding/json"
"fmt"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/badgateway"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"io"
"io"
"io/ioutil"
"io/ioutil"
"net/http"
"net/http"
...
...
internal/artifacts/artifact_download.go
View file @
646de543
package
artifacts
package
artifacts
import
(
import
(
"../api"
"../helper"
"../zipartifacts"
"bufio"
"bufio"
"errors"
"errors"
"fmt"
"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"
"io"
"mime"
"mime"
"net/http"
"net/http"
...
...
internal/artifacts/artifact_download_test.go
View file @
646de543
package
artifacts
package
artifacts
import
(
import
(
"../api"
"../helper"
"../testhelper"
"archive/zip"
"archive/zip"
"encoding/base64"
"encoding/base64"
"encoding/json"
"encoding/json"
"fmt"
"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"
"io/ioutil"
"net/http"
"net/http"
"net/http/httptest"
"net/http/httptest"
...
...
internal/artifacts/artifacts_upload.go
View file @
646de543
package
artifacts
package
artifacts
import
(
import
(
"../api"
"../helper"
"../upload"
"../zipartifacts"
"errors"
"errors"
"fmt"
"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"
"io/ioutil"
"mime/multipart"
"mime/multipart"
"net/http"
"net/http"
...
...
internal/artifacts/artifacts_upload_test.go
View file @
646de543
package
artifacts
package
artifacts
import
(
import
(
"../api"
"../helper"
"../proxy"
"../testhelper"
"../zipartifacts"
"archive/zip"
"archive/zip"
"bytes"
"bytes"
"compress/gzip"
"compress/gzip"
"encoding/json"
"encoding/json"
"fmt"
"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"
"io/ioutil"
"io/ioutil"
"mime/multipart"
"mime/multipart"
...
...
internal/badgateway/roundtripper.go
View file @
646de543
package
badgateway
package
badgateway
import
(
import
(
"../helper"
"bytes"
"bytes"
"fmt"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"io/ioutil"
"io/ioutil"
"net"
"net"
"net/http"
"net/http"
...
...
internal/git/archive.go
View file @
646de543
...
@@ -5,9 +5,9 @@ In this file we handle 'git archive' downloads
...
@@ -5,9 +5,9 @@ In this file we handle 'git archive' downloads
package
git
package
git
import
(
import
(
"../helper"
"../senddata"
"fmt"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/senddata"
"io"
"io"
"io/ioutil"
"io/ioutil"
"log"
"log"
...
...
internal/git/blob.go
View file @
646de543
package
git
package
git
import
(
import
(
"../helper"
"../senddata"
"fmt"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/senddata"
"io"
"io"
"log"
"log"
"net/http"
"net/http"
...
...
internal/git/git-http.go
View file @
646de543
...
@@ -5,11 +5,11 @@ In this file we handle the Git 'smart HTTP' protocol
...
@@ -5,11 +5,11 @@ In this file we handle the Git 'smart HTTP' protocol
package
git
package
git
import
(
import
(
"../api"
"../delay"
"../helper"
"errors"
"errors"
"fmt"
"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"
"io"
"log"
"log"
"net/http"
"net/http"
...
...
internal/lfs/lfs.go
View file @
646de543
...
@@ -5,13 +5,13 @@ In this file we handle git lfs objects downloads and uploads
...
@@ -5,13 +5,13 @@ In this file we handle git lfs objects downloads and uploads
package
lfs
package
lfs
import
(
import
(
"../api"
"../helper"
"bytes"
"bytes"
"crypto/sha256"
"crypto/sha256"
"encoding/hex"
"encoding/hex"
"errors"
"errors"
"fmt"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"io"
"io"
"io/ioutil"
"io/ioutil"
"net/http"
"net/http"
...
...
internal/proxy/proxy.go
View file @
646de543
package
proxy
package
proxy
import
(
import
(
"
..
/badgateway"
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/badgateway"
"
..
/helper"
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/helper"
"net/http"
"net/http"
"net/http/httputil"
"net/http/httputil"
"net/url"
"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
...
@@ -7,7 +7,7 @@ via the X-Sendfile mechanism. All that is needed in the Rails code is the
package
sendfile
package
sendfile
import
(
import
(
"
..
/helper"
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/helper"
"log"
"log"
"net/http"
"net/http"
)
)
...
...
internal/staticpages/deploy_page.go
View file @
646de543
package
staticpages
package
staticpages
import
(
import
(
"
..
/helper"
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/helper"
"io/ioutil"
"io/ioutil"
"net/http"
"net/http"
"path/filepath"
"path/filepath"
...
...
internal/staticpages/deploy_page_test.go
View file @
646de543
package
staticpages
package
staticpages
import
(
import
(
"
..
/testhelper"
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/testhelper"
"io/ioutil"
"io/ioutil"
"net/http"
"net/http"
"net/http/httptest"
"net/http/httptest"
...
...
internal/staticpages/error_pages.go
View file @
646de543
package
staticpages
package
staticpages
import
(
import
(
"../helper"
"fmt"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"io/ioutil"
"io/ioutil"
"log"
"log"
"net/http"
"net/http"
...
...
internal/staticpages/error_pages_test.go
View file @
646de543
package
staticpages
package
staticpages
import
(
import
(
"../testhelper"
"fmt"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
"io/ioutil"
"io/ioutil"
"net/http"
"net/http"
"net/http/httptest"
"net/http/httptest"
...
...
internal/staticpages/servefile.go
View file @
646de543
package
staticpages
package
staticpages
import
(
import
(
"
..
/helper"
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/helper"
"
..
/urlprefix"
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/urlprefix"
"log"
"log"
"net/http"
"net/http"
"os"
"os"
...
...
internal/staticpages/servefile_test.go
View file @
646de543
package
staticpages
package
staticpages
import
(
import
(
"../testhelper"
"bytes"
"bytes"
"compress/gzip"
"compress/gzip"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
"io/ioutil"
"io/ioutil"
"net/http"
"net/http"
"net/http/httptest"
"net/http/httptest"
...
...
internal/upload/uploads.go
View file @
646de543
package
upload
package
upload
import
(
import
(
"../helper"
"bytes"
"bytes"
"fmt"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"io"
"io"
"io/ioutil"
"io/ioutil"
"mime/multipart"
"mime/multipart"
...
...
internal/upload/uploads_test.go
View file @
646de543
package
upload
package
upload
import
(
import
(
"../helper"
"../proxy"
"../testhelper"
"bytes"
"bytes"
"errors"
"errors"
"fmt"
"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"
"io/ioutil"
"io/ioutil"
"mime/multipart"
"mime/multipart"
...
...
internal/upstream/development_test.go
View file @
646de543
package
upstream
package
upstream
import
(
import
(
"
..
/testhelper"
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/testhelper"
"net/http"
"net/http"
"net/http/httptest"
"net/http/httptest"
"testing"
"testing"
...
...
internal/upstream/handlers.go
View file @
646de543
package
upstream
package
upstream
import
(
import
(
"../helper"
"compress/gzip"
"compress/gzip"
"fmt"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"io"
"io"
"net/http"
"net/http"
)
)
...
...
internal/upstream/handlers_test.go
View file @
646de543
package
upstream
package
upstream
import
(
import
(
"../testhelper"
"bytes"
"bytes"
"compress/gzip"
"compress/gzip"
"fmt"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
"io/ioutil"
"io/ioutil"
"net/http"
"net/http"
"net/http/httptest"
"net/http/httptest"
...
...
internal/upstream/routes.go
View file @
646de543
package
upstream
package
upstream
import
(
import
(
apipkg
"
..
/api"
apipkg
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/api"
"
..
/artifacts"
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/artifacts"
"
..
/git"
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/git"
"
..
/lfs"
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/lfs"
proxypkg
"
..
/proxy"
proxypkg
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/proxy"
"
..
/senddata"
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/senddata"
"
..
/sendfile"
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/sendfile"
"
..
/staticpages"
"
gitlab.com/gitlab-org/gitlab-workhorse/internal
/staticpages"
"net/http"
"net/http"
"regexp"
"regexp"
)
)
...
...
internal/upstream/upstream.go
View file @
646de543
...
@@ -7,10 +7,10 @@ In this file we handle request routing and interaction with the authBackend.
...
@@ -7,10 +7,10 @@ In this file we handle request routing and interaction with the authBackend.
package
upstream
package
upstream
import
(
import
(
"../badgateway"
"../helper"
"../urlprefix"
"fmt"
"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/http"
"net/url"
"net/url"
"strings"
"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.
...
@@ -14,9 +14,9 @@ In this file we start the web server and hand off to the upstream type.
package
main
package
main
import
(
import
(
"./internal/upstream"
"flag"
"flag"
"fmt"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/upstream"
"log"
"log"
"net"
"net"
"net/http"
"net/http"
...
...
main_test.go
View file @
646de543
package
main
package
main
import
(
import
(
"./internal/api"
"./internal/helper"
"./internal/testhelper"
"./internal/upstream"
"bytes"
"bytes"
"encoding/base64"
"encoding/base64"
"encoding/json"
"encoding/json"
"fmt"
"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"
"io/ioutil"
"io/ioutil"
"log"
"log"
...
...
proxy_test.go
View file @
646de543
package
main
package
main
import
(
import
(
"./internal/badgateway"
"./internal/helper"
"./internal/proxy"
"./internal/testhelper"
"bytes"
"bytes"
"fmt"
"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"
"io"
"net"
"net"
"net/http"
"net/http"
...
...
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