move whitelist into cfg

This commit is contained in:
Jimmy Zelinskie
2014-07-25 16:58:26 -04:00
parent cde8251bd3
commit ffb3c57181
10 changed files with 50 additions and 69 deletions

View File

@@ -23,17 +23,15 @@ import (
)
var (
maxProcs int
profile string
configPath string
whitelistPath string
maxProcs int
profile string
configPath string
)
func init() {
flag.IntVar(&maxProcs, "maxprocs", runtime.NumCPU(), "maximum parallel threads")
flag.StringVar(&profile, "profile", "", "if non-empty, path to write profiling data")
flag.StringVar(&configPath, "config", "", "path to the configuration file")
flag.StringVar(&whitelistPath, "whitelist", "", "path to a client whitelist")
}
// Boot starts Chihaya. By exporting this function, anyone can import their own
@@ -80,13 +78,6 @@ func Boot() {
glog.Fatal("New: ", err)
}
if whitelistPath != "" {
err = tkr.LoadApprovedClients(whitelistPath)
if err != nil {
glog.Fatal("Failed to load whitelist: ", err.Error())
}
}
http.Serve(cfg, tkr)
glog.Info("Gracefully shut down")
}