summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-12-29 01:36:10 -0600
committerJeff Carr <[email protected]>2023-12-29 01:36:10 -0600
commitbeb076375e92d4bbc26f97cb81d91a4c0ad8257c (patch)
treedc547f91ffe31830081906361e70ddc02180b070
parenta84e307c773f5725b7c926c10b61dfe28a03c560 (diff)
add digital ocean & DNS state windows
lists digital ocean droplets create a new digital ocean droplet knows what needs to be done to get IPv4 and IPv6 to work update windows on Show() make a window for the state of DNS specific to the hostname Signed-off-by: Jeff Carr <[email protected]>
-rw-r--r--.gitignore1
-rw-r--r--dnsLookupStatus.go2
-rw-r--r--hostname.go29
3 files changed, 11 insertions, 21 deletions
diff --git a/.gitignore b/.gitignore
index cd8a456..8f6539e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,4 +4,5 @@ control-panel-dns
*.swp
/plugins/*
+examples/control-panel-digitalocean/control-panel-digitalocean
examples/control-panel-cloudflare/control-panel-cloudflare
diff --git a/dnsLookupStatus.go b/dnsLookupStatus.go
index 280ac92..9166f72 100644
--- a/dnsLookupStatus.go
+++ b/dnsLookupStatus.go
@@ -92,7 +92,7 @@ func NewDigStatusWindow(p *gui.Node) *digStatus {
ds.ready = false
ds.hidden = true
- ds.window = p.NewWindow("DNS Lookup Status")
+ ds.window = p.NewWindow("DNS Resolver Status")
ds.window.Custom = func () {
ds.hidden = true
ds.window.Hide()
diff --git a/hostname.go b/hostname.go
index 32897d5..81aa136 100644
--- a/hostname.go
+++ b/hostname.go
@@ -1,29 +1,19 @@
-// inspired from:
-// https://github.com/mactsouk/opensource.com.git
-// and
-// https://coderwall.com/p/wohavg/creating-a-simple-tcp-server-in-go
-
+// figures out if your hostname is valid
+// then checks if your DNS is setup correctly
package main
import (
- "log"
-// "net"
"strings"
+ "go.wit.com/log"
"go.wit.com/shell"
-
"go.wit.com/control-panel-dns/cloudflare"
"github.com/miekg/dns"
+ // will try to get this hosts FQDN
+ "github.com/Showmax/go-fqdn"
)
-// will try to get this hosts FQDN
-import "github.com/Showmax/go-fqdn"
-
-// this is the king of dns libraries
-// import "github.com/miekg/dns"
-
-
func getHostname() {
var err error
var s string = "gui.Label == nil"
@@ -59,15 +49,15 @@ func getHostname() {
test = hshort + "." + dn
if (me.hostname != test) {
debug(LogInfo, "me.hostname", me.hostname, "does not equal", test)
- if (me.hostnameStatus.S != "BROKEN") {
+ if (me.hostnameStatusOLD.S != "BROKEN") {
debug(LogChange, "me.hostname", me.hostname, "does not equal", test)
me.changed = true
- me.hostnameStatus.SetText("BROKEN")
+ me.hostnameStatusOLD.SetText("BROKEN")
}
} else {
- if (me.hostnameStatus.S != "VALID") {
+ if (me.hostnameStatusOLD.S != "VALID") {
debug(LogChange, "me.hostname", me.hostname, "is valid")
- me.hostnameStatus.SetText("VALID")
+ me.hostnameStatusOLD.SetText("VALID")
me.changed = true
}
// enable the cloudflare button if the provider is cloudflare
@@ -140,7 +130,6 @@ func digAAAA(hostname string) []string {
log.Println("digAAAA() RUNNING dnsAAAAlookupDoH(domain)")
ipv6Addresses, _ = dnsAAAAlookupDoH(hostname)
log.Println("digAAAA() has ipv6Addresses =", strings.Join(ipv6Addresses, " "))
- log.Printf("digAAAA() IPv6 Addresses for %s:\n", hostname)
for _, addr := range ipv6Addresses {
log.Println(addr)
}