summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-06 21:02:41 -0600
committerJeff Carr <[email protected]>2024-01-06 21:02:41 -0600
commit5e9f1591cab5602ac9d9f6e6a24f83ba5dc86126 (patch)
treefc9530a4361b411dac492061f14cd749cc706621
parentde051d06f33a401231baf1651727d31a18261052 (diff)
update worked correctly for the first time
Signed-off-by: Jeff Carr <[email protected]>
-rw-r--r--fix.go19
-rw-r--r--gui.go5
-rw-r--r--linuxstatus/args.go1
-rw-r--r--structs.go2
4 files changed, 20 insertions, 7 deletions
diff --git a/fix.go b/fix.go
index eb69c19..954e0f1 100644
--- a/fix.go
+++ b/fix.go
@@ -3,6 +3,7 @@ package main
import (
"go.wit.com/log"
+ "go.wit.com/gui/cloudflare"
)
func fix() bool {
@@ -12,26 +13,26 @@ func fix() bool {
return false
}
if me.statusOS.ValidHostname() {
- log.Log(CHANGE, "Your hostname is VALID:", me.statusOS.GetHostname())
+ log.Log(CHANGE, "GOOD Your hostname is VALID:", me.statusOS.GetHostname())
} else {
log.Log(CHANGE, "You must first fix your hostname:", me.statusOS.GetHostname())
return false
}
if me.digStatus.IPv4() {
- log.Log(CHANGE, "IPv4 addresses are resolving")
+ log.Log(CHANGE, "GOOD IPv4 addresses are resolving")
} else {
log.Log(CHANGE, "You must first figure out why you can't look up IPv4 addresses")
log.Log(CHANGE, "Are you on the internet at all?")
return false
}
if me.digStatus.IPv6() {
- log.Log(CHANGE, "IPv6 addresses are resolving")
+ log.Log(CHANGE, "GOOD IPv6 addresses are resolving")
} else {
log.Log(CHANGE, "You must first figure out why you can't look up IPv6 addresses")
return false
}
if ! me.statusDNS.IPv4() {
- log.Log(CHANGE, "You do not have real IPv4 addresses. Nothing to fix here")
+ log.Log(CHANGE, "OK You do not have real IPv4 addresses. Nothing to fix here")
}
if ! me.statusDNS.IPv6() {
log.Log(CHANGE, "IPv6 DNS is broken. Check what is broken here")
@@ -40,7 +41,7 @@ func fix() bool {
return false
}
}
- log.Log(CHANGE, "YOU SHOULD BE IN IPv6 BLISS")
+ log.Log(CHANGE, "GOOD YOU SHOULD BE IN IPv6 BLISS")
return true
}
@@ -102,7 +103,13 @@ func deleteFromDNS(aaaa string) bool {
func addToDNS(aaaa string) bool {
log.Log(CHANGE, "TODO: Add this to DNS !!!!", aaaa)
- log.Log(CHANGE, "what is your API provider?")
+ api := me.statusDNS.API()
+ log.Log(CHANGE, "what is your API provider?", api)
+ if api == "cloudflare" {
+ log.Log(CHANGE, "Let's try an ADD via the Cloudflare API")
+ hostname := me.statusOS.GetHostname()
+ return cloudflare.Create("wit.com", hostname, aaaa)
+ }
return false
}
diff --git a/gui.go b/gui.go
index b01df07..1a4dab9 100644
--- a/gui.go
+++ b/gui.go
@@ -193,7 +193,10 @@ func mainWindow(title string) {
me.digStatus.window.Toggle()
})
gr.NewButton("cloudflare wit.com", func () {
- cloudflare.CreateRR(me.myGui, "wit.com", "3777302ac4a78cd7fa4f6d3f72086d06")
+ if me.witcom != nil {
+ me.witcom.Toggle()
+ }
+ me.witcom = cloudflare.CreateRR(me.myGui, "wit.com", "3777302ac4a78cd7fa4f6d3f72086d06")
})
gr.NewButton("Debug", func () {
me.debug.Toggle()
diff --git a/linuxstatus/args.go b/linuxstatus/args.go
index d15a166..4ba7ae1 100644
--- a/linuxstatus/args.go
+++ b/linuxstatus/args.go
@@ -29,6 +29,7 @@ func myreg(f *log.LogFlag, b bool, name string, desc string) {
func init() {
myreg(&NOW, true, "NOW", "temp debugging stuff")
+ myreg(&INFO, false, "INFO", "normal debugging stuff")
myreg(&NET, false, "NET", "Network Logging")
myreg(&DNS, false, "DNS", "dnsStatus.update()")
myreg(&PROC, false, "PROC", "/proc logging")
diff --git a/structs.go b/structs.go
index 035ddf9..855c832 100644
--- a/structs.go
+++ b/structs.go
@@ -6,6 +6,7 @@ import (
"time"
"go.wit.com/gui/gui"
"go.wit.com/gui/gadgets"
+ // "go.wit.com/gui/cloudflare"
"go.wit.com/control-panels/dns/linuxstatus"
"github.com/miekg/dns"
@@ -57,6 +58,7 @@ type Host struct {
statusIPv6 *gadgets.OneLiner
digStatusButton *gui.Node
+ witcom *gadgets.BasicWindow
}
type IPtype struct {