mirror of
https://github.com/ZizzyDizzyMC/linx-server.git
synced 2026-01-23 02:14:33 +00:00
parent
bad7d2666e
commit
10938a3e0b
8 changed files with 7 additions and 163 deletions
|
|
@ -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")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue