summaryrefslogtreecommitdiff
path: root/cloudflare/api.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-12-28 09:43:45 -0600
committerJeff Carr <[email protected]>2023-12-28 09:43:45 -0600
commit6fa6d6dfc9e5a88e7dff2ed3c148b3b4271f566c (patch)
treef08edaac07ddf1a2e8a7401ef32c53707bdf5537 /cloudflare/api.go
parent73b0cee93320bb5b572881cd1a5ba9d878a4ba3a (diff)
Detect that a VPN is needed
IPv6() returns true if it's working display duration a 'DNS Lookup Status' window actual dig results display status and failure counters count lookup failures and successes add TCP dns lookup logic to test if dns is working at all add DNS over HTTPS cloudflare new & update kind of working holy shit, go.wit.com finally works with git mod tidy working, but cloudflare api stuff is broken AAAA '(none)' logic detection is better cloudflare control panel display the working real AAAA addresses Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'cloudflare/api.go')
-rw-r--r--cloudflare/api.go26
1 files changed, 10 insertions, 16 deletions
diff --git a/cloudflare/api.go b/cloudflare/api.go
index 1769f6b..036adc7 100644
--- a/cloudflare/api.go
+++ b/cloudflare/api.go
@@ -10,11 +10,20 @@ import (
"github.com/davecgh/go-spew/spew"
)
+/*
+ This function should run each time
+ the user chanegs anything in the GUi
+ or each time something in general changes
+
+ It returns a RR record which then can be
+ turned into JSON and sent via http
+ to cloudflare's API
+*/
func DoChange() *RRT {
var dnsRow *RRT
dnsRow = new(RRT)
- log.Println("Look for changes in row", dnsRow.ID)
+ log.Println("DoChange() START")
if (CFdialog.proxyNode.S == "On") {
dnsRow.Proxied = true
} else {
@@ -88,21 +97,6 @@ func SetRow(dnsRow *RRT) {
log.Println("http PUT curl =", pretty)
CFdialog.curlNode.SetText(pretty)
}
-
- return
- log.Println("UPDATE VALUE", CFdialog.NameNode.Name, CFdialog.TypeNode.Name, "to", CFdialog.ValueNode.S)
- stuff, result := httpPut(dnsRow)
- if (CFdialog.curlNode != nil) {
- pretty, _ := FormatJSON(stuff)
- log.Println("http PUT curl =", pretty)
- CFdialog.curlNode.SetText(pretty)
- }
- if (CFdialog.resultNode != nil) {
- pretty, _ := FormatJSON(result)
- log.Println("http PUT result =", pretty)
- CFdialog.resultNode.SetText(pretty)
- }
- // CFdialog.saveNode.Disable()
}
func GetZonefile(c *ConfigT) *DNSRecords {