7 "go.stargrave.org/godlighty"
10 func addGitRepoCfg(host, root, gitwebCfg string) {
11 godlighty.Hosts[host] = &godlighty.HostCfg{
13 Hooks: []godlighty.Hook{
14 func(w http.ResponseWriter, r *http.Request) bool {
15 if r.URL.Path == "/" {
16 http.Redirect(w, r, "//"+host+"/", http.StatusMovedPermanently)
21 func(w http.ResponseWriter, r *http.Request) bool {
22 runCGIAndLog(host, w, r, &cgi.Handler{
23 Path: "/usr/local/libexec/git-core/git-http-backend",
26 "GIT_PROJECT_ROOT=" + root,
27 "GIT_HTTP_EXPORT_ALL=",
35 godlighty.Hosts[host] = &godlighty.HostCfg{
36 Root: "/usr/local/share/gitweb",
38 Hooks: []godlighty.Hook{
39 func(w http.ResponseWriter, r *http.Request) bool {
40 if r.URL.Path == "/" {
41 runCGIAndLog(host, w, r, &cgi.Handler{
42 Path: "/usr/local/share/gitweb/gitweb.cgi",
43 Env: []string{"GITWEB_CONFIG=" + gitwebCfg},
54 addGitRepoCfg("git.stargrave.org", "/home/git/pub", "/home/git/stargrave.org.conf")