vole
Clone
Read only, no credentials:
https://rodent.software/git/vole.git
Write over SSH with a registered key:
git clone ssh://git@0.0.0.0:2222/vole.git
A free and open-source forge that lives in your Git repo.
refactor
c5902451905acdaa478f8476844ccd4a510d9ca9 · Keenan Nemetz · 16d ago · parent ec2aba4b
internal/transport/transport.go → server/githttp/githttp.go +5−5
| @@ -1,11 +1,11 @@ | |||
| 1 | // Package transport serves anonymous, read-only git over smart HTTP. | ||
| 1 | // Package githttp serves anonymous, read-only git over smart HTTP. | ||
| 2 | 2 | // | |
| 3 | 3 | // Writes live on SSH, so this package has no push path at all: no chunked | |
| 4 | 4 | // spooling, no push semaphore, no byte cap. Those existed only for POST bodies | |
| 5 | 5 | // that carried packs. What remains is upload-pack behind a visibility check. | |
| 6 | 6 | // Private repositories answer 404 rather than 403, because a 403 confirms that | |
| 7 | 7 | // the repository exists. | |
| 8 | package transport | ||
| 8 | package githttp | ||
| 9 | 9 | ||
| 10 | 10 | import ( | |
| 11 | 11 | "bufio" | |
| @@ -20,8 +20,8 @@ import ( | |||
| 20 | 20 | "strings" | |
| 21 | 21 | "sync/atomic" | |
| 22 | 22 | ||
| 23 | "github.com/rodent-software/vole/internal/acl" | ||
| 24 | "github.com/rodent-software/vole/internal/repo" | ||
| 23 | "github.com/rodent-software/vole/forge/access" | ||
| 24 | "github.com/rodent-software/vole/forge/repo" | ||
| 25 | 25 | ) | |
| 26 | 26 | ||
| 27 | 27 | type Config struct { | |
| @@ -114,7 +114,7 @@ func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) { | |||
| 114 | 114 | } | |
| 115 | 115 | // The reader has no identity here, so the default role is the only thing | |
| 116 | 116 | // that can grant access. Anything else is indistinguishable from absent. | |
| 117 | if !a.Can("", acl.Read) { | ||
| 117 | if !a.Can("", access.Read) { | ||
| 118 | 118 | p.stats.hidden.Add(1) | |
| 119 | 119 | http.NotFound(w, r) | |
| 120 | 120 | return | |