2024-01-01 15:27:59 -06:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"go.wit.com/log"
|
|
|
|
"go.wit.com/gui/gui"
|
2024-01-08 22:34:33 -06:00
|
|
|
"go.wit.com/gui/debugger"
|
2024-01-01 15:27:59 -06:00
|
|
|
"go.wit.com/gui/cloudflare"
|
|
|
|
)
|
|
|
|
|
|
|
|
var title string = "Cloudflare DNS Control Panel"
|
|
|
|
|
|
|
|
var myGui *gui.Node
|
|
|
|
|
|
|
|
// var cloudflareURL string = "https://api.cloudflare.com/client/v4/zones/"
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
// send all log() output to a file in /tmp
|
|
|
|
log.SetTmp()
|
|
|
|
|
|
|
|
// parse the config file
|
|
|
|
readConfig()
|
|
|
|
|
|
|
|
// initialize a new GO GUI instance
|
|
|
|
myGui = gui.New().Default()
|
|
|
|
|
2024-01-08 22:34:33 -06:00
|
|
|
debugger.DebugWindow(myGui)
|
|
|
|
|
2024-01-01 15:27:59 -06:00
|
|
|
// draw the cloudflare control panel window
|
|
|
|
win := cloudflare.MakeCloudflareWindow(myGui)
|
2024-01-05 09:06:59 -06:00
|
|
|
win.Title(title)
|
2024-01-03 14:41:03 -06:00
|
|
|
win.Show()
|
2024-01-01 15:27:59 -06:00
|
|
|
|
|
|
|
// This is just a optional goroutine to watch that things are alive
|
|
|
|
gui.Watchdog()
|
|
|
|
gui.StandardExit()
|
|
|
|
|
|
|
|
// update the config file
|
|
|
|
saveConfig()
|
|
|
|
}
|