website: remove remaining remnants of gitweb

Change-Id: I1e684cc7551fa69f77c755db3112d79035effcee
This commit is contained in:
Will Norris 2018-01-01 09:47:12 +00:00
parent 1d4d49ad7a
commit b96e2dcbc2
3 changed files with 0 additions and 95 deletions

View File

@ -458,12 +458,6 @@ func serveFile(w http.ResponseWriter, r *http.Request, relPath, absPath string)
})
}
func isBot(r *http.Request) bool {
agent := r.Header.Get("User-Agent")
return strings.Contains(agent, "Baidu") || strings.Contains(agent, "bingbot") ||
strings.Contains(agent, "Ezooms") || strings.Contains(agent, "Googlebot")
}
// redirectRootHandler redirects users to strip off "www." prefixes
// and redirects http to https.
type redirectRootHandler struct {
@ -471,14 +465,6 @@ type redirectRootHandler struct {
}
func (h *redirectRootHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
// Some bots (especially Baidu) don't seem to respect robots.txt and swamp gitweb.cgi,
// so explicitly protect it from bots.
if ru := r.URL.RequestURI(); strings.Contains(ru, "/code/") && strings.Contains(ru, "?") && isBot(r) {
http.Error(rw, "bye", http.StatusUnauthorized)
log.Printf("bot denied")
return
}
if goget := r.FormValue("go-get"); goget == "1" {
// do not redirect on a go get request, because we want to be able to serve the
// "go-import" meta for camlistore.org, and not just for perkeep.org
@ -1135,25 +1121,6 @@ func redirTo(dest string) http.Handler {
})
}
// Not sure what's making these broken URLs like:
//
// http://localhost:8080/code/?p=camlistore.git%3Bf=doc/json-signing/json-signing.txt%3Bhb=master
//
// ... but something is. Maybe Buzz? For now just re-write them
// . Doesn't seem to be a bug in the CGI implementation, though, which
// is what I'd originally suspected.
/*
func (fu *fixUpGitwebUrls) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
oldUrl := req.URL.String()
newUrl := strings.Replace(oldUrl, "%3B", ";", -1)
if newUrl == oldUrl {
fu.handler.ServeHTTP(rw, req)
return
}
http.Redirect(rw, req, newUrl, http.StatusFound)
}
*/
func ipHandler(w http.ResponseWriter, r *http.Request) {
out, _ := exec.Command("ip", "-f", "inet", "addr", "show", "dev", "eth0").Output()
str := string(out)

View File

@ -1,35 +0,0 @@
# path to git projects (<project>.git)
$projectroot = "$ENV{CAMWEB_GITDIR}";
# directory to use for temp files
$git_temp = "/tmp";
# target of the home link on top of all pages
#$home_link = $my_uri || "/";
# html text to include at home page
#$home_text = "";
# file with project list; by default, simply scan the projectroot dir.
$projects_list = $projectroot;
# stylesheet to use
$stylesheet = "/code/gitweb.css";
# javascript code for gitweb
$javascript = "/code/gitweb.js";
# logo to use
$logo = "/code/git-logo.png";
# the 'favicon'
$favicon = "/code/git-favicon.png";
$site_name = "Camlistore Git";
$site_header = "$ENV{CAMWEB_ROOT}/tmpl/githeader.html";
$home_link_str = "repos";
$my_uri = "/code/";

View File

@ -1,27 +0,0 @@
<link rel="stylesheet" href="/static/all.css" type="text/css" media="all" charset="utf-8" />
<div id='header'>
<a href="/"><img width='788' height='161' src='/static/camli-header.jpg' title="Perkeep" border='0' /></a>
</div>
<center><div style="display:block; max-width: 788px;">
<div class='bar'><div class='hatecss'>
<a href='/'>About</a>
<a href='/doc/'>Docs</a>
<a href='/code/'>Code</a>
<a href='/contributors'>Who</a>
<a href='/lists'>Lists</a>
<a href='https://github.com/camlistore/camlistore/issues'>Bugs</a>
</div></div>
</div>
<div style="font-size: 120%">
<code>
$ git clone https://camlistore.googlesource.com/camlistore
</code>
</div>
<div style="margin: 1em 0">
Want to <a href="/doc/contributing">contribute</a>?
</div>
</center>