Compare commits

..

No commits in common. "master" and "v0.1.1" have entirely different histories.

4 changed files with 19 additions and 39 deletions

6
.gitignore vendored
View File

@ -1,9 +1,7 @@
*.swp
go.mod
go.sum
control-panel-dns
/files/*
/*.deb
*.swp
/plugins/*
control-panel-cloudflare

View File

@ -1,33 +1,6 @@
VERSION = $(shell git describe --tags)
BUILDTIME = $(shell date +%Y.%m.%d)
all: build
run: build
./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:
go get -v -u -x .
go build -v -o control-panel-cloudflare
@ -36,6 +9,9 @@ build-and-update:
goget:
go get -v -x .
build:
go build -v -o control-panel-cloudflare
update:
GO111MODULE="off" go get -v -u -x .

3
go.mod Normal file
View File

@ -0,0 +1,3 @@
module go.wit.com/control-panels/cloudflare
go 1.21.4

17
main.go
View File

@ -1,9 +1,10 @@
package main
import (
"go.wit.com/gui"
"go.wit.com/lib/debugger"
"go.wit.com/bug/debugger"
"go.wit.com/gui/gui"
"go.wit.com/lib/gui/cloudflare"
"go.wit.com/log"
)
var title string = "Cloudflare DNS Control Panel"
@ -13,23 +14,25 @@ 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()
myGui.Default()
myGui = gui.New().Default()
debugger.DebugWindow(myGui)
// draw the cloudflare control panel window
win := cloudflare.MakeCloudflareWindow(myGui)
win.SetTitle(title)
win.Title(title)
win.Show()
win.Draw()
// This is just a optional goroutine to watch that things are alive
gui.Watchdog()
gui.StandardExit()
debugger.DebugWindow()
// update the config file
saveConfig()