Remove Google URL shortener (fix #146) (#150)

This commit is contained in:
mutantmonkey 2019-01-08 19:56:32 +00:00 committed by Andrei Marcu
parent bad7d2666e
commit 10938a3e0b
8 changed files with 7 additions and 163 deletions

View file

@ -59,7 +59,6 @@ var Config struct {
authFile string
remoteAuthFile string
addHeaders headerList
googleShorterAPIKey string
noDirectAgents bool
}
@ -154,7 +153,6 @@ func setup() *web.Mux {
selifRe := regexp.MustCompile("^" + Config.sitePath + `selif/(?P<name>[a-z0-9-\.]+)$`)
selifIndexRe := regexp.MustCompile("^" + Config.sitePath + `selif/$`)
torrentRe := regexp.MustCompile("^" + Config.sitePath + `(?P<name>[a-z0-9-\.]+)/torrent$`)
shortRe := regexp.MustCompile("^" + Config.sitePath + `(?P<name>[a-z0-9-\.]+)/short$`)
if Config.authFile == "" {
mux.Get(Config.sitePath, indexHandler)
@ -193,10 +191,6 @@ func setup() *web.Mux {
mux.Get(selifIndexRe, unauthorizedHandler)
mux.Get(torrentRe, fileTorrentHandler)
if Config.googleShorterAPIKey != "" {
mux.Get(shortRe, shortURLHandler)
}
mux.NotFound(notFoundHandler)
return mux
@ -251,8 +245,6 @@ func main() {
"value of X-Frame-Options header")
flag.Var(&Config.addHeaders, "addheader",
"Add an arbitrary header to the response. This option can be used multiple times.")
flag.StringVar(&Config.googleShorterAPIKey, "googleapikey", "",
"API Key for Google's URL Shortener.")
flag.BoolVar(&Config.noDirectAgents, "nodirectagents", false,
"disable serving files directly for wget/curl user agents")