···2 <picture>
3 <img alt="ugit logo" width="250" src="./assets/ugit.svg" />
4 </picture>
5- <h3 align="center">ugit</h3>
6</p>
78Minimal git server
910-ugit allows cloning via HTTPS/SSH, but can only be pushed to via SSH.
1112-There are no plans to directly support issues or PR workflows, although webhooks are planned and auxillary software may be created to facilitate these things.
13-For now, if you wish to collaborate, please send me patches at [ugit@jolheiser.com](mailto:git@jolheiser.com).
01415-Currently all HTML is allowed in markdown, ugit is intended to be run by/for a trusted user.
1617## Getting your public SSH keys from another forge
18
···2 <picture>
3 <img alt="ugit logo" width="250" src="./assets/ugit.svg" />
4 </picture>
5+ <h3 align="center">ยตgit</h3>
6</p>
78Minimal git server
910+ยตgit allows cloning via HTTPS/SSH, but can only be pushed to via SSH.
1112+There are no plans to directly support issues or PR workflows.
13+If you wish to collaborate, please send me patches via [github](https://github.com/jolheiser/ugit) or [tangled](https://tangled.org/@jolheiser.com/ugit).
14+For issue/bug-tracking, I recommend [git-bug](https://github.com/git-bug/git-bug).
1516+Currently all HTML is allowed in markdown, ยตgit is intended to be run by/for a trusted user.
1718## Getting your public SSH keys from another forge
19
···18// Server is the container struct for the HTTP server
19type Server struct {
20 port int
21- mux *chi.Mux
22}
2324// ListenAndServe simply wraps http.ListenAndServe to contain the functionality here
25func (s Server) ListenAndServe() error {
26- return http.ListenAndServe(fmt.Sprintf("localhost:%d", s.port), s.mux)
27}
2829// Settings is the configuration for the HTTP server
···34 Port int
35 RepoDir string
36 Profile Profile
037}
3839// Profile is the index profile
···101 r.Get("/tailwind.css", html.TailwindHandler)
102 })
103104- return Server{mux: mux, port: settings.Port}
105}
106107type repoHandler struct {
···115 }
116}
1170000000118func (rh repoHandler) repoHeaderContext(repo *git.Repo, r *http.Request) html.RepoHeaderComponentContext {
119 ref := chi.URLParam(r, "ref")
120 if ref == "" {
···125 Name: chi.URLParam(r, "repo"),
126 Ref: ref,
127 CloneURL: rh.s.CloneURL,
0000000000000128 }
129}
130
···18// Server is the container struct for the HTTP server
19type Server struct {
20 port int
21+ Mux *chi.Mux
22}
2324// ListenAndServe simply wraps http.ListenAndServe to contain the functionality here
25func (s Server) ListenAndServe() error {
26+ return http.ListenAndServe(fmt.Sprintf("localhost:%d", s.port), s.Mux)
27}
2829// Settings is the configuration for the HTTP server
···34 Port int
35 RepoDir string
36 Profile Profile
37+ ShowPrivate bool
38}
3940// Profile is the index profile
···102 r.Get("/tailwind.css", html.TailwindHandler)
103 })
104105+ return Server{Mux: mux, port: settings.Port}
106}
107108type repoHandler struct {
···116 }
117}
118119+func (rh repoHandler) repoBaseContext(repo *git.Repo) html.BaseContext {
120+ return html.BaseContext{
121+ Title: repo.Name(),
122+ Description: repo.Meta.Description,
123+ }
124+}
125+126func (rh repoHandler) repoHeaderContext(repo *git.Repo, r *http.Request) html.RepoHeaderComponentContext {
127 ref := chi.URLParam(r, "ref")
128 if ref == "" {
···133 Name: chi.URLParam(r, "repo"),
134 Ref: ref,
135 CloneURL: rh.s.CloneURL,
136+ Tags: repo.Meta.Tags.Slice(),
137+ }
138+}
139+140+func (rh repoHandler) repoBreadcrumbContext(repo *git.Repo, r *http.Request, path string) html.RepoBreadcrumbComponentContext {
141+ ref := chi.URLParam(r, "ref")
142+ if ref == "" {
143+ ref, _ = repo.DefaultBranch()
144+ }
145+ return html.RepoBreadcrumbComponentContext{
146+ Repo: chi.URLParam(r, "repo"),
147+ Ref: ref,
148+ Path: path,
149 }
150}
151