)
const (
- Version = "4.1.0"
+ Version = "4.2.0"
UserAgent = "GoCheese/" + Version
)
PasswdPath = flag.String("passwd", "", "")
PasswdListPath = flag.String("passwd-list", "", "")
PasswdCheck = flag.Bool("passwd-check", false, "")
+ AuthRequired = flag.Bool("auth-required", false, "")
LogTimestamped = flag.Bool("log-timestamped", false, "")
FSCK = flag.Bool("fsck", false, "")
ReadTimeout: time.Minute,
WriteTimeout: time.Minute,
}
- http.HandleFunc("/", serveHRRoot)
- http.HandleFunc("/hr/", serveHRPkg)
- http.HandleFunc(*JSONURLPath, serveJSON)
- http.HandleFunc(*NoRefreshURLPath, handler)
- http.HandleFunc(*RefreshURLPath, handler)
+ http.HandleFunc("/", checkAuth(serveHRRoot))
+ http.HandleFunc("/hr/", checkAuth(serveHRPkg))
+ http.HandleFunc(*JSONURLPath, checkAuth(serveJSON))
+ http.HandleFunc(*NoRefreshURLPath, checkAuth(handler))
+ http.HandleFunc(*RefreshURLPath, checkAuth(handler))
if *DoUCSPI {
server.SetKeepAlivesEnabled(false)