|
@ -30,6 +30,7 @@ var Config struct { |
|
|
fileContentSecurityPolicy string |
|
|
fileContentSecurityPolicy string |
|
|
xFrameOptions string |
|
|
xFrameOptions string |
|
|
maxSize int64 |
|
|
maxSize int64 |
|
|
|
|
|
realIp bool |
|
|
noLogs bool |
|
|
noLogs bool |
|
|
allowHotlink bool |
|
|
allowHotlink bool |
|
|
fastcgi bool |
|
|
fastcgi bool |
|
@ -48,7 +49,7 @@ func setup() *web.Mux { |
|
|
// middleware
|
|
|
// middleware
|
|
|
mux.Use(middleware.RequestID) |
|
|
mux.Use(middleware.RequestID) |
|
|
|
|
|
|
|
|
if Config.fastcgi { |
|
|
|
|
|
|
|
|
if Config.realIp { |
|
|
mux.Use(middleware.RealIP) |
|
|
mux.Use(middleware.RealIP) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -152,6 +153,8 @@ func main() { |
|
|
"path to ssl certificate (for https)") |
|
|
"path to ssl certificate (for https)") |
|
|
flag.StringVar(&Config.keyFile, "keyfile", "", |
|
|
flag.StringVar(&Config.keyFile, "keyfile", "", |
|
|
"path to ssl key (for https)") |
|
|
"path to ssl key (for https)") |
|
|
|
|
|
flag.BoolVar(&Config.realIp, "realip", false, |
|
|
|
|
|
"use X-Real-IP/X-Forwarded-For headers as original host") |
|
|
flag.BoolVar(&Config.fastcgi, "fastcgi", false, |
|
|
flag.BoolVar(&Config.fastcgi, "fastcgi", false, |
|
|
"serve through fastcgi") |
|
|
"serve through fastcgi") |
|
|
flag.BoolVar(&Config.remoteUploads, "remoteuploads", false, |
|
|
flag.BoolVar(&Config.remoteUploads, "remoteuploads", false, |
|
|