9 "go.stargrave.org/godlighty"
10 "go.stargrave.org/godlighty/rc"
13 func addGitRepoCfg(host, root, gitwebCfg string) {
14 godlighty.Hosts[host] = &godlighty.HostCfg{
15 EdDSATLS: newTLSCfg(host),
16 Hooks: []godlighty.Hook{
17 func(w http.ResponseWriter, r *http.Request) bool {
18 if r.URL.Path == "/" {
19 rc.Redirect(host, w, r, "//"+host+"/", http.StatusMovedPermanently)
24 func(w http.ResponseWriter, r *http.Request) bool {
25 rc.RunCGIAndLog(host, w, r, &cgi.Handler{
26 Path: "/usr/local/libexec/git-core/git-http-backend",
29 "GIT_PROJECT_ROOT=" + root,
30 "GIT_HTTP_EXPORT_ALL=",
38 godlighty.Hosts[host] = &godlighty.HostCfg{
39 Root: "/usr/local/share/gitweb",
40 EdDSATLS: newTLSCfg(host),
41 Hooks: []godlighty.Hook{
42 func(w http.ResponseWriter, r *http.Request) bool {
43 if r.URL.Path == "/" {
44 rc.RunCGIAndLog(host, w, r, &cgi.Handler{
45 Path: "/usr/local/share/gitweb/gitweb.cgi",
46 Env: []string{"GITWEB_CONFIG=" + gitwebCfg},
57 addGitRepoCfg("git.stargrave.org", "/home/git/pub", "/home/git/stargrave.org.conf")