summaryrefslogtreecommitdiff
path: root/hostname.go
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
commit1258be9beff2e45c94ba5f7c29db65be02a1e2d4 (patch)
treec1b6bc4e9a648835ec243140fd29689db1cf0bf1 /hostname.go
parent8afc73da048204f4245e0c850436c1e3e70055a5 (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]>
Diffstat (limited to 'hostname.go')
-rw-r--r--hostname.go29
1 files changed, 9 insertions, 20 deletions
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)
}