Skip to content

Commit 46f0dcc

Browse files
author
rubyist
committed
Support urls hanging off the root instead of user/repo
1 parent 8169ce8 commit 46f0dcc

6 files changed

Lines changed: 21 additions & 13 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ To use the LFS test server with the Git LFS client, configure it in the reposito
5959

6060
```
6161
[lfs]
62-
url = "http://localhost:8080/janedoe/lfsrepo"
62+
url = "http://localhost:8080/"
6363
6464
```
6565

@@ -69,7 +69,7 @@ NOTE: If using https with a self signed cert also disable cert checking in the c
6969

7070
```
7171
[lfs]
72-
url = "https://localhost:8080/jimdoe/lfsrepo"
72+
url = "https://localhost:8080/"
7373
7474
[http]
7575
sslverify = false

mgmt-css.rice-box.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func init() {
3030
// register embeddedBox
3131
embedded.RegisterEmbeddedBox(`mgmt/css`, &embedded.EmbeddedBox{
3232
Name: `mgmt/css`,
33-
Time: time.Unix(1430921736, 0),
33+
Time: time.Unix(1443556486, 0),
3434
Dirs: map[string]*embedded.EmbeddedDir{
3535
"": dir1,
3636
},

mgmt-templates.rice-box.go

Lines changed: 9 additions & 9 deletions
Large diffs are not rendered by default.

mgmt/templates/config.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<p>To configure a repository to use this LFS server, add the following to the repository's <code>.gitconfig</code> file:</p>
99
<pre>
1010
<code>[lfs]
11-
url = "{{.Config.Scheme}}://{{.Config.Host}}/user/repo"
11+
url = "{{.Config.Scheme}}://{{.Config.Host}}/"
1212
</code>
1313
</pre>
1414

server.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,14 @@ func NewApp(content *ContentStore, meta *MetaStore) *App {
8989

9090
r.HandleFunc("/{user}/{repo}/objects", app.PostHandler).Methods("POST").MatcherFunc(MetaMatcher)
9191

92+
r.HandleFunc("/objects/batch", app.BatchHandler).Methods("POST").MatcherFunc(MetaMatcher)
93+
route = "/objects/{oid}"
94+
r.HandleFunc(route, app.GetContentHandler).Methods("GET", "HEAD").MatcherFunc(ContentMatcher)
95+
r.HandleFunc(route, app.GetMetaHandler).Methods("GET", "HEAD").MatcherFunc(MetaMatcher)
96+
r.HandleFunc(route, app.PutHandler).Methods("PUT").MatcherFunc(ContentMatcher)
97+
98+
r.HandleFunc("/objects", app.PostHandler).Methods("POST").MatcherFunc(MetaMatcher)
99+
92100
app.addMgmt(r)
93101

94102
app.router = r
File renamed without changes.

0 commit comments

Comments
 (0)