Compare commits
5 Commits
Author | SHA1 | Date |
---|---|---|
|
d8fa053319 | |
|
82096a971e | |
|
d8555dc86f | |
|
e4672283ce | |
|
c79bbb58bb |
|
@ -1,7 +1,9 @@
|
||||||
control-panel-dns
|
*.swp
|
||||||
|
go.mod
|
||||||
|
go.sum
|
||||||
|
|
||||||
/files/*
|
/files/*
|
||||||
/*.deb
|
/*.deb
|
||||||
*.swp
|
|
||||||
/plugins/*
|
/plugins/*
|
||||||
|
|
||||||
control-panel-cloudflare
|
control-panel-cloudflare
|
||||||
|
|
32
Makefile
32
Makefile
|
@ -1,6 +1,33 @@
|
||||||
run: build
|
VERSION = $(shell git describe --tags)
|
||||||
|
BUILDTIME = $(shell date +%Y.%m.%d)
|
||||||
|
|
||||||
|
all: build
|
||||||
./control-panel-cloudflare
|
./control-panel-cloudflare
|
||||||
|
|
||||||
|
build:
|
||||||
|
GO111MODULE=off go build \
|
||||||
|
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
||||||
|
|
||||||
|
verbose:
|
||||||
|
GO111MODULE=off go build -v -x \
|
||||||
|
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
||||||
|
|
||||||
|
install:
|
||||||
|
GO111MODULE=off go install \
|
||||||
|
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-rm -f control-panel-cloudflare
|
||||||
|
|
||||||
|
goimports:
|
||||||
|
goimports -w *.go
|
||||||
|
|
||||||
|
redomod:
|
||||||
|
rm -f go.*
|
||||||
|
GO111MODULE= go mod init
|
||||||
|
GO111MODULE= go mod tidy
|
||||||
|
|
||||||
|
|
||||||
build-and-update:
|
build-and-update:
|
||||||
go get -v -u -x .
|
go get -v -u -x .
|
||||||
go build -v -o control-panel-cloudflare
|
go build -v -o control-panel-cloudflare
|
||||||
|
@ -9,9 +36,6 @@ build-and-update:
|
||||||
goget:
|
goget:
|
||||||
go get -v -x .
|
go get -v -x .
|
||||||
|
|
||||||
build:
|
|
||||||
go build -v -o control-panel-cloudflare
|
|
||||||
|
|
||||||
update:
|
update:
|
||||||
GO111MODULE="off" go get -v -u -x .
|
GO111MODULE="off" go get -v -u -x .
|
||||||
|
|
||||||
|
|
17
main.go
17
main.go
|
@ -1,10 +1,9 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"go.wit.com/bug/debugger"
|
"go.wit.com/gui"
|
||||||
"go.wit.com/gui/gui"
|
"go.wit.com/lib/debugger"
|
||||||
"go.wit.com/lib/gui/cloudflare"
|
"go.wit.com/lib/gui/cloudflare"
|
||||||
"go.wit.com/log"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var title string = "Cloudflare DNS Control Panel"
|
var title string = "Cloudflare DNS Control Panel"
|
||||||
|
@ -14,25 +13,23 @@ var myGui *gui.Node
|
||||||
// var cloudflareURL string = "https://api.cloudflare.com/client/v4/zones/"
|
// var cloudflareURL string = "https://api.cloudflare.com/client/v4/zones/"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// send all log() output to a file in /tmp
|
|
||||||
log.SetTmp()
|
|
||||||
|
|
||||||
// parse the config file
|
// parse the config file
|
||||||
readConfig()
|
readConfig()
|
||||||
|
|
||||||
// initialize a new GO GUI instance
|
// initialize a new GO GUI instance
|
||||||
myGui = gui.New().Default()
|
myGui = gui.New()
|
||||||
|
myGui.Default()
|
||||||
debugger.DebugWindow(myGui)
|
|
||||||
|
|
||||||
// draw the cloudflare control panel window
|
// draw the cloudflare control panel window
|
||||||
win := cloudflare.MakeCloudflareWindow(myGui)
|
win := cloudflare.MakeCloudflareWindow(myGui)
|
||||||
win.Title(title)
|
win.SetTitle(title)
|
||||||
win.Show()
|
win.Show()
|
||||||
|
win.Draw()
|
||||||
|
|
||||||
// This is just a optional goroutine to watch that things are alive
|
// This is just a optional goroutine to watch that things are alive
|
||||||
gui.Watchdog()
|
gui.Watchdog()
|
||||||
gui.StandardExit()
|
gui.StandardExit()
|
||||||
|
debugger.DebugWindow()
|
||||||
|
|
||||||
// update the config file
|
// update the config file
|
||||||
saveConfig()
|
saveConfig()
|
||||||
|
|
Loading…
Reference in New Issue