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