Compare commits

...

5 Commits

Author SHA1 Message Date
Jeff Carr d8fa053319 fix makefile 2024-11-16 00:06:08 -06:00
Jeff Carr 82096a971e these aren't needed anymore here
Signed-off-by: Jeff Carr <jcarr@wit.com>
2024-01-31 14:27:05 -06:00
Jeff Carr d8555dc86f new gui & release managment
Signed-off-by: Jeff Carr <jcarr@wit.com>
2024-01-27 14:36:41 -06:00
Jeff Carr e4672283ce update to new gui
Signed-off-by: Jeff Carr <jcarr@wit.com>
2024-01-24 22:30:04 -06:00
Jeff Carr c79bbb58bb compiles, needs toggle / fixed code
Signed-off-by: Jeff Carr <jcarr@wit.com>
2024-01-21 02:42:00 -06:00
4 changed files with 39 additions and 19 deletions

6
.gitignore vendored
View File

@ -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

View File

@ -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 .

3
go.mod
View File

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

17
main.go
View File

@ -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()