dashboard: add the ability to use a remote dashboard, serve only local files: assets and eventualy public.json (to override given ones)

This commit is contained in:
nemunaire 2019-01-21 11:36:52 +01:00
parent 8c754fe265
commit b205409679
3 changed files with 154 additions and 20 deletions

View file

@ -72,6 +72,8 @@ func main() {
flag.StringVar(&DashboardDir, "dashbord", "./DASHBOARD", "Base directory where save public JSON files")
flag.StringVar(&TeamsDir, "teams", "./TEAMS", "Base directory where save teams JSON files")
flag.StringVar(&settings.SettingsDir, "settings", settings.SettingsDir, "Base directory where load and save settings")
var fwdr = flag.String("forwarder", "", "URL of another dashboard where send traffic to, except static assets")
flag.BoolVar(&fwdPublicJson, "fwdpublicjson", fwdPublicJson, "Also forward public.json files to forwarder")
flag.Parse()
log.SetPrefix("[public] ")
@ -95,6 +97,9 @@ func main() {
tmp := ""
baseURL = &tmp
}
if fwdr != nil && len(*fwdr) > 0 {
forwarder = fwdr
}
// Prepare graceful shutdown
interrupt := make(chan os.Signal, 1)