this repo has no description

legit: user repo listing

This probably doesn't matter since this will be revamped into some kind
of profile page anyway.

Changed files
+7 -6
legit
+2 -2
config.yaml
··· 9 9 - master 10 10 - main 11 11 dirs: 12 - templates: ./templates 13 - static: ./static 12 + templates: ./legit/templates 13 + static: ./legit/static 14 14 meta: 15 15 title: icy does git 16 16 description: come get your free software
+1 -1
go.mod
··· 10 10 github.com/go-git/go-git/v5 v5.12.0 11 11 github.com/microcosm-cc/bluemonday v1.0.27 12 12 github.com/russross/blackfriday/v2 v2.1.0 13 - golang.org/x/sys v0.26.0 14 13 gopkg.in/yaml.v3 v3.0.1 15 14 ) 16 15 ··· 36 35 github.com/xanzy/ssh-agent v0.3.3 // indirect 37 36 golang.org/x/crypto v0.28.0 // indirect 38 37 golang.org/x/net v0.30.0 // indirect 38 + golang.org/x/sys v0.26.0 // indirect 39 39 gopkg.in/warnings.v0 v0.1.2 // indirect 40 40 ) 41 41
+1 -1
legit/routes/handler.go
··· 33 33 r := chi.NewRouter() 34 34 d := deps{c} 35 35 36 - r.Get("/", d.Index) 37 36 r.Get("/static/{file}", d.ServeStatic) 38 37 39 38 r.Route("/@{user}", func(r chi.Router) { 39 + r.Get("/", d.Index) 40 40 r.Route("/{name}", func(r chi.Router) { 41 41 r.Get("/", d.Multiplex) 42 42 r.Post("/", d.Multiplex)
+3 -2
legit/routes/routes.go
··· 25 25 } 26 26 27 27 func (d *deps) Index(w http.ResponseWriter, r *http.Request) { 28 - dirs, err := os.ReadDir(d.c.Repo.ScanPath) 28 + user := "@" + chi.URLParam(r, "user") 29 + path := filepath.Join(d.c.Repo.ScanPath, user) 30 + dirs, err := os.ReadDir(path) 29 31 if err != nil { 30 32 d.Write500(w) 31 33 log.Printf("reading scan path: %s", err) ··· 45 47 continue 46 48 } 47 49 48 - path := filepath.Join(d.c.Repo.ScanPath, name) 49 50 gr, err := git.Open(path, "") 50 51 if err != nil { 51 52 log.Println(err)