Compare commits

..

No commits in common. "c16bb5b088ce71fd6d032228b505cb5e133fcb3c" and "3ce3a39226bd6c0e738cdf76a55b05be1bad3cc3" have entirely different histories.

15 changed files with 251 additions and 329 deletions

1
.gitignore vendored
View File

@ -1,4 +1,3 @@
control-panel-dns
/files/*
/*.deb
*.swp

View File

@ -1,9 +1,5 @@
run: build
./control-panel-dns >/tmp/witgui.log.stderr 2>&1
install:
go install -v go.wit.com/control-panel-dns@latest
# go install -v git.wit.com/wit/control-panel-dns@latest
./control-panel-dns
debug: build
./control-panel-dns --verbose --verbose-net --gui-debug
@ -21,12 +17,6 @@ build:
# GO111MODULE="off" go get -v -x .
GO111MODULE="off" go build -v -o control-panel-dns
# ./control-panel-dns.v1: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./control-panel-dns.v1)
# ./control-panel-dns.v1: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./control-panel-dns.v1)
# compiling with CGO disabled means it compiles but then plugins don't load
GLIBC_2.34-error:
GO111MODULE="off" CGO_ENABLED=0 go build -v -o control-panel-dns
test:
GO111MODULE="off" go test -v
@ -67,31 +57,3 @@ build-with-custom-go.mod:
# )
# replace github.com/versent/saml2aws/v2 v2.35.0 => github.com/marcottedan/saml2aws/v2 master
# replace github.com/versent/saml2aws/v2 => /Users/dmarcotte/git/saml2aws/
#
check-cert:
reset
# https://crt.sh/?q=check.lab.wit.org
# # https://letsencrypt.org/certificates/
# openssl s_client -connect check.lab.wit.org:443 -showcerts
openssl s_client -CApath /etc/ssl/certs/ -connect check.lab.wit.org:443 -showcerts
# openssl s_client -CApath /etc/ssl/certs/ -connect check.lab.wit.org:443 -showcerts -trace -debug
# openssl s_client -CAfile isrgrootx1.pem -connect check.lab.wit.org:443 -showcerts
# cat isrgrootx1.pem lets-encrypt-r3.pem > full-chain.pem
# full-chain.pem
# openssl s_client -CAfile /etc/ssl/certs/wit-full-chain.pem -connect check.lab.wit.org:443 -showcerts
ssl-cert-hash:
openssl x509 -hash -noout -in wit-full-chain.pem
# cd /etc/ssl/certs && ln -s wit-full-chain.pem 4042bcee.0
openssl x509 -hash -noout -in isrgrootx1.pem
openssl x509 -hash -noout -in lets-encrypt-r3.pem
sudo-cp:
sudo cp -a lets-encrypt-r3.pem 8d33f237.0 /etc/ssl/certs/
go-get:
go install -v check.lab.wit.org/gui
log:
reset
tail -f /tmp/witgui.* /tmp/guilogfile

View File

@ -12,7 +12,6 @@ type LogOptions struct {
VerboseDNS bool `arg:"--verbose-dns" help:"debug your dns settings"`
LogFile string `help:"write all output to a file"`
// User string `arg:"env:USER"`
Display string `arg:"env:DISPLAY"`
}
var args struct {

59
bash.go
View File

@ -1,59 +0,0 @@
package main
import (
"io"
"os"
"os/exec"
"os/signal"
"syscall"
"github.com/creack/pty"
"golang.org/x/term"
)
func test() error {
// Create arbitrary command.
c := exec.Command("bash")
// Start the command with a pty.
ptmx, err := pty.Start(c)
if err != nil {
return err
}
// Make sure to close the pty at the end.
defer func() { _ = ptmx.Close() }() // Best effort.
// Handle pty size.
ch := make(chan os.Signal, 1)
signal.Notify(ch, syscall.SIGWINCH)
go func() {
for range ch {
if err := pty.InheritSize(os.Stdin, ptmx); err != nil {
log("error resizing pty: %s", err)
}
}
}()
ch <- syscall.SIGWINCH // Initial resize.
defer func() { signal.Stop(ch); close(ch) }() // Cleanup signals when done.
// Set stdin in raw mode.
oldState, err := term.MakeRaw(int(os.Stdin.Fd()))
if err != nil {
panic(err)
}
defer func() { _ = term.Restore(int(os.Stdin.Fd()), oldState) }() // Best effort.
// Copy stdin to the pty and the pty to stdout.
// NOTE: The goroutine will keep reading until the next keystroke before returning.
go func() { _, _ = io.Copy(ptmx, os.Stdin) }()
_, _ = io.Copy(os.Stdout, ptmx)
return nil
}
func mainBash() {
if err := test(); err != nil {
log(logError, "exit in mainBash()")
exit(err)
}
}

2
dns.go
View File

@ -23,7 +23,7 @@ func (h *Host) verifyETC() bool {
func (h *Host) updateIPs(host string) {
ips, err := net.LookupIP(host)
if err != nil {
log(logError, "updateIPs failed", err)
exit(err)
}
for _, ip := range ips {
log(host, ip)

View File

@ -13,8 +13,7 @@ func watchSysClassNet() {
// Create new watcher.
watcher, err := fsnotify.NewWatcher()
if err != nil {
log(logError, "watchSysClassNet() failed:", err)
return
exit(err)
}
defer watcher.Close()
@ -42,8 +41,7 @@ func watchSysClassNet() {
// Add a path.
err = watcher.Add("/tmp")
if err != nil {
log(logError, "watchSysClassNet() watcher.Add() failed:", err)
return
exit(err)
}
// Block main goroutine forever.

170
gui.go
View File

@ -2,64 +2,68 @@
package main
import (
"fmt"
"os"
"os/user"
"strconv"
"strings"
"net"
"git.wit.org/wit/gui"
"git.wit.org/wit/shell"
"github.com/davecgh/go-spew/spew"
)
// This setups up the dns control panel window
func setupControlPanelWindow() {
me.window = myGui.New2().Window("DNS and IPv6 Control Panel").Standard()
me.window.Dump(true)
// This initializes the first window
func initGUI() {
gui.Config.Title = "DNS and IPv6 Control Panel"
gui.Config.Width = 640
gui.Config.Height = 480
gui.Config.Exit = myDefaultExit
sleep(1)
me.window = gui.NewWindow()
me.window.Dump()
addDNSTab("DNS")
if (args.GuiDebug) {
gui.DebugWindow()
}
gui.ShowDebugValues()
}
func addDNSTab(title string) {
var g2 *gui.Node
me.tab = me.window.NewTab(title)
// log("addDemoTab() newNode.Dump")
// newNode.Dump()
me.notes = me.tab.NewGroup("junk")
dd := me.notes.NewDropdown("demoCombo2")
dd.AddDropdownName("more 1")
dd.AddDropdownName("more 2")
dd.AddDropdownName("more 3")
dd.Custom = func() {
s := dd.GetText()
output("dd.Custom( dd.GetText() ) =" + s + "\n", true)
}
me.notes.NewButton("hello", func () {
log("world")
})
g2 = me.tab.NewGroup("Real Stuff")
g2.NewButton("gui.DebugWindow()", func () {
gui.DebugWindow()
})
g2.NewButton("Load 'gocui'", func () {
// this set the xterm and mate-terminal window title. maybe works generally?
fmt.Println("\033]0;" + title + "blah \007")
gui.StartS("gocui")
gui.Redraw("gocui")
})
g2.NewButton("Network Interfaces", func () {
for i, t := range me.ifmap {
log("name =", t.iface.Name)
log("int =", i, "name =", t.name, t.iface)
log("iface = " + t.iface.Name)
output("iface = " + t.iface.Name + "\n", true)
}
})
g2.NewButton("Hostname", func () {
getHostname()
output("FQDN = " + me.fqdn + "\n", true)
})
g2.NewButton("Actual AAAA", func () {
var aaaa []string
aaaa = realAAAA()
for _, s := range aaaa {
log("my actual AAAA = ", s)
output("my actual AAAA = " + s + "\n", true)
}
})
@ -69,15 +73,7 @@ func addDNSTab(title string) {
g2.NewButton("os.User()", func () {
user, _ := user.Current()
spew.Dump(user)
log("os.Getuid =", user.Username, os.Getuid())
if (me.uid != nil) {
me.uid.SetText(user.Username + " (" + strconv.Itoa(os.Getuid()) + ")")
}
})
g2.NewButton("dig +trace", func () {
o := shell.Run("dig +trace +noadditional DS " + me.hostname + " @8.8.8.8")
log(o)
// log(o)
log("os.Getuid =", os.Getuid())
})
g2.NewButton("Example_listLink()", func () {
Example_listLink()
@ -85,6 +81,16 @@ func addDNSTab(title string) {
g2.NewButton("Escalate()", func () {
Escalate()
})
g2.NewButton("pprof(goroutine)", func () {
loggo()
// panic("correctly inside of gui goroutine (goroutine 1?)")
})
g2.NewButton("gui.DebugWindow()", func () {
gui.DebugWindow()
})
g2.NewButton("NewCheckbox(test)", func () {
me.notes.NewCheckbox("test")
})
g2.NewButton("LookupAddr(<raw ipv6>) == fire from /etc/hosts", func () {
host, err := net.LookupAddr("2600:1700:afd5:6000:b26e:bfff:fe80:3c52")
if err != nil {
@ -114,41 +120,25 @@ func myDefaultExit(n *gui.Node) {
func nsupdateGroup(w *gui.Node) {
g := w.NewGroup("dns update")
grid := g.NewGrid("gridnuts", 2, 2)
grid.SetNext(1,1)
grid.NewLabel("hostname =")
me.fqdn = grid.NewLabel("?")
me.hostname = ""
grid.NewLabel("UID =")
me.uid = grid.NewLabel("?")
grid.NewLabel("DNS AAAA =")
me.DnsAAAA = grid.NewLabel("?")
grid.NewLabel("DNS A =")
me.DnsA = grid.NewLabel("?")
grid.NewLabel("IPv4 =")
me.IPv4 = grid.NewLabel("?")
grid.NewLabel("IPv6 =")
me.IPv6 = grid.NewLabel("?")
grid.NewLabel("interfaces =")
me.Interfaces = grid.NewCombobox("Interfaces")
grid.NewLabel("DNS Status =")
me.DnsStatus = grid.NewLabel("unknown")
g.NewButton("Update DNS", func () {
log("updateDNS()")
updateDNS()
me.tab.Margin()
me.tab.Pad()
grid.Pad()
g.NewLabel("UID = " + me.user)
g.NewButton("DNS AAAA", func () {
var aaaa []string
var out string
h := me.fqdn
// h := "fire.lab.wit.org"
aaaa = dnsAAAA(h)
log(SPEW, me)
if (aaaa == nil) {
out += "There are no DNS AAAA records for hostname: " + h + "\n"
}
for _, s := range aaaa {
out += "host " + h + " DNS AAAA = " + s + "\n"
}
})
g.NewButton("dig +trace", func () {
o := shell.Run("dig +trace +noadditional DS " + me.fqdn + " @8.8.8.8")
output(o, false)
// log(o)
})
}
@ -160,51 +150,5 @@ func output(s string, a bool) {
outJunk = s
}
me.output.SetText(outJunk)
log(outJunk)
}
func updateDNS() {
var aaaa []string
h := me.hostname
if (h == "") {
h = "unknown.lab.wit.org"
// h = "hpdevone.lab.wit.org"
}
log("dnsAAAA()()")
aaaa = dnsAAAA(h)
log("dnsAAAA()()")
log(SPEW, me)
if (aaaa == nil) {
log("There are no DNS AAAA records for hostname: ", h)
}
var broken int = 0
var all string
for _, s := range aaaa {
log("host", h, "DNS AAAA =", s)
all += s + "\n"
if ( me.ipmap[s] == nil) {
log("THIS IS THE WRONG AAAA DNS ENTRY: host", h, "DNS AAAA =", s)
broken = 2
} else {
if (broken == 0) {
broken = 1
}
}
}
all = strings.TrimSpace(all)
me.DnsAAAA.SetText(all)
if (broken == 1) {
me.DnsStatus.SetText("WORKING")
} else {
me.DnsStatus.SetText("BROKEN")
log("Need to run go-nsupdate here")
}
user, _ := user.Current()
spew.Dump(user)
log("os.Getuid =", user.Username, os.Getuid())
if (me.uid != nil) {
me.uid.SetText(user.Username + " (" + strconv.Itoa(os.Getuid()) + ")")
}
log("updateDNS() END")
//log(outJunk)
}

57
he-ipv6-tunnel.sh Executable file
View File

@ -0,0 +1,57 @@
#!/bin/bash -x
## Tunnel ID: 818143
# Creation Date:Feb 12, 2023
# Description:
# IPv6 Tunnel Endpoints
# Server IPv4 Address:184.105.253.14
# Server IPv6 Address:2001:470:1f10:2a::1/64
# Client IPv4 Address:74.87.91.117
# Client IPv6 Address:2001:470:1f10:2a::2/64
# Routed IPv6 Prefixes
# Routed /64:2001:470:1f11:2a::/64
# Routed /48:Assign /48
# DNS Resolvers
# Anycast IPv6 Caching Nameserver:2001:470:20::2
# Anycast IPv4 Caching Nameserver:74.82.42.42
# DNS over HTTPS / DNS over TLS:ordns.he.net
# rDNS DelegationsEdit
# rDNS Delegated NS1:
# rDNS Delegated NS2:
# rDNS Delegated NS3:
# rDNS Delegated NS4:
# rDNS Delegated NS5:
# ifconfig sit0 up
# ifconfig sit0 inet6 tunnel ::184.105.253.14
# ifconfig sit1 up
# ifconfig sit1 inet6 add 2001:470:1f10:2a::2/64
# route -A inet6 add ::/0 dev sit1
if [ "$1" = "down" ]; then
ip tunnel del he-ipv6
rmmod sit
exit
fi
if [ "$1" = "ping" ]; then
ping -c 3 2001:470:1f10:13d::1
exit
fi
modprobe ipv6
ip tunnel add he-ipv6 mode sit remote 184.105.253.14 local 40.132.180.131 ttl 255
ip link set he-ipv6 up
ip addr add 2001:470:1f10:13d::2/64 dev he-ipv6
ip route add ::/0 dev he-ipv6
ip -f inet6 addr
ifconfig he-ipv6 mtu 1460
# old attempt from the something or pabtz hotel
# modprobe ipv6
# ip tunnel add he-ipv6 mode sit remote 184.105.253.14 local 74.87.91.117 ttl 255
# ip link set he-ipv6 up
# ip addr add 2001:470:1f10:2a::2/64 dev he-ipv6
# ip route add ::/0 dev he-ipv6
# ip -f inet6 addr

View File

@ -18,20 +18,13 @@ import "git.wit.org/jcarr/dnssecsocket"
func getHostname() {
var err error
var s string = "gui.Label == nil"
s, err = fqdn.FqdnHostname()
me.fqdn, err = fqdn.FqdnHostname()
if (err != nil) {
log("FQDN hostname error =", err)
exit()
return
}
if (me.fqdn != nil) {
if (me.hostname != s) {
me.fqdn.SetText(s)
me.hostname = s
me.changed = true
}
}
log("FQDN =", s)
log("FQDN hostname is", me.fqdn)
}
func dnsAAAA(s string) []string {

125
log.go
View File

@ -1,30 +1,123 @@
//
// version v1.1
//
// I like things to be easy.
//
// this means all the log settings are in one place. it should allow
// things to be over-ridden externally to the library
// but still allow command line --args to pass debugging settings
//
// I also have a generic sleep() and exit() in here because it's simple
//
// Usage:
//
// log("something", foo, bar)
// var DEBUG bool = true
// log(DEBUG, "something else", someOtherVariable) # if DEBUG == false, return doing nothing
// log(SPEW, "something else", someOtherVariable) # this get's sent to spew.Dump(). Very useful for debugging!
//
package main
import (
witlog "git.wit.org/wit/gui/log"
"os"
"runtime"
"runtime/pprof"
golog "log"
"time"
"reflect"
"github.com/davecgh/go-spew/spew"
// "net"
)
// various debugging flags
var logNow bool = true // useful for active development
var logError bool = true
var logWarn bool = false
var logInfo bool = false
var logVerbose bool = false
var LOGOFF bool = false // turn this off, all logging stops
var WARN bool
var INFO bool
var SPEW witlog.Spewt
type spewt struct {
a bool
}
// var log interface{}
var SPEW spewt
/*
sleep() # you know what this does? sleeps for 1 second. yep. dump. easy.
sleep(.1) # you know what this does? yes, it sleeps for 1/10th of a second
*/
func sleep(a ...any) {
if (a == nil) {
time.Sleep(time.Second)
return
}
log(args.Verbose, "sleep", a[0])
switch a[0].(type) {
case int:
time.Sleep(time.Duration(a[0].(int)) * time.Second)
case float64:
time.Sleep(time.Duration(a[0].(float64) * 1000) * time.Millisecond)
default:
log("sleep a[0], type = ", a[0], reflect.TypeOf(a[0]))
}
}
/*
exit() # yep. exits. I guess everything must be fine
exit(3) # I guess 3 it is then
exit("dont like apples") # ok. I'll make a note of that
*/
func exit(a ...any) {
log("exit", a)
//if (a) {
// os.Exit(a)
//}
os.Exit(0)
}
/*
I've spent, am spending, too much time thinking about 'logging'. 'log', 'logrus', 'zap', whatever.
I'm not twitter. i don't give a fuck about how many nanoseconds it takes to log. Anyway, this
implementation is probably faster than all of those because you just set one bool to FALSE
and it all stops.
Sometimes I need to capture to stdout, sometimes stdout can't
work because it doesn't exist for the user. This whole thing is a PITA. Then it's spread
over 8 million references in every .go file. I'm tapping out and putting
it in one place. here it is. Also, this makes having debug levels really fucking easy.
You can define whatever level of logging you want from anywhere (command line) etc.
log() # doesn't do anything
log(stuff) # sends it to whatever log you define in a single place. here is the place
*/
func log(a ...any) {
witlog.Where = "wit/gui"
witlog.Log(a...)
if (LOGOFF) {
return
}
func sleep(a ...any) {
witlog.Sleep(a...)
if (a == nil) {
return
}
var blah bool
if (reflect.TypeOf(a[0]) == reflect.TypeOf(blah)) {
if (a[0] == false) {
return
}
a = a[1:]
}
func exit(a ...any) {
log(logError, "got to log() exit")
witlog.Exit(a...)
if (reflect.TypeOf(a[0]) == reflect.TypeOf(SPEW)) {
a = a[1:]
// spew.Dump(a)
scs := spew.ConfigState{MaxDepth: 1}
scs.Dump(a)
return
}
golog.Println(a...)
}
func loggo() {
pprof.Lookup("goroutine").WriteTo(os.Stdout, 1)
log("runtime.NumGoroutine() = ", runtime.NumGoroutine())
}

45
main.go
View File

@ -1,19 +1,17 @@
// GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
// Copyright (c) 2023 WIT.COM, Inc.
// This is a control panel for DNS
package main
import (
"strconv"
"runtime"
"time"
// "net"
arg "github.com/alexflint/go-arg"
"git.wit.org/wit/gui"
)
var p *arg.Parser
var myGui *gui.Node
func main() {
p = arg.MustParse(&args)
@ -25,6 +23,7 @@ func main() {
me.ifmap = make(map[int]*IFtype)
me.dnsTTL = 5 // recheck DNS is working every 2 minutes // TODO: watch rx packets?
go checkNetworkChanges()
log()
log(true, "this is true")
@ -33,31 +32,24 @@ func main() {
sleep(.3)
sleep(.2)
sleep("done scanning net")
// exit("done scanning net")
// Example_listLink()
// exit()
log("Toolkit = ", args.Toolkit)
// gui.InitPlugins([]string{"andlabs"})
// gui.SetDebug(true)
// myGui = gui.Main(initGUI)
myGui = gui.Start()
sleep(1)
setupControlPanelWindow()
sleep(1)
myGui.LoadPlugin("gocui")
// gui.Redraw("gocui")
sleep(1)
checkNetworkChanges()
gui.SetDebug(args.GuiDebug)
gui.Main(initGUI)
}
/*
Poll for changes to the networking settings
*/
func checkNetworkChanges() {
var ttl int = 0
var ttlsleep int = 5
var ttl int = 3
for {
sleep(ttlsleep)
sleep(1)
ttl -= 1
if (ttl < 0) {
if (runtime.GOOS == "linux") {
@ -72,29 +64,16 @@ func checkNetworkChanges() {
// Run this every once and a while
func dnsTTL() {
me.changed = false
log("FQDN =", me.fqdn.GetText())
output("FQDN = " + me.fqdn + "\n", false)
getHostname()
scanInterfaces()
for i, t := range me.ifmap {
log(strconv.Itoa(i) + " iface = " + t.iface.Name)
output(strconv.Itoa(i) + " iface = " + t.iface.Name + "\n", true)
}
var aaaa []string
aaaa = realAAAA()
var all string
for _, s := range aaaa {
log("my actual AAAA = ",s)
all += s + "\n"
}
// me.IPv6.SetText(all)
if (me.changed) {
stamp := time.Now().Format("2006/01/02 15:04:05")
s := stamp + " Network things changed"
log(logError, "Network things changed on", stamp)
updateDNS()
me.output.SetText(s)
output("my actual AAAA = " + s + "\n", true)
}
// loggo()
}

39
net.go
View File

@ -78,11 +78,7 @@ func checkInterface(i net.Interface) {
me.ifmap[i.Index] = new(IFtype)
me.ifmap[i.Index].gone = false
me.ifmap[i.Index].iface = &i
me.changed = true
if (me.Interfaces != nil) {
me.Interfaces.AddText(i.Name)
me.Interfaces.SetText(i.Name)
}
me.ipchange = true
return
}
me.ifmap[i.Index].gone = false
@ -90,11 +86,7 @@ func checkInterface(i net.Interface) {
if (val.iface.Name != i.Name) {
log(val.iface.Name, "has changed to it's name to", i.Name)
me.ifmap[i.Index].iface = &i
me.changed = true
if (me.Interfaces != nil) {
me.Interfaces.AddText(i.Name)
me.Interfaces.SetText(i.Name)
}
me.ipchange = true
return
}
}
@ -164,15 +156,9 @@ func checkIP(ip *net.IPNet, i net.Interface) bool {
me.ipmap[realip].ipv6 = true
me.ipmap[realip].ipv4 = false
t = "IPv6"
if (me.IPv6 != nil) {
me.IPv6.SetText(realip)
}
} else {
me.ipmap[realip].ipv6 = false
me.ipmap[realip].ipv4 = true
if (me.IPv4 != nil) {
me.IPv4.SetText(realip)
}
}
if (IsReal(&ip.IP)) {
log("\tIP is Real ", t, i.Index, i.Name, realip)
@ -187,7 +173,7 @@ func checkIP(ip *net.IPNet, i net.Interface) bool {
}
func scanInterfaces() {
me.changed = false
me.ipchange = false
ifaces, _ := net.Interfaces()
// me.ifnew = ifaces
log(DEBUGNET, SPEW, ifaces)
@ -213,23 +199,6 @@ func scanInterfaces() {
}
}
deleteChanges()
var all4 string
var all6 string
for s, t := range me.ipmap {
if (t.ipv4) {
all4 += s + "\n"
log("IPv4 =", s)
} else if (t.ipv6) {
all6 += s + "\n"
log("IPv6 =", s)
} else {
log("???? =", s)
}
}
all4 = strings.TrimSpace(all4)
all6 = strings.TrimSpace(all6)
me.IPv4.SetText(all4)
me.IPv6.SetText(all6)
}
// delete network interfaces and ip addresses from the gui
@ -238,7 +207,6 @@ func deleteChanges() {
if (t.gone) {
log("DELETE int =", i, "name =", t.name, t.iface)
delete(me.ifmap, i)
me.changed = true
}
t.gone = true
}
@ -249,7 +217,6 @@ func deleteChanges() {
log("DELETE name =", s, "iface =", t.iface)
log("DELETE name =", s, "ip =", t.ip)
delete(me.ipmap, s)
me.changed = true
}
t.gone = true
}

View File

@ -9,8 +9,7 @@ func Example_listLink() {
// Dial a connection to the rtnetlink socket
conn, err := rtnetlink.Dial(nil)
if err != nil {
log(logError, "Example_listLink() failed", err)
return
exit(err)
}
defer conn.Close()

View File

@ -12,25 +12,17 @@ var me Host
type Host struct {
hostname string // mirrors
domainname string // kernel.org
// fqdn string // mirrors.kernel.org
fqdn string // mirrors.kernel.org
dnsTTL int // Recheck DNS is working every TTL (in seconds)
changed bool // set to true if things changed
user string // name of the user
ipmap map[string]*IPtype // the current ip addresses
dnsmap map[string]*IPtype // the current dns addresses
ifmap map[int]*IFtype // the current interfaces
ipchange bool // set to true if things change
window *gui.Node // the main window
tab *gui.Node // the main dns tab
notes *gui.Node // using this to put notes here
output *gui.Node // Textbox for dumping output
uid *gui.Node // user
fqdn *gui.Node // display the full hostname
IPv4 *gui.Node // show valid IPv4 addresses
IPv6 *gui.Node // show valid IPv6 addresses
Interfaces *gui.Node // Interfaces
DnsAAAA *gui.Node // the actual DNS AAAA results
DnsA *gui.Node // the actual DNS A results (ignore for status since mostly never happens?)
DnsStatus *gui.Node // the current state of DNS
}
type IPtype struct {

View File

@ -24,7 +24,6 @@ func Escalate() {
cmd.Stderr = os.Stderr
err := cmd.Run()
if err != nil {
log(logError, "exit in Escalate()")
exit(err)
}
}
@ -46,7 +45,7 @@ func DumpPublicDNSZone(zone string) {
func dumpIPs(host string) {
ips, err := net.LookupIP(host)
if err != nil {
log(logError, "dumpIPs() failed:", err)
exit(err)
}
for _, ip := range ips {
log(host, ip)