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
Kazuhiko Shiozaki
gitlab-workhorse
Commits
70f191d2
Commit
70f191d2
authored
Dec 18, 2015
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move lfs into internal/lfs package
parent
eba05966
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
internal/lfs/lfs.go
internal/lfs/lfs.go
+8
-3
upstream.go
upstream.go
+2
-1
No files found.
lfs.go
→
internal/lfs/
lfs.go
View file @
70f191d2
...
...
@@ -2,11 +2,12 @@
In this file we handle git lfs objects downloads and uploads
*/
package
main
package
lfs
import
(
"./internal/api"
"./internal/helper"
"../api"
"../helper"
"../proxy"
"bytes"
"crypto/sha256"
"encoding/hex"
...
...
@@ -19,6 +20,10 @@ import (
"path/filepath"
)
func
PutStore
(
a
*
api
.
API
,
p
*
proxy
.
Proxy
)
http
.
HandlerFunc
{
return
lfsAuthorizeHandler
(
a
,
handleStoreLfsObject
(
p
))
}
func
lfsAuthorizeHandler
(
myAPI
*
api
.
API
,
handleFunc
api
.
HandleFunc
)
http
.
HandlerFunc
{
return
myAPI
.
PreAuthorizeHandler
(
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
,
a
*
api
.
Response
)
{
...
...
upstream.go
View file @
70f191d2
...
...
@@ -10,6 +10,7 @@ import (
"./internal/api"
"./internal/errorpage"
"./internal/git"
"./internal/lfs"
"./internal/proxy"
"fmt"
"log"
...
...
@@ -54,7 +55,7 @@ func (u *upstream) compileRoutes() {
route
{
"GET"
,
regexp
.
MustCompile
(
gitProjectPattern
+
`info/refs\z`
),
git
.
GetInfoRefs
(
u
.
API
)},
route
{
"POST"
,
regexp
.
MustCompile
(
gitProjectPattern
+
`git-upload-pack\z`
),
contentEncodingHandler
(
git
.
PostRPC
(
u
.
API
))},
route
{
"POST"
,
regexp
.
MustCompile
(
gitProjectPattern
+
`git-receive-pack\z`
),
contentEncodingHandler
(
git
.
PostRPC
(
u
.
API
))},
route
{
"PUT"
,
regexp
.
MustCompile
(
gitProjectPattern
+
`gitlab-lfs/objects/([0-9a-f]{64})/([0-9]+)\z`
),
lfs
AuthorizeHandler
(
u
.
API
,
handleStoreLfsObject
(
u
.
Proxy
)
)},
route
{
"PUT"
,
regexp
.
MustCompile
(
gitProjectPattern
+
`gitlab-lfs/objects/([0-9a-f]{64})/([0-9]+)\z`
),
lfs
.
PutStore
(
u
.
API
,
u
.
Proxy
)},
// Repository Archive
route
{
"GET"
,
regexp
.
MustCompile
(
projectPattern
+
`repository/archive\z`
),
git
.
GetArchive
(
u
.
API
)},
...
...
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