// Copyright 2017-2025 WIT.COM Inc. All rights reserved. // Use of this source code is governed by the GPL 3.0 package main import ( "embed" "os" "time" "go.wit.com/dev/alexflint/arg" "go.wit.com/lib/protobuf/zoopb" "go.wit.com/log" ) var VERSION string var BUILDTIME string //go:embed resources/* var resources embed.FS func main() { var pp *arg.Parser pp = arg.MustParse(&argv) if pp == nil { pp.WriteHelp(os.Stdout) os.Exit(0) } if argv.Daemon { // turn off timestamps for STDOUT (systemd adds them) log.DaemonMode(true) } me = new(stuff) me.hostname, _ = os.Hostname() me.pollDelay = 10 * time.Second me.machines = zoopb.NewMachines() me.machines2 = zoopb.NewMachines() if err := me.machines.ConfigLoad(); err != nil { log.Warn("load config failed", err) os.Exit(-1) } // me.targets = make(map[string]string) // keep track of what versions the machines should be running me.upgrade = make(map[string]bool) // used to trigger upgrade attempts go NewWatchdog() go startHTTP() doGui() }