Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
|
d8fa053319 | |
|
82096a971e | |
|
d8555dc86f | |
|
e4672283ce |
|
@ -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
|
||||||
|
|
23
Makefile
23
Makefile
|
@ -1,6 +1,24 @@
|
||||||
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:
|
||||||
goimports -w *.go
|
goimports -w *.go
|
||||||
|
|
||||||
|
@ -18,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 .
|
||||||
|
|
||||||
|
|
21
go.mod
21
go.mod
|
@ -1,21 +0,0 @@
|
||||||
module go.wit.com/apps/control-panel-cloudflare
|
|
||||||
|
|
||||||
go 1.21.4
|
|
||||||
|
|
||||||
require (
|
|
||||||
github.com/alexflint/go-arg v1.4.3
|
|
||||||
go.wit.com/gui v0.12.19
|
|
||||||
go.wit.com/lib/debugger v0.12.7
|
|
||||||
go.wit.com/lib/gui/cloudflare v0.12.4
|
|
||||||
go.wit.com/log v0.5.6
|
|
||||||
)
|
|
||||||
|
|
||||||
require (
|
|
||||||
github.com/alexflint/go-scalar v1.1.0 // indirect
|
|
||||||
go.wit.com/dev/alexflint/arg v1.4.5 // indirect
|
|
||||||
go.wit.com/dev/alexflint/scalar v1.2.1 // indirect
|
|
||||||
go.wit.com/dev/davecgh/spew v1.1.4 // indirect
|
|
||||||
go.wit.com/lib/gadgets v0.12.15 // indirect
|
|
||||||
go.wit.com/lib/gui/logsettings v0.10.2 // indirect
|
|
||||||
go.wit.com/widget v1.1.6 // indirect
|
|
||||||
)
|
|
36
go.sum
36
go.sum
|
@ -1,36 +0,0 @@
|
||||||
github.com/alexflint/go-arg v1.4.3 h1:9rwwEBpMXfKQKceuZfYcwuc/7YY7tWJbFsgG5cAU/uo=
|
|
||||||
github.com/alexflint/go-arg v1.4.3/go.mod h1:3PZ/wp/8HuqRZMUUgu7I+e1qcpUbvmS258mRXkFH4IA=
|
|
||||||
github.com/alexflint/go-scalar v1.1.0 h1:aaAouLLzI9TChcPXotr6gUhq+Scr8rl0P9P4PnltbhM=
|
|
||||||
github.com/alexflint/go-scalar v1.1.0/go.mod h1:LoFvNMqS1CPrMVltza4LvnGKhaSpc3oyLEBUZVhhS2o=
|
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
|
||||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
|
||||||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
|
||||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
|
||||||
go.wit.com/dev/alexflint/arg v1.4.5 h1:asDx5f9IlfpknKjPBqqb2qndE91Pbo7ZDkWUgddfMhY=
|
|
||||||
go.wit.com/dev/alexflint/arg v1.4.5/go.mod h1:wnWc+c6z8kSdDKYriMf6RpM+FiXmo5RYp/t4FNi0MU0=
|
|
||||||
go.wit.com/dev/alexflint/scalar v1.2.1 h1:loXOcbVnd+8YeJRLey+XXidecBiedMDO00zQ26TvKNs=
|
|
||||||
go.wit.com/dev/alexflint/scalar v1.2.1/go.mod h1:+rYsfxqdI2cwA8kJ7GCMwWbNJvfvWUurOCXLiwdTtSs=
|
|
||||||
go.wit.com/dev/davecgh/spew v1.1.4 h1:C9hj/rjlUpdK+E6aroyLjCbS5MFcyNUOuP1ICLWdNek=
|
|
||||||
go.wit.com/dev/davecgh/spew v1.1.4/go.mod h1:sihvWmnQ/09FWplnEmozt90CCVqBtGuPXM811tgfhFA=
|
|
||||||
go.wit.com/gui v0.12.19 h1:OEnsnZnec7Q2jZVjwl413V0wuVAAB4r2mGTY0IouBuw=
|
|
||||||
go.wit.com/gui v0.12.19/go.mod h1:v2VgnOL3dlZ13KclYeedZ1cd20nQdvwjyJTNKvFX3DA=
|
|
||||||
go.wit.com/lib/debugger v0.12.7 h1:c8ehU7p2asb//K4YgC17XG4o2pPP+IZb9lR2a0nBio8=
|
|
||||||
go.wit.com/lib/debugger v0.12.7/go.mod h1:zcZstsgOcALjCNOiIE+KcKkrIF78ogYjwxmaQlBbmtQ=
|
|
||||||
go.wit.com/lib/gadgets v0.12.15 h1:C9q6wc45Trh5SrizD8lOXOWoJLGq/ESWwzjCVylZrNY=
|
|
||||||
go.wit.com/lib/gadgets v0.12.15/go.mod h1:Fxc7F8hGskpkWVAsXKhs4ilqUlAnikVXj4yzumtTYa0=
|
|
||||||
go.wit.com/lib/gui/cloudflare v0.12.4 h1:iE39oZE3e0ihkHFnHI+lduKyWrYkTl8AiSzprqnyOxo=
|
|
||||||
go.wit.com/lib/gui/cloudflare v0.12.4/go.mod h1:ElqrG+GEBHgQV8xa29B5Zz36eIuSDcBiRsS/KU6H5M8=
|
|
||||||
go.wit.com/lib/gui/logsettings v0.10.2 h1:xRx0AX1V74kC6CIm+ib6C3ziTcbBjR/Ju3rTLEpQMsw=
|
|
||||||
go.wit.com/lib/gui/logsettings v0.10.2/go.mod h1:v5XUQ6WyNyfScR9oOFhdz8p1wtxCpNWXK3DJ/dbLPVo=
|
|
||||||
go.wit.com/log v0.5.6 h1:rDC3ju95zfEads4f1Zm+QMkqjZ39CsYAT/UmQQs7VP4=
|
|
||||||
go.wit.com/log v0.5.6/go.mod h1:BaJBfHFqcJSJLXGQ9RHi3XVhPgsStxSMZRlaRxW4kAo=
|
|
||||||
go.wit.com/widget v1.1.6 h1:av2miF5vlohMfARA/QGPTPfgW/ADup1c+oeAOKgroPY=
|
|
||||||
go.wit.com/widget v1.1.6/go.mod h1:I8tnD3x3ECbB/CRNnLCdC+uoyk7rK0AEkzK1bQYSqoQ=
|
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
|
7
main.go
7
main.go
|
@ -1,7 +1,6 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"go.wit.com/log"
|
|
||||||
"go.wit.com/gui"
|
"go.wit.com/gui"
|
||||||
"go.wit.com/lib/debugger"
|
"go.wit.com/lib/debugger"
|
||||||
"go.wit.com/lib/gui/cloudflare"
|
"go.wit.com/lib/gui/cloudflare"
|
||||||
|
@ -14,22 +13,18 @@ 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()
|
myGui = gui.New()
|
||||||
myGui.LoadToolkit("andlabs")
|
|
||||||
myGui.Default()
|
myGui.Default()
|
||||||
|
|
||||||
|
|
||||||
// draw the cloudflare control panel window
|
// draw the cloudflare control panel window
|
||||||
win := cloudflare.MakeCloudflareWindow(myGui)
|
win := cloudflare.MakeCloudflareWindow(myGui)
|
||||||
win.SetTitle(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()
|
||||||
|
|
Loading…
Reference in New Issue