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
d44febe6
Commit
d44febe6
authored
8 years ago
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separate imports
parent
85692df5
0.7.5-nxd
0.7.2
v0.7.8
v0.7.7
v0.7.6
v0.7.5
v0.7.4
v0.7.3
v0.7.2
No related merge requests found
Changes
29
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
90 additions
and
61 deletions
+90
-61
authorization_test.go
authorization_test.go
+4
-3
cmd/gitlab-zip-cat/main.go
cmd/gitlab-zip-cat/main.go
+2
-1
cmd/gitlab-zip-metadata/main.go
cmd/gitlab-zip-metadata/main.go
+2
-1
internal/api/api.go
internal/api/api.go
+3
-2
internal/artifacts/artifact_download.go
internal/artifacts/artifact_download.go
+4
-3
internal/artifacts/artifact_download_test.go
internal/artifacts/artifact_download_test.go
+4
-3
internal/artifacts/artifacts_upload.go
internal/artifacts/artifacts_upload.go
+5
-4
internal/artifacts/artifacts_upload_test.go
internal/artifacts/artifacts_upload_test.go
+6
-5
internal/badgateway/roundtripper.go
internal/badgateway/roundtripper.go
+2
-1
internal/git/archive.go
internal/git/archive.go
+3
-2
internal/git/blob.go
internal/git/blob.go
+3
-2
internal/git/git-http.go
internal/git/git-http.go
+4
-3
internal/lfs/lfs.go
internal/lfs/lfs.go
+3
-2
internal/proxy/proxy.go
internal/proxy/proxy.go
+3
-2
internal/sendfile/sendfile.go
internal/sendfile/sendfile.go
+2
-1
internal/staticpages/deploy_page.go
internal/staticpages/deploy_page.go
+2
-1
internal/staticpages/error_pages_test.go
internal/staticpages/error_pages_test.go
+2
-1
internal/staticpages/servefile.go
internal/staticpages/servefile.go
+3
-2
internal/staticpages/servefile_test.go
internal/staticpages/servefile_test.go
+2
-1
internal/upload/uploads.go
internal/upload/uploads.go
+2
-1
internal/upload/uploads_test.go
internal/upload/uploads_test.go
+4
-3
internal/upstream/development_test.go
internal/upstream/development_test.go
+2
-1
internal/upstream/handlers.go
internal/upstream/handlers.go
+2
-1
internal/upstream/handlers_test.go
internal/upstream/handlers_test.go
+2
-1
internal/upstream/routes.go
internal/upstream/routes.go
+3
-2
internal/upstream/upstream.go
internal/upstream/upstream.go
+4
-3
main.go
main.go
+2
-1
main_test.go
main_test.go
+5
-4
proxy_test.go
proxy_test.go
+5
-4
No files found.
authorization_test.go
View file @
d44febe6
...
...
@@ -2,13 +2,14 @@ package main
import
(
"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"
"testing"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
)
func
okHandler
(
w
http
.
ResponseWriter
,
_
*
http
.
Request
,
_
*
api
.
Response
)
{
...
...
This diff is collapsed.
Click to expand it.
cmd/gitlab-zip-cat/main.go
View file @
d44febe6
...
...
@@ -4,9 +4,10 @@ import (
"archive/zip"
"flag"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/zipartifacts"
"io"
"os"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/zipartifacts"
)
const
progName
=
"gitlab-zip-cat"
...
...
This diff is collapsed.
Click to expand it.
cmd/gitlab-zip-metadata/main.go
View file @
d44febe6
...
...
@@ -3,8 +3,9 @@ package main
import
(
"flag"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/zipartifacts"
"os"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/zipartifacts"
)
const
progName
=
"gitlab-zip-metadata"
...
...
This diff is collapsed.
Click to expand it.
internal/api/api.go
View file @
d44febe6
...
...
@@ -3,13 +3,14 @@ package api
import
(
"encoding/json"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/badgateway"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"io"
"io/ioutil"
"net/http"
"net/url"
"strings"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/badgateway"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
)
type
API
struct
{
...
...
This diff is collapsed.
Click to expand it.
internal/artifacts/artifact_download.go
View file @
d44febe6
...
...
@@ -4,9 +4,6 @@ import (
"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"
...
...
@@ -15,6 +12,10 @@ import (
"path/filepath"
"strings"
"syscall"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/zipartifacts"
)
func
detectFileContentType
(
fileName
string
)
string
{
...
...
This diff is collapsed.
Click to expand it.
internal/artifacts/artifact_download_test.go
View file @
d44febe6
...
...
@@ -5,14 +5,15 @@ import (
"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"
"os"
"testing"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
)
func
testArtifactDownloadServer
(
t
*
testing
.
T
,
archive
string
,
entry
string
)
*
httptest
.
Server
{
...
...
This diff is collapsed.
Click to expand it.
internal/artifacts/artifacts_upload.go
View file @
d44febe6
...
...
@@ -3,16 +3,17 @@ package artifacts
import
(
"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"
"os"
"os/exec"
"syscall"
"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"
)
type
artifactsUploadProcessor
struct
{
...
...
This diff is collapsed.
Click to expand it.
internal/artifacts/artifacts_upload_test.go
View file @
d44febe6
...
...
@@ -6,11 +6,6 @@ import (
"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"
...
...
@@ -18,6 +13,12 @@ import (
"net/http/httptest"
"os"
"testing"
"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"
)
func
testArtifactsUploadServer
(
t
*
testing
.
T
,
tempPath
string
)
*
httptest
.
Server
{
...
...
This diff is collapsed.
Click to expand it.
internal/badgateway/roundtripper.go
View file @
d44febe6
...
...
@@ -3,11 +3,12 @@ package badgateway
import
(
"bytes"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"io/ioutil"
"net"
"net/http"
"time"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
)
// Values from http.DefaultTransport
...
...
This diff is collapsed.
Click to expand it.
internal/git/archive.go
View file @
d44febe6
...
...
@@ -6,8 +6,6 @@ package git
import
(
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/senddata"
"io"
"io/ioutil"
"log"
...
...
@@ -18,6 +16,9 @@ import (
"path/filepath"
"syscall"
"time"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/senddata"
)
type
archive
struct
{
senddata
.
Prefix
}
...
...
This diff is collapsed.
Click to expand it.
internal/git/blob.go
View file @
d44febe6
...
...
@@ -2,12 +2,13 @@ package git
import
(
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/senddata"
"io"
"log"
"net/http"
"strings"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/senddata"
)
type
blob
struct
{
senddata
.
Prefix
}
...
...
This diff is collapsed.
Click to expand it.
internal/git/git-http.go
View file @
d44febe6
...
...
@@ -7,9 +7,6 @@ package git
import
(
"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"
...
...
@@ -17,6 +14,10 @@ import (
"path"
"path/filepath"
"strings"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/delay"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
)
func
GetInfoRefs
(
a
*
api
.
API
)
http
.
Handler
{
...
...
This diff is collapsed.
Click to expand it.
internal/lfs/lfs.go
View file @
d44febe6
...
...
@@ -10,13 +10,14 @@ import (
"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"
"os"
"path/filepath"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
)
func
PutStore
(
a
*
api
.
API
,
h
http
.
Handler
)
http
.
Handler
{
...
...
This diff is collapsed.
Click to expand it.
internal/proxy/proxy.go
View file @
d44febe6
package
proxy
import
(
"gitlab.com/gitlab-org/gitlab-workhorse/internal/badgateway"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"net/http"
"net/http/httputil"
"net/url"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/badgateway"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
)
type
Proxy
struct
{
...
...
This diff is collapsed.
Click to expand it.
internal/sendfile/sendfile.go
View file @
d44febe6
...
...
@@ -7,9 +7,10 @@ via the X-Sendfile mechanism. All that is needed in the Rails code is the
package
sendfile
import
(
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"log"
"net/http"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
)
const
sendFileResponseHeader
=
"X-Sendfile"
...
...
This diff is collapsed.
Click to expand it.
internal/staticpages/deploy_page.go
View file @
d44febe6
package
staticpages
import
(
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"io/ioutil"
"net/http"
"path/filepath"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
)
func
(
s
*
Static
)
DeployPage
(
handler
http
.
Handler
)
http
.
Handler
{
...
...
This diff is collapsed.
Click to expand it.
internal/staticpages/error_pages_test.go
View file @
d44febe6
...
...
@@ -2,13 +2,14 @@ package staticpages
import
(
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
"io/ioutil"
"net/http"
"net/http/httptest"
"os"
"path/filepath"
"testing"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
)
func
TestIfErrorPageIsPresented
(
t
*
testing
.
T
)
{
...
...
This diff is collapsed.
Click to expand it.
internal/staticpages/servefile.go
View file @
d44febe6
package
staticpages
import
(
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/urlprefix"
"log"
"net/http"
"os"
"path/filepath"
"strings"
"time"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/urlprefix"
)
type
CacheMode
int
...
...
This diff is collapsed.
Click to expand it.
internal/staticpages/servefile_test.go
View file @
d44febe6
...
...
@@ -3,13 +3,14 @@ package staticpages
import
(
"bytes"
"compress/gzip"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
"io/ioutil"
"net/http"
"net/http/httptest"
"os"
"path/filepath"
"testing"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
)
func
TestServingNonExistingFile
(
t
*
testing
.
T
)
{
...
...
This diff is collapsed.
Click to expand it.
internal/upload/uploads.go
View file @
d44febe6
...
...
@@ -3,12 +3,13 @@ package upload
import
(
"bytes"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"io"
"io/ioutil"
"mime/multipart"
"net/http"
"os"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
)
type
MultipartFormProcessor
interface
{
...
...
This diff is collapsed.
Click to expand it.
internal/upload/uploads_test.go
View file @
d44febe6
...
...
@@ -4,9 +4,6 @@ import (
"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"
...
...
@@ -16,6 +13,10 @@ import (
"regexp"
"strings"
"testing"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/proxy"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
)
var
nilHandler
=
http
.
HandlerFunc
(
func
(
http
.
ResponseWriter
,
*
http
.
Request
)
{})
...
...
This diff is collapsed.
Click to expand it.
internal/upstream/development_test.go
View file @
d44febe6
package
upstream
import
(
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
"net/http"
"net/http/httptest"
"testing"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
)
func
TestDevelopmentModeEnabled
(
t
*
testing
.
T
)
{
...
...
This diff is collapsed.
Click to expand it.
internal/upstream/handlers.go
View file @
d44febe6
...
...
@@ -3,9 +3,10 @@ package upstream
import
(
"compress/gzip"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"io"
"net/http"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
)
func
contentEncodingHandler
(
h
http
.
Handler
)
http
.
Handler
{
...
...
This diff is collapsed.
Click to expand it.
internal/upstream/handlers_test.go
View file @
d44febe6
...
...
@@ -4,12 +4,13 @@ import (
"bytes"
"compress/gzip"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
"io/ioutil"
"net/http"
"net/http/httptest"
"reflect"
"testing"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
)
func
TestGzipEncoding
(
t
*
testing
.
T
)
{
...
...
This diff is collapsed.
Click to expand it.
internal/upstream/routes.go
View file @
d44febe6
package
upstream
import
(
"net/http"
"regexp"
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"
...
...
@@ -9,8 +12,6 @@ import (
"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"
)
type
route
struct
{
...
...
This diff is collapsed.
Click to expand it.
internal/upstream/upstream.go
View file @
d44febe6
...
...
@@ -8,13 +8,14 @@ package upstream
import
(
"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"
"time"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/badgateway"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/urlprefix"
)
var
DefaultBackend
=
helper
.
URLMustParse
(
"http://localhost:8080"
)
...
...
This diff is collapsed.
Click to expand it.
main.go
View file @
d44febe6
...
...
@@ -16,7 +16,6 @@ package main
import
(
"flag"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/upstream"
"log"
"net"
"net/http"
...
...
@@ -24,6 +23,8 @@ import (
"os"
"syscall"
"time"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/upstream"
)
// Current version of GitLab Workhorse
...
...
This diff is collapsed.
Click to expand it.
main_test.go
View file @
d44febe6
...
...
@@ -5,10 +5,6 @@ import (
"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"
...
...
@@ -22,6 +18,11 @@ import (
"strings"
"testing"
"time"
"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"
)
const
scratchDir
=
"testdata/scratch"
...
...
This diff is collapsed.
Click to expand it.
proxy_test.go
View file @
d44febe6
...
...
@@ -3,10 +3,6 @@ package main
import
(
"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"
...
...
@@ -14,6 +10,11 @@ import (
"regexp"
"testing"
"time"
"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"
)
func
newProxy
(
url
string
,
rt
*
badgateway
.
RoundTripper
)
*
proxy
.
Proxy
{
...
...
This diff is collapsed.
Click to expand it.
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