Compare commits
No commits in common. "259b4bdb408fd234cf1c76f94463a85d87fdadb6" and "15d9f9769360b1cb8c748de8ee995030ade5eb35" have entirely different histories.
259b4bdb40
...
15d9f97693
66
args.go
66
args.go
|
@ -22,32 +22,62 @@ var NOW log.LogFlag
|
||||||
var INFO log.LogFlag
|
var INFO log.LogFlag
|
||||||
var NET log.LogFlag
|
var NET log.LogFlag
|
||||||
var DNS log.LogFlag
|
var DNS log.LogFlag
|
||||||
var WARN log.LogFlag
|
var PROC log.LogFlag
|
||||||
var SPEW log.LogFlag
|
var SPEW log.LogFlag
|
||||||
var CHANGE log.LogFlag
|
var CHANGE log.LogFlag
|
||||||
var STATUS log.LogFlag
|
var STATUS log.LogFlag
|
||||||
|
|
||||||
func myreg(f *log.LogFlag, b bool, name string, desc string) {
|
|
||||||
f.B = b
|
|
||||||
f.Subsystem = "go.wit.com/control-panels/dns"
|
|
||||||
f.Short = "cpdns"
|
|
||||||
f.Desc = desc
|
|
||||||
f.Name = name
|
|
||||||
f.Register()
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
arg.MustParse(&args)
|
arg.MustParse(&args)
|
||||||
// fmt.Println(args.Foo, args.Bar, args.User)
|
// fmt.Println(args.Foo, args.Bar, args.User)
|
||||||
|
|
||||||
myreg(&NOW, true, "NOW", "temp debugging stuff")
|
NOW.B = false
|
||||||
myreg(&INFO, false, "INFO", "normal debugging stuff")
|
NOW.Name = "NOW"
|
||||||
myreg(&NET, false, "NET", "Network logging")
|
NOW.Subsystem = "cpdns"
|
||||||
myreg(&DNS, false, "DNS", "dnsStatus.update()")
|
NOW.Desc = "temp debugging stuff"
|
||||||
myreg(&WARN, true, "WARN", "bad things")
|
NOW.Register()
|
||||||
myreg(&SPEW, false, "SPEW", "spew stuff")
|
|
||||||
myreg(&CHANGE, true, "CHANGE", "when host or dns change")
|
INFO.B = false
|
||||||
myreg(&STATUS, false, "STATUS", "updateStatus()")
|
INFO.Name = "INFO"
|
||||||
|
INFO.Subsystem = "cpdns"
|
||||||
|
INFO.Desc = "normal debugging stuff"
|
||||||
|
INFO.Register()
|
||||||
|
|
||||||
|
NET.B = false
|
||||||
|
NET.Name = "NET"
|
||||||
|
NET.Subsystem = "cpdns"
|
||||||
|
NET.Desc = "Network logging"
|
||||||
|
NET.Register()
|
||||||
|
|
||||||
|
DNS.B = false
|
||||||
|
DNS.Name = "DNS"
|
||||||
|
DNS.Subsystem = "cpdns"
|
||||||
|
DNS.Desc = "dnsStatus.update()"
|
||||||
|
DNS.Register()
|
||||||
|
|
||||||
|
PROC.B = false
|
||||||
|
PROC.Name = "PROC"
|
||||||
|
PROC.Subsystem = "cpdns"
|
||||||
|
PROC.Desc = "/proc logging"
|
||||||
|
PROC.Register()
|
||||||
|
|
||||||
|
SPEW.B = false
|
||||||
|
SPEW.Name = "SPEW"
|
||||||
|
SPEW.Subsystem = "cpdns"
|
||||||
|
SPEW.Desc = "spew logging"
|
||||||
|
SPEW.Register()
|
||||||
|
|
||||||
|
CHANGE.B = true
|
||||||
|
CHANGE.Name = "CHANGE"
|
||||||
|
CHANGE.Subsystem = "cpdns"
|
||||||
|
CHANGE.Desc = "show droplet state changes"
|
||||||
|
CHANGE.Register()
|
||||||
|
|
||||||
|
STATUS.B = false
|
||||||
|
STATUS.Name = "STATUS"
|
||||||
|
STATUS.Subsystem = "cpdns"
|
||||||
|
STATUS.Desc = "updateStatus()"
|
||||||
|
STATUS.Register()
|
||||||
|
|
||||||
if debugger.ArgDebug() {
|
if debugger.ArgDebug() {
|
||||||
log.Log(true, "INIT() gui debug == true")
|
log.Log(true, "INIT() gui debug == true")
|
||||||
|
|
|
@ -245,14 +245,6 @@ func (ds *digStatus) updateDnsStatus() {
|
||||||
out = shell.Run(cmd)
|
out = shell.Run(cmd)
|
||||||
log.Log(DNS, "makeDnsStatusGrid() dig", out)
|
log.Log(DNS, "makeDnsStatusGrid() dig", out)
|
||||||
me.digStatus.set(ds.DnsDigTCP, out)
|
me.digStatus.set(ds.DnsDigTCP, out)
|
||||||
|
|
||||||
/*
|
|
||||||
g2.NewButton("dig +trace", func () {
|
|
||||||
log.Log(NOW, "TODO: redo this")
|
|
||||||
// o := shell.Run("dig +trace +noadditional DS " + me.hostname + " @8.8.8.8")
|
|
||||||
// log.Println(o)
|
|
||||||
})
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ds *digStatus) makeHttpStatusGrid() {
|
func (ds *digStatus) makeHttpStatusGrid() {
|
||||||
|
|
8
dns.go
8
dns.go
|
@ -40,7 +40,6 @@ func (h *Host) setIPv4(ipv4s map[string]*IPtype) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
func (h *Host) checkDNS() {
|
func (h *Host) checkDNS() {
|
||||||
var ip4 bool = false
|
var ip4 bool = false
|
||||||
var ip6 bool = false
|
var ip6 bool = false
|
||||||
|
@ -75,7 +74,6 @@ func (h *Host) checkDNS() {
|
||||||
log.Println(args.VerboseDNS, "IPv6 is broken. Need to fix it here.")
|
log.Println(args.VerboseDNS, "IPv6 is broken. Need to fix it here.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
// nsLookup performs an NS lookup on the given domain name.
|
// nsLookup performs an NS lookup on the given domain name.
|
||||||
func lookupNS(domain string) {
|
func lookupNS(domain string) {
|
||||||
|
@ -113,10 +111,10 @@ func lookupNS(domain string) {
|
||||||
}
|
}
|
||||||
tmp = shell.Chomp(tmp)
|
tmp = shell.Chomp(tmp)
|
||||||
|
|
||||||
if (tmp != me.statusDNS.NSrr.Get()) {
|
if (tmp != me.status.NSrr.Get()) {
|
||||||
me.changed = true
|
me.changed = true
|
||||||
log.Log(CHANGE, "lookupNS() setting changed to me.NSrr =", tmp)
|
log.Log(CHANGE, "lookupNS() setting me.NSrr =", tmp)
|
||||||
me.statusDNS.NSrr.Set(tmp)
|
me.status.NSrr.Set(tmp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
47
errorBox.go
47
errorBox.go
|
@ -1,47 +0,0 @@
|
||||||
/*
|
|
||||||
Show a box for a configuration error
|
|
||||||
*/
|
|
||||||
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"go.wit.com/log"
|
|
||||||
"go.wit.com/gui/gui"
|
|
||||||
"go.wit.com/gui/gadgets"
|
|
||||||
)
|
|
||||||
|
|
||||||
type errorBox struct {
|
|
||||||
name string // the problem name
|
|
||||||
|
|
||||||
parent *gui.Node
|
|
||||||
group *gui.Node
|
|
||||||
grid *gui.Node
|
|
||||||
|
|
||||||
l *gui.Node
|
|
||||||
b *gui.Node
|
|
||||||
|
|
||||||
something *gadgets.OneLiner
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewErrorBox(p *gui.Node, name string) *errorBox {
|
|
||||||
var eb *errorBox
|
|
||||||
eb = new(errorBox)
|
|
||||||
eb.parent = p
|
|
||||||
// eb.group = p.NewGroup("eg")
|
|
||||||
// eb.grid = eb.group.NewGrid("labels", 2, 1)
|
|
||||||
|
|
||||||
eb.l = p.NewLabel("click to fix")
|
|
||||||
eb.b = p.NewButton("fix", func() {
|
|
||||||
log.Log(WARN, "should try to fix here")
|
|
||||||
})
|
|
||||||
eb.something = gadgets.NewOneLiner(eb.grid, "something")
|
|
||||||
|
|
||||||
return eb
|
|
||||||
}
|
|
||||||
|
|
||||||
func (eb *errorBox) update() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
func (eb *errorBox) toggle() {
|
|
||||||
}
|
|
133
fix.go
133
fix.go
|
@ -3,141 +3,42 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
"go.wit.com/gui/cloudflare"
|
|
||||||
"go.wit.com/control-panels/dns/smartwindow"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func fix() bool {
|
func fix() bool {
|
||||||
log.Log(CHANGE, "")
|
log.Warn("")
|
||||||
if ! me.statusDNS.Ready() {
|
if ! me.status.Ready() {
|
||||||
log.Log(CHANGE, "The IPv6 Control Panel is not Ready() yet")
|
log.Warn("The IPv6 Control Panel is not Ready() yet")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if me.statusOS.ValidHostname() {
|
if me.statusOS.ValidHostname() {
|
||||||
log.Log(CHANGE, "GOOD Your hostname is VALID:", me.statusOS.GetHostname())
|
log.Warn("Your hostname is VALID:", me.statusOS.GetHostname())
|
||||||
} else {
|
} else {
|
||||||
log.Log(CHANGE, "You must first fix your hostname:", me.statusOS.GetHostname())
|
log.Warn("You must first fix your hostname:", me.statusOS.GetHostname())
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if me.digStatus.IPv4() {
|
if me.digStatus.IPv4() {
|
||||||
log.Log(CHANGE, "GOOD IPv4 addresses are resolving")
|
log.Warn("IPv4 addresses are resolving")
|
||||||
} else {
|
} else {
|
||||||
log.Log(CHANGE, "You must first figure out why you can't look up IPv4 addresses")
|
log.Warn("You must first figure out why you can't look up IPv4 addresses")
|
||||||
log.Log(CHANGE, "Are you on the internet at all?")
|
log.Warn("Are you on the internet at all?")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if me.digStatus.IPv6() {
|
if me.digStatus.IPv6() {
|
||||||
log.Log(CHANGE, "GOOD IPv6 addresses are resolving")
|
log.Warn("IPv6 addresses are resolving")
|
||||||
} else {
|
} else {
|
||||||
log.Log(CHANGE, "You must first figure out why you can't look up IPv6 addresses")
|
log.Warn("You must first figure out why you can't look up IPv6 addresses")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if ! me.statusDNS.IPv4() {
|
if ! me.status.IPv4() {
|
||||||
log.Log(CHANGE, "OK You do not have real IPv4 addresses. Nothing to fix here")
|
log.Warn("You do not have real IPv4 addresses. Nothing to fix here")
|
||||||
}
|
}
|
||||||
if ! me.statusDNS.IPv6() {
|
if ! me.status.IPv6() {
|
||||||
if fixIPv6dns() {
|
log.Warn("IPv6 DNS is broken. Check what is broken here")
|
||||||
log.Log(CHANGE, "IPv6 DNS Repair is underway")
|
log.Warn("What are my IPv6 addresses?")
|
||||||
|
log.Warn("What are the AAAA resource records in DNS?")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
log.Log(CHANGE, "GOOD IPv6 DNS is working!")
|
log.Warn("YOU SHOULD BE IN IPv6 BLISS")
|
||||||
}
|
|
||||||
log.Log(CHANGE, "GOOD YOU SHOULD BE IN IPv6 BLISS")
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func fixIPv6dns() bool {
|
|
||||||
log.Log(INFO, "What are my IPv6 addresses?")
|
|
||||||
var broken bool = false
|
|
||||||
osAAAA := make(map[string]string)
|
|
||||||
dnsAAAA := make(map[string]string)
|
|
||||||
|
|
||||||
for _, aaaa := range me.statusOS.GetIPv6() {
|
|
||||||
log.Log(INFO, "FOUND OS AAAA ip", aaaa)
|
|
||||||
osAAAA[aaaa] = "os"
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Log(INFO, "What are the AAAA resource records in DNS?")
|
|
||||||
for _, aaaa := range me.statusDNS.GetIPv6() {
|
|
||||||
log.Log(INFO, "FOUND DNS AAAA ip", aaaa)
|
|
||||||
dnsAAAA[aaaa] = "dns"
|
|
||||||
}
|
|
||||||
|
|
||||||
// remove old DNS entries first
|
|
||||||
for aaaa, _ := range dnsAAAA {
|
|
||||||
if osAAAA[aaaa] == "dns" {
|
|
||||||
broken = true
|
|
||||||
log.Log(INFO, "DNS AAAA is not in OS", aaaa)
|
|
||||||
addToFixWindow("DELETE", aaaa)
|
|
||||||
/*
|
|
||||||
if deleteFromDNS(aaaa) {
|
|
||||||
log.Log(INFO, "Delete AAAA", aaaa, "Worked")
|
|
||||||
} else {
|
|
||||||
log.Log(INFO, "Delete AAAA", aaaa, "Failed")
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
} else {
|
|
||||||
log.Log(INFO, "DNS AAAA is in OS", aaaa)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// now add new DNS entries
|
|
||||||
for aaaa, _ := range osAAAA {
|
|
||||||
if dnsAAAA[aaaa] == "dns" {
|
|
||||||
log.Log(INFO, "OS AAAA is in DNS", aaaa)
|
|
||||||
} else {
|
|
||||||
broken = true
|
|
||||||
log.Log(INFO, "OS AAAA is not in DNS", aaaa)
|
|
||||||
addToFixWindow("CREATE", aaaa)
|
|
||||||
/*
|
|
||||||
if addToDNS(aaaa) {
|
|
||||||
log.Log(INFO, "Add AAAA", aaaa, "Worked")
|
|
||||||
} else {
|
|
||||||
log.Log(INFO, "Add AAAA", aaaa, "Failed")
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// if anything doesn't match, return false
|
|
||||||
return broken
|
|
||||||
}
|
|
||||||
|
|
||||||
func deleteFromDNS(aaaa string) bool {
|
|
||||||
log.Log(CHANGE, "deleteFromDNS", aaaa)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
func addToDNS(aaaa string) bool {
|
|
||||||
log.Log(CHANGE, "TODO: Add this to DNS !!!!", aaaa)
|
|
||||||
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
|
|
||||||
}
|
|
||||||
|
|
||||||
func exists(m map[string]bool, s string) bool {
|
|
||||||
if _, ok := m[s]; ok {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
func addToFixWindow(t string, ip string) {
|
|
||||||
if me.fixWindow == nil {
|
|
||||||
me.fixWindow = smartwindow.New()
|
|
||||||
me.fixWindow.SetParent(me.myGui)
|
|
||||||
me.fixWindow.InitWindow()
|
|
||||||
me.fixWindow.Title("fix window")
|
|
||||||
me.fixWindow.SetDraw(drawFixWindow)
|
|
||||||
me.fixWindow.Make()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func drawFixWindow(sw *smartwindow.SmartWindow) {
|
|
||||||
log.Log(WARN, "drawFixWindow() START")
|
|
||||||
}
|
|
||||||
|
|
|
@ -2,7 +2,6 @@ package main
|
||||||
|
|
||||||
// Watches for changes to a directory. Works cross-platform
|
// Watches for changes to a directory. Works cross-platform
|
||||||
|
|
||||||
/*
|
|
||||||
import (
|
import (
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
"github.com/fsnotify/fsnotify"
|
"github.com/fsnotify/fsnotify"
|
||||||
|
@ -78,4 +77,3 @@ func fsnotifyNetworkInterfaceChanges() error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
|
124
gui.go
124
gui.go
|
@ -5,7 +5,6 @@ import (
|
||||||
"time"
|
"time"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"sort"
|
|
||||||
|
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
|
|
||||||
|
@ -13,7 +12,7 @@ import (
|
||||||
"go.wit.com/gui/gadgets"
|
"go.wit.com/gui/gadgets"
|
||||||
"go.wit.com/gui/cloudflare"
|
"go.wit.com/gui/cloudflare"
|
||||||
"go.wit.com/gui/debugger"
|
"go.wit.com/gui/debugger"
|
||||||
// "go.wit.com/control-panels/dns/linuxstatus"
|
"go.wit.com/control-panels/dns/linuxstatus"
|
||||||
)
|
)
|
||||||
|
|
||||||
// This setups up the dns control panel window
|
// This setups up the dns control panel window
|
||||||
|
@ -44,6 +43,17 @@ func debugTab(title string) {
|
||||||
updateDNS()
|
updateDNS()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
g2.NewButton("dig +trace", func () {
|
||||||
|
log.Log(NOW, "TODO: redo this")
|
||||||
|
// o := shell.Run("dig +trace +noadditional DS " + me.hostname + " @8.8.8.8")
|
||||||
|
// log.Println(o)
|
||||||
|
})
|
||||||
|
|
||||||
|
g2.NewButton("getProcessNameByPort()", func () {
|
||||||
|
processName := getProcessNameByPort(53)
|
||||||
|
log.Info("Process with port 53:", processName)
|
||||||
|
})
|
||||||
|
|
||||||
g2 = me.debug.Box().NewGroup("debugging options")
|
g2 = me.debug.Box().NewGroup("debugging options")
|
||||||
|
|
||||||
// makes a slider widget
|
// makes a slider widget
|
||||||
|
@ -60,6 +70,30 @@ func debugTab(title string) {
|
||||||
me.debug.Hide()
|
me.debug.Hide()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// will return a AAAA value that needs to be deleted
|
||||||
|
func deleteAAA() string {
|
||||||
|
var aaaa []string
|
||||||
|
aaaa = dhcpAAAA() // your AAAA IP addresses right now
|
||||||
|
for _, s := range aaaa {
|
||||||
|
log.Log(NOW, "DNS AAAA =", s)
|
||||||
|
if ( me.ipmap[s] == nil) {
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
// will return a AAAA value that needs to be added
|
||||||
|
func missingAAAA() string {
|
||||||
|
var aaaa []string
|
||||||
|
aaaa = dhcpAAAA() // your AAAA IP addresses right now
|
||||||
|
for _, s := range aaaa {
|
||||||
|
log.Log(NOW, "missing AAAA =", s)
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
// doesn't actually do any network traffic
|
// doesn't actually do any network traffic
|
||||||
// it just updates the GUI
|
// it just updates the GUI
|
||||||
func displayDNS() string {
|
func displayDNS() string {
|
||||||
|
@ -82,9 +116,8 @@ func displayDNS() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
var a []string
|
var a []string
|
||||||
a = append(a, "fixme")
|
a = realA()
|
||||||
sort.Strings(a)
|
all = sortLines(strings.Join(a, "\n"))
|
||||||
all = strings.Join(a, "\n")
|
|
||||||
if (all == "") {
|
if (all == "") {
|
||||||
log.Log(NOW, "THERE IS NOT a real A DNS ENTRY")
|
log.Log(NOW, "THERE IS NOT a real A DNS ENTRY")
|
||||||
all = "CNAME ipv6.wit.com"
|
all = "CNAME ipv6.wit.com"
|
||||||
|
@ -116,18 +149,8 @@ func mainWindow(title string) {
|
||||||
me.DnsA = grid.NewLabel("?")
|
me.DnsA = grid.NewLabel("?")
|
||||||
|
|
||||||
// This is where you figure out what to do next to fix the problems
|
// This is where you figure out what to do next to fix the problems
|
||||||
me.fixButton = gr.NewButton("fix", func () {
|
gr.NewButton("fix", func () {
|
||||||
if ! fix() {
|
fix()
|
||||||
log.Log(CHANGE, "boo. IPv6 isn't working yet")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
log.Log(CHANGE, "IPv6 WORKED")
|
|
||||||
// update everything here visually for the user
|
|
||||||
hostname := me.statusOS.GetHostname()
|
|
||||||
me.hostname.Set(hostname)
|
|
||||||
me.hostnameStatus.Set("WORKING")
|
|
||||||
me.DnsStatus.Set("WORKING")
|
|
||||||
me.fixButton.Disable()
|
|
||||||
})
|
})
|
||||||
|
|
||||||
grid.Margin()
|
grid.Margin()
|
||||||
|
@ -136,9 +159,29 @@ func mainWindow(title string) {
|
||||||
statusGrid(me.window.Box())
|
statusGrid(me.window.Box())
|
||||||
|
|
||||||
gr = me.window.Box().NewGroup("debugging")
|
gr = me.window.Box().NewGroup("debugging")
|
||||||
me.statusDNSbutton = gr.NewButton("hostname status", func () {
|
gr.NewButton("hostname status", func () {
|
||||||
if ! me.statusDNS.Ready() {return}
|
if ! me.status.Ready() {return}
|
||||||
me.statusDNS.window.Toggle()
|
me.status.window.Toggle()
|
||||||
|
})
|
||||||
|
|
||||||
|
gr.NewButton("linuxstatus.New()", func () {
|
||||||
|
if (me.statusOS == nil) {
|
||||||
|
me.statusOS = linuxstatus.New()
|
||||||
|
}
|
||||||
|
me.statusOS.SetParent(me.myGui)
|
||||||
|
me.statusOS.InitWindow()
|
||||||
|
me.statusOS.Make()
|
||||||
|
me.statusOS.Draw2()
|
||||||
|
})
|
||||||
|
gr.NewButton("statusOS.Ready()", func () {
|
||||||
|
me.statusOS.Ready()
|
||||||
|
})
|
||||||
|
gr.NewButton("statusOS.Draw()", func () {
|
||||||
|
me.statusOS.Draw()
|
||||||
|
me.statusOS.Draw2()
|
||||||
|
})
|
||||||
|
gr.NewButton("statusOS.Update()", func () {
|
||||||
|
me.statusOS.Update()
|
||||||
})
|
})
|
||||||
gr.NewButton("Linux Status", func () {
|
gr.NewButton("Linux Status", func () {
|
||||||
me.statusOS.Toggle()
|
me.statusOS.Toggle()
|
||||||
|
@ -148,10 +191,7 @@ func mainWindow(title string) {
|
||||||
me.digStatus.window.Toggle()
|
me.digStatus.window.Toggle()
|
||||||
})
|
})
|
||||||
gr.NewButton("cloudflare wit.com", func () {
|
gr.NewButton("cloudflare wit.com", func () {
|
||||||
if me.witcom != nil {
|
cloudflare.CreateRR(me.myGui, "wit.com", "3777302ac4a78cd7fa4f6d3f72086d06")
|
||||||
me.witcom.Toggle()
|
|
||||||
}
|
|
||||||
me.witcom = cloudflare.CreateRR(me.myGui, "wit.com", "3777302ac4a78cd7fa4f6d3f72086d06")
|
|
||||||
})
|
})
|
||||||
gr.NewButton("Debug", func () {
|
gr.NewButton("Debug", func () {
|
||||||
me.debug.Toggle()
|
me.debug.Toggle()
|
||||||
|
@ -203,7 +243,7 @@ func statusGrid(n *gui.Node) {
|
||||||
// run everything because something has changed
|
// run everything because something has changed
|
||||||
func updateDNS() {
|
func updateDNS() {
|
||||||
me.digStatus.Update()
|
me.digStatus.Update()
|
||||||
me.statusDNS.Update()
|
me.status.Update()
|
||||||
|
|
||||||
// log.Println("digAAAA()")
|
// log.Println("digAAAA()")
|
||||||
|
|
||||||
|
@ -211,7 +251,7 @@ func updateDNS() {
|
||||||
var aaaa []string
|
var aaaa []string
|
||||||
h := me.statusOS.GetHostname()
|
h := me.statusOS.GetHostname()
|
||||||
aaaa = digAAAA(h)
|
aaaa = digAAAA(h)
|
||||||
log.Log(INFO, "digAAAA() for", h, "=", aaaa)
|
log.Log(NOW, "digAAAA() for", h, "=", aaaa)
|
||||||
|
|
||||||
// log.Println(SPEW, me)
|
// log.Println(SPEW, me)
|
||||||
if (aaaa == nil) {
|
if (aaaa == nil) {
|
||||||
|
@ -225,30 +265,28 @@ func updateDNS() {
|
||||||
cloudflare.CFdialog.NameNode.SetText(h)
|
cloudflare.CFdialog.NameNode.SetText(h)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
d := deleteAAA()
|
d := deleteAAA()
|
||||||
if (d != "") {
|
if (d != "") {
|
||||||
if (cloudflare.CFdialog.ValueNode != nil) {
|
if (cloudflare.CFdialog.ValueNode != nil) {
|
||||||
cloudflare.CFdialog.ValueNode.SetText(d)
|
cloudflare.CFdialog.ValueNode.SetText(d)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m := missingAAAA()
|
||||||
|
if (m != "") {
|
||||||
|
if (cloudflare.CFdialog.ValueNode != nil) {
|
||||||
|
cloudflare.CFdialog.ValueNode.SetText(m)
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
rr := &cloudflare.RRT{
|
||||||
|
Type: "AAAA",
|
||||||
|
Name: me.hostname,
|
||||||
|
Ttl: "Auto",
|
||||||
|
Proxied: false,
|
||||||
|
Content: m,
|
||||||
|
}
|
||||||
|
cloudflare.Update(rr)
|
||||||
*/
|
*/
|
||||||
// m := missingAAAA()
|
}
|
||||||
// if (m != "") {
|
|
||||||
// if (cloudflare.CFdialog.ValueNode != nil) {
|
|
||||||
// cloudflare.CFdialog.ValueNode.SetText(m)
|
|
||||||
// }
|
|
||||||
// /*
|
|
||||||
// rr := &cloudflare.RRT{
|
|
||||||
// Type: "AAAA",
|
|
||||||
// Name: me.hostname,
|
|
||||||
// Ttl: "Auto",
|
|
||||||
// Proxied: false,
|
|
||||||
// Content: m,
|
|
||||||
// }
|
|
||||||
// cloudflare.Update(rr)
|
|
||||||
// */
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
status := displayDNS() // update the GUI based on dig results
|
status := displayDNS() // update the GUI based on dig results
|
||||||
|
|
|
@ -11,7 +11,6 @@ import (
|
||||||
"time"
|
"time"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
"sort"
|
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
|
@ -23,6 +22,7 @@ type hostnameStatus struct {
|
||||||
ready bool
|
ready bool
|
||||||
hidden bool
|
hidden bool
|
||||||
|
|
||||||
|
// hostname string // my hostname. Example: "test.wit.com"
|
||||||
lastname string // used to watch for changes in the hostname
|
lastname string // used to watch for changes in the hostname
|
||||||
|
|
||||||
window *gadgets.BasicWindow
|
window *gadgets.BasicWindow
|
||||||
|
@ -33,10 +33,11 @@ type hostnameStatus struct {
|
||||||
statusIPv4 *gadgets.OneLiner
|
statusIPv4 *gadgets.OneLiner
|
||||||
statusIPv6 *gadgets.OneLiner
|
statusIPv6 *gadgets.OneLiner
|
||||||
|
|
||||||
hostname *gadgets.OneLiner
|
// Details Group
|
||||||
|
hostShort *gadgets.OneLiner
|
||||||
domainname *gadgets.OneLiner
|
domainname *gadgets.OneLiner
|
||||||
|
|
||||||
// what the current IP addresses your network has given you
|
// what the current IP address your network has given you
|
||||||
currentIPv4 *gadgets.OneLiner
|
currentIPv4 *gadgets.OneLiner
|
||||||
currentIPv6 *gadgets.OneLiner
|
currentIPv6 *gadgets.OneLiner
|
||||||
|
|
||||||
|
@ -79,7 +80,7 @@ func NewHostnameStatusWindow(p *gui.Node) *hostnameStatus {
|
||||||
group = hs.window.Box().NewGroup("Details")
|
group = hs.window.Box().NewGroup("Details")
|
||||||
grid = group.NewGrid("LookupDetails", 2, 2)
|
grid = group.NewGrid("LookupDetails", 2, 2)
|
||||||
|
|
||||||
hs.hostname = gadgets.NewOneLiner(grid, "hostname")
|
hs.hostShort = gadgets.NewOneLiner(grid, "hostname -s")
|
||||||
hs.domainname = gadgets.NewOneLiner(grid, "domain name")
|
hs.domainname = gadgets.NewOneLiner(grid, "domain name")
|
||||||
hs.currentIPv4 = gadgets.NewOneLiner(grid, "Current IPv4")
|
hs.currentIPv4 = gadgets.NewOneLiner(grid, "Current IPv4")
|
||||||
hs.currentIPv6 = gadgets.NewOneLiner(grid, "Current IPv6")
|
hs.currentIPv6 = gadgets.NewOneLiner(grid, "Current IPv6")
|
||||||
|
@ -119,6 +120,12 @@ func NewHostnameStatusWindow(p *gui.Node) *hostnameStatus {
|
||||||
return hs
|
return hs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
func (hs *hostnameStatus) ValidHostname() bool {
|
||||||
|
return goodHostname()
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
func (hs *hostnameStatus) Domain() string {
|
func (hs *hostnameStatus) Domain() string {
|
||||||
if ! hs.Ready() {return ""}
|
if ! hs.Ready() {return ""}
|
||||||
return hs.domainname.Get()
|
return hs.domainname.Get()
|
||||||
|
@ -129,6 +136,34 @@ func (hs *hostnameStatus) API() string {
|
||||||
return hs.dnsAPI.Get()
|
return hs.dnsAPI.Get()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
func (hs *hostnameStatus) deleteDNSrecord(value string) bool {
|
||||||
|
log.Info("deleteDNSrecord() START for", value)
|
||||||
|
log.Info("deleteDNSrecord() hostname =", me.status.GetHostname())
|
||||||
|
log.Info("deleteDNSrecord() domain =", hs.Domain())
|
||||||
|
log.Info("deleteDNSrecord() DNS API Provider =", hs.API())
|
||||||
|
|
||||||
|
if (hs.API() == "cloudflare") {
|
||||||
|
log.Info("deleteDNSrecord() Try to delete via cloudflare")
|
||||||
|
return cloudflare.Delete(hs.Domain(), me.status.GetHostname(), value)
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (hs *hostnameStatus) createDNSrecord(value string) bool {
|
||||||
|
log.Info("createDNSrecord() START for", value)
|
||||||
|
log.Info("createDNSrecord() hostname =", me.status.GetHostname())
|
||||||
|
log.Info("createDNSrecord() domain =", hs.Domain())
|
||||||
|
log.Info("createDNSrecord() DNS API Provider =", hs.API())
|
||||||
|
|
||||||
|
if (hs.API() == "cloudflare") {
|
||||||
|
log.Warn("createDNSrecord() Try to create via cloudflare:", me.status.GetHostname(), value)
|
||||||
|
return cloudflare.Create(hs.Domain(), me.status.GetHostname(), value)
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
func (hs *hostnameStatus) Update() {
|
func (hs *hostnameStatus) Update() {
|
||||||
log.Info("hostnameStatus() Update() START")
|
log.Info("hostnameStatus() Update() START")
|
||||||
if hs == nil {
|
if hs == nil {
|
||||||
|
@ -244,38 +279,15 @@ func (hs *hostnameStatus) missingAAAA() bool {
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
func (hs *hostnameStatus) GetIPv6() []string {
|
|
||||||
if ! hs.Ready() { return nil}
|
|
||||||
return strings.Split(hs.dnsAAAA.Get(), "\n")
|
|
||||||
}
|
|
||||||
|
|
||||||
func (hs *hostnameStatus) updateStatus() {
|
func (hs *hostnameStatus) updateStatus() {
|
||||||
if ! hs.Ready() { return }
|
if ! hs.Ready() { return }
|
||||||
var s string
|
var s string
|
||||||
var vals []string
|
var vals []string
|
||||||
log.Log(STATUS, "updateStatus() START")
|
log.Log(STATUS, "updateStatus() START")
|
||||||
|
|
||||||
// copy the OS status over
|
hs.hostShort.Set(me.statusOS.GetHostShort())
|
||||||
lasthostname := hs.hostname.Get()
|
|
||||||
hostname := me.statusOS.GetHostname()
|
|
||||||
|
|
||||||
// hostname changed or was setup for the first time. Set the window title, etc
|
|
||||||
if lasthostname != hostname {
|
|
||||||
me.changed = true
|
|
||||||
hs.hostname.Set(hostname)
|
|
||||||
hs.window.Title(hostname + " Status")
|
|
||||||
me.statusDNSbutton.Set(hostname + " status")
|
|
||||||
}
|
|
||||||
hs.domainname.Set(me.statusOS.GetDomainName())
|
hs.domainname.Set(me.statusOS.GetDomainName())
|
||||||
|
|
||||||
tmp := me.statusOS.GetIPv4()
|
|
||||||
sort.Strings(tmp)
|
|
||||||
hs.currentIPv4.Set(strings.Join(tmp, "\n"))
|
|
||||||
|
|
||||||
tmp = me.statusOS.GetIPv6()
|
|
||||||
sort.Strings(tmp)
|
|
||||||
hs.currentIPv6.Set(strings.Join(tmp, "\n"))
|
|
||||||
|
|
||||||
if me.statusOS.ValidHostname() {
|
if me.statusOS.ValidHostname() {
|
||||||
vals = lookupDoH(me.statusOS.GetHostname(), "AAAA")
|
vals = lookupDoH(me.statusOS.GetHostname(), "AAAA")
|
||||||
|
|
||||||
|
@ -297,8 +309,7 @@ func (hs *hostnameStatus) updateStatus() {
|
||||||
// hs.dnsAction.SetText("DELETE")
|
// hs.dnsAction.SetText("DELETE")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sort.Strings(vals)
|
hs.set(hs.dnsAAAA, s)
|
||||||
hs.dnsAAAA.Set(strings.Join(vals, "\n"))
|
|
||||||
|
|
||||||
vals = lookupDoH(me.statusOS.GetHostname(), "A")
|
vals = lookupDoH(me.statusOS.GetHostname(), "A")
|
||||||
log.Log(STATUS, "IPv4 Addresses for ", me.statusOS.GetHostname(), "=", vals)
|
log.Log(STATUS, "IPv4 Addresses for ", me.statusOS.GetHostname(), "=", vals)
|
||||||
|
@ -317,6 +328,11 @@ func (hs *hostnameStatus) updateStatus() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// hs.currentIPv4.Set(me.IPv4.S)
|
||||||
|
// hs.currentIPv6.Set(me.IPv6.S)
|
||||||
|
hs.currentIPv4.Set("get this from linuxStatus")
|
||||||
|
hs.currentIPv6.Set("get this from linuxStatus")
|
||||||
|
|
||||||
if hs.IPv4() && hs.IPv6() {
|
if hs.IPv4() && hs.IPv6() {
|
||||||
hs.status.Set("GOOD")
|
hs.status.Set("GOOD")
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -29,7 +29,6 @@ func myreg(f *log.LogFlag, b bool, name string, desc string) {
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
myreg(&NOW, true, "NOW", "temp debugging stuff")
|
myreg(&NOW, true, "NOW", "temp debugging stuff")
|
||||||
myreg(&INFO, false, "INFO", "normal debugging stuff")
|
|
||||||
myreg(&NET, false, "NET", "Network Logging")
|
myreg(&NET, false, "NET", "Network Logging")
|
||||||
myreg(&DNS, false, "DNS", "dnsStatus.update()")
|
myreg(&DNS, false, "DNS", "dnsStatus.update()")
|
||||||
myreg(&PROC, false, "PROC", "/proc logging")
|
myreg(&PROC, false, "PROC", "/proc logging")
|
||||||
|
|
|
@ -24,7 +24,6 @@ func draw(ls *LinuxStatus) {
|
||||||
ls.uid = gadgets.NewOneLiner(ls.grid, "UID =")
|
ls.uid = gadgets.NewOneLiner(ls.grid, "UID =")
|
||||||
ls.IPv4 = gadgets.NewOneLiner(ls.grid, "Current IPv4 =")
|
ls.IPv4 = gadgets.NewOneLiner(ls.grid, "Current IPv4 =")
|
||||||
ls.IPv6 = gadgets.NewOneLiner(ls.grid, "Current IPv6 =")
|
ls.IPv6 = gadgets.NewOneLiner(ls.grid, "Current IPv6 =")
|
||||||
ls.workingIPv4 = gadgets.NewOneLiner(ls.grid, "Real IPv4 =")
|
|
||||||
ls.workingIPv6 = gadgets.NewOneLiner(ls.grid, "Real IPv6 =")
|
ls.workingIPv6 = gadgets.NewOneLiner(ls.grid, "Real IPv6 =")
|
||||||
// ls.nics = gadgets.NewOneLiner(ls.grid, "network intefaces =")
|
// ls.nics = gadgets.NewOneLiner(ls.grid, "network intefaces =")
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
package linuxstatus
|
package linuxstatus
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
|
"go.wit.com/shell"
|
||||||
|
|
||||||
// will try to get this hosts FQDN
|
// will try to get this hosts FQDN
|
||||||
"github.com/Showmax/go-fqdn"
|
"github.com/Showmax/go-fqdn"
|
||||||
|
@ -117,14 +117,7 @@ func lookupHostname() {
|
||||||
// On Linux, /etc/hosts, /etc/hostname
|
// On Linux, /etc/hosts, /etc/hostname
|
||||||
// and domainname and hostname
|
// and domainname and hostname
|
||||||
func goodHostname() bool {
|
func goodHostname() bool {
|
||||||
content, err := ioutil.ReadFile("/etc/hostname")
|
hostname := shell.Chomp(shell.Cat("/etc/hostname"))
|
||||||
if err != nil {
|
|
||||||
// this needs to be a fixWindow() error
|
|
||||||
log.Error(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
hostname := string(content)
|
|
||||||
|
|
||||||
log.Log(NOW, "hostname =", hostname)
|
log.Log(NOW, "hostname =", hostname)
|
||||||
|
|
||||||
hs := run("hostname -s")
|
hs := run("hostname -s")
|
||||||
|
|
|
@ -1,88 +1,38 @@
|
||||||
// GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
|
// GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
|
||||||
// Copyright (c) 2023 WIT.COM, Inc.
|
// Copyright (c) 2023 WIT.COM, Inc.
|
||||||
|
|
||||||
// This is a control panel for DNS
|
// This is a control panel for DNS
|
||||||
|
|
||||||
// This is the main Linux kernel / OS code
|
|
||||||
// to check your network settings are correct
|
|
||||||
// This does (and should do) no network or external checking
|
|
||||||
// This is just the state of your OS
|
|
||||||
|
|
||||||
package linuxstatus
|
package linuxstatus
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
"os/user"
|
"os/user"
|
||||||
"io/ioutil"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"sort"
|
|
||||||
|
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func linuxLoop() {
|
func linuxLoop() {
|
||||||
me.changed = false
|
me.changed = false
|
||||||
|
duration := timeFunction(lookupHostname)
|
||||||
|
log.Log(INFO, "getHostname() execution Time: ", duration, "me.changed =", me.changed)
|
||||||
|
|
||||||
// checks for a VALID hostname
|
duration = timeFunction(scanInterfaces)
|
||||||
lookupHostname()
|
log.Log(NET, "scanInterfaces() execution Time: ", duration)
|
||||||
if me.changed {
|
|
||||||
log.Log(CHANGE, "lookupHostname() detected a change")
|
|
||||||
}
|
|
||||||
|
|
||||||
// scans the linux network intefaces for your available IPv4 & IPv6 addresses
|
|
||||||
scanInterfaces()
|
|
||||||
if me.changed {
|
|
||||||
log.Log(CHANGE, "scanInterfaces() detected a change")
|
|
||||||
}
|
|
||||||
for i, t := range me.ifmap {
|
for i, t := range me.ifmap {
|
||||||
log.Log(NET, strconv.Itoa(i) + " iface = " + t.iface.Name)
|
log.Log(NET, strconv.Itoa(i) + " iface = " + t.iface.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
// get all the real A records from all the network interfaces linux can see
|
|
||||||
a := realA()
|
|
||||||
sort.Strings(a)
|
|
||||||
tmp := strings.Join(a, "\n")
|
|
||||||
if tmp != me.workingIPv4.Get() {
|
|
||||||
log.Log(CHANGE, "realAAAA() your real IPv6 addresses changed")
|
|
||||||
me.changed = true
|
|
||||||
me.workingIPv4.Set(tmp)
|
|
||||||
}
|
|
||||||
|
|
||||||
// get all the real AAAA records from all the network interfaces linux can see
|
// get all the real AAAA records from all the network interfaces linux can see
|
||||||
aaaa := realAAAA()
|
tmp := strings.Join(realAAAA(), "\n")
|
||||||
sort.Strings(aaaa)
|
tmp = sortLines(tmp)
|
||||||
tmp = strings.Join(aaaa, "\n")
|
|
||||||
if tmp != me.workingIPv6.Get() {
|
|
||||||
log.Log(CHANGE, "realAAAA() your real IPv6 addresses changed")
|
|
||||||
me.changed = true
|
|
||||||
me.workingIPv6.Set(tmp)
|
me.workingIPv6.Set(tmp)
|
||||||
}
|
|
||||||
|
|
||||||
user, _ := user.Current()
|
user, _ := user.Current()
|
||||||
tmp = user.Username + " (" + strconv.Itoa(os.Getuid()) + ")"
|
log.Log(INFO, "os.Getuid =", user.Username, os.Getuid())
|
||||||
if tmp != me.uid.Get() {
|
if (me.uid != nil) {
|
||||||
log.Log(CHANGE, "os.Getuid =", user.Username, os.Getuid())
|
me.uid.Set(user.Username + " (" + strconv.Itoa(os.Getuid()) + ")")
|
||||||
me.changed = true
|
|
||||||
me.uid.Set(tmp)
|
|
||||||
}
|
|
||||||
|
|
||||||
content, _ := ioutil.ReadFile("/etc/resolv.conf")
|
|
||||||
var ns []string
|
|
||||||
for _, line := range strings.Split(string(content), "\n") {
|
|
||||||
parts := strings.Split(line, " ")
|
|
||||||
if len(parts) > 1 {
|
|
||||||
if parts[0] == "nameserver" {
|
|
||||||
ns = append(ns, parts[1])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sort.Strings(ns)
|
|
||||||
newNS := strings.Join(ns, "\n")
|
|
||||||
if newNS != me.resolver.Get() {
|
|
||||||
log.Log(CHANGE, "resolver changed in /etc/resolv.conf to", ns)
|
|
||||||
me.changed = true
|
|
||||||
me.resolver.Set(newNS)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -269,21 +269,3 @@ func deleteChanges() bool {
|
||||||
|
|
||||||
return changed
|
return changed
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ls *LinuxStatus) GetIPv6() []string {
|
|
||||||
if ! me.Ready() {return nil}
|
|
||||||
tmp := me.workingIPv6.Get()
|
|
||||||
return strings.Split(tmp, "\n")
|
|
||||||
}
|
|
||||||
|
|
||||||
func (ls *LinuxStatus) GetIPv4() []string {
|
|
||||||
if ! me.Ready() {return nil}
|
|
||||||
tmp := me.workingIPv4.Get()
|
|
||||||
return strings.Split(tmp, "\n")
|
|
||||||
}
|
|
||||||
|
|
||||||
func (ls *LinuxStatus) GetNameservers() []string {
|
|
||||||
if ! me.Ready() {return nil}
|
|
||||||
tmp := me.resolver.Get()
|
|
||||||
return strings.Split(tmp, "\n")
|
|
||||||
}
|
|
||||||
|
|
|
@ -35,7 +35,6 @@ type LinuxStatus struct {
|
||||||
uid *gadgets.OneLiner
|
uid *gadgets.OneLiner
|
||||||
IPv4 *gadgets.OneLiner
|
IPv4 *gadgets.OneLiner
|
||||||
IPv6 *gadgets.OneLiner
|
IPv6 *gadgets.OneLiner
|
||||||
workingIPv4 *gadgets.OneLiner
|
|
||||||
workingIPv6 *gadgets.OneLiner
|
workingIPv6 *gadgets.OneLiner
|
||||||
Interfaces *gui.Node
|
Interfaces *gui.Node
|
||||||
speed *gadgets.OneLiner
|
speed *gadgets.OneLiner
|
||||||
|
|
|
@ -13,6 +13,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
|
"go.wit.com/shell"
|
||||||
)
|
)
|
||||||
|
|
||||||
func CheckSuperuser() bool {
|
func CheckSuperuser() bool {
|
||||||
|
@ -88,8 +89,7 @@ func run(s string) string {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
// Trim leading and trailing whitespace from each line
|
tmp := shell.Chomp(out.String())
|
||||||
tmp := strings.TrimSpace(out.String())
|
|
||||||
// Output the results
|
// Output the results
|
||||||
log.Info("Command Output:", tmp)
|
log.Info("Command Output:", tmp)
|
||||||
|
|
||||||
|
|
28
main.go
28
main.go
|
@ -6,6 +6,8 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
"sort"
|
||||||
"runtime"
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
"embed"
|
"embed"
|
||||||
|
@ -44,14 +46,9 @@ func main() {
|
||||||
setupControlPanelWindow()
|
setupControlPanelWindow()
|
||||||
|
|
||||||
me.digStatus = NewDigStatusWindow(me.myGui)
|
me.digStatus = NewDigStatusWindow(me.myGui)
|
||||||
me.statusDNS = NewHostnameStatusWindow(me.myGui)
|
me.status = NewHostnameStatusWindow(me.myGui)
|
||||||
|
|
||||||
me.statusOS = linuxstatus.New()
|
linuxstatus.New()
|
||||||
me.statusOS.SetParent(me.myGui)
|
|
||||||
me.statusOS.InitWindow()
|
|
||||||
me.statusOS.Make()
|
|
||||||
me.statusOS.Draw()
|
|
||||||
me.statusOS.Draw2()
|
|
||||||
|
|
||||||
if debugger.ArgDebug() {
|
if debugger.ArgDebug() {
|
||||||
log.Sleep(2)
|
log.Sleep(2)
|
||||||
|
@ -180,3 +177,20 @@ func timeFunction(f func()) time.Duration {
|
||||||
f() // Execute the function
|
f() // Execute the function
|
||||||
return time.Since(startTime) // Calculate the elapsed time
|
return time.Since(startTime) // Calculate the elapsed time
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// sortLines takes a string, splits it on newlines, sorts the lines,
|
||||||
|
// and rejoins them with newlines.
|
||||||
|
func sortLines(input string) string {
|
||||||
|
lines := strings.Split(input, "\n")
|
||||||
|
|
||||||
|
// Trim leading and trailing whitespace from each line
|
||||||
|
for i, line := range lines {
|
||||||
|
lines[i] = strings.TrimSpace(line)
|
||||||
|
}
|
||||||
|
|
||||||
|
sort.Strings(lines)
|
||||||
|
tmp := strings.Join(lines, "\n")
|
||||||
|
tmp = strings.TrimLeft(tmp, "\n")
|
||||||
|
tmp = strings.TrimRight(tmp, "\n")
|
||||||
|
return tmp
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,91 @@
|
||||||
|
// This creates a simple hello world window
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
// "log"
|
||||||
|
"net"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"go.wit.com/log"
|
||||||
|
)
|
||||||
|
|
||||||
|
func IsIPv6(address string) bool {
|
||||||
|
return strings.Count(address, ":") >= 2
|
||||||
|
}
|
||||||
|
|
||||||
|
func (t *IPtype) IsReal() bool {
|
||||||
|
if (t.ip.IsPrivate() || t.ip.IsLoopback() || t.ip.IsLinkLocalUnicast()) {
|
||||||
|
log.Log(NET, "\t\tIP is Real = false")
|
||||||
|
return false
|
||||||
|
} else {
|
||||||
|
log.Log(NET, "\t\tIP is Real = true")
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsReal(ip *net.IP) bool {
|
||||||
|
if (ip.IsPrivate() || ip.IsLoopback() || ip.IsLinkLocalUnicast()) {
|
||||||
|
log.Log(NET, "\t\tIP is Real = false")
|
||||||
|
return false
|
||||||
|
} else {
|
||||||
|
log.Log(NET, "\t\tIP is Real = true")
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
These are the real IP address you have been
|
||||||
|
given from DHCP
|
||||||
|
*/
|
||||||
|
func dhcpAAAA() []string {
|
||||||
|
var aaaa []string
|
||||||
|
|
||||||
|
for s, t := range me.ipmap {
|
||||||
|
if (t.IsReal()) {
|
||||||
|
if (t.ipv6) {
|
||||||
|
aaaa = append(aaaa, s)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return aaaa
|
||||||
|
}
|
||||||
|
|
||||||
|
func realA() []string {
|
||||||
|
var a []string
|
||||||
|
|
||||||
|
for s, t := range me.ipmap {
|
||||||
|
if (t.IsReal()) {
|
||||||
|
if (t.ipv4) {
|
||||||
|
a = append(a, s)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return a
|
||||||
|
}
|
||||||
|
|
||||||
|
func checkDNS() (map[string]*IPtype, map[string]*IPtype) {
|
||||||
|
var ipv4s map[string]*IPtype
|
||||||
|
var ipv6s map[string]*IPtype
|
||||||
|
|
||||||
|
ipv4s = make(map[string]*IPtype)
|
||||||
|
ipv6s = make(map[string]*IPtype)
|
||||||
|
|
||||||
|
for s, t := range me.ipmap {
|
||||||
|
i := t.iface
|
||||||
|
ipt := "IPv4"
|
||||||
|
if (t.ipv6) {
|
||||||
|
ipt = "IPv6"
|
||||||
|
}
|
||||||
|
if (t.IsReal()) {
|
||||||
|
log.Info("\tIP is Real ", ipt, i.Index, i.Name, s)
|
||||||
|
if (t.ipv6) {
|
||||||
|
ipv6s[s] = t
|
||||||
|
} else {
|
||||||
|
ipv4s[s] = t
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.Info("\tIP is not Real", ipt, i.Index, i.Name, s)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ipv6s, ipv4s
|
||||||
|
}
|
|
@ -6,6 +6,9 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ./go-nsupdate \
|
// ./go-nsupdate \
|
||||||
|
@ -13,7 +16,6 @@ import (
|
||||||
// --tsig-secret="OWh5/ZHIyaz7B8J9m9ZDqZ8448Pke0PTpkYbZmFcOf5a6rEzgmcwrG91u1BHi1/4us+mKKEobDPLw1x6sD+ZJw==" \
|
// --tsig-secret="OWh5/ZHIyaz7B8J9m9ZDqZ8448Pke0PTpkYbZmFcOf5a6rEzgmcwrG91u1BHi1/4us+mKKEobDPLw1x6sD+ZJw==" \
|
||||||
// -i eno2 farm001.lab.wit.com
|
// -i eno2 farm001.lab.wit.com
|
||||||
|
|
||||||
/*
|
|
||||||
func nsupdate() {
|
func nsupdate() {
|
||||||
var tsigSecret string
|
var tsigSecret string
|
||||||
log.Log(NET, "nsupdate() START")
|
log.Log(NET, "nsupdate() START")
|
||||||
|
@ -31,4 +33,3 @@ func nsupdate() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
|
@ -1,4 +1,4 @@
|
||||||
package linuxstatus
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
@ -10,7 +10,7 @@ import (
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetProcessNameByPort(port int) string {
|
func getProcessNameByPort(port int) string {
|
||||||
// Convert port to hex string
|
// Convert port to hex string
|
||||||
portHex := strconv.FormatInt(int64(port), 16)
|
portHex := strconv.FormatInt(int64(port), 16)
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
package smartwindow
|
|
||||||
|
|
||||||
/*
|
|
||||||
this enables command line options from other packages like 'gui' and 'log'
|
|
||||||
*/
|
|
||||||
|
|
||||||
import (
|
|
||||||
"go.wit.com/log"
|
|
||||||
)
|
|
||||||
|
|
||||||
var NOW log.LogFlag
|
|
||||||
var INFO log.LogFlag
|
|
||||||
var SPEW log.LogFlag
|
|
||||||
var WARN log.LogFlag
|
|
||||||
|
|
||||||
func myreg(f *log.LogFlag, b bool, name string, desc string) {
|
|
||||||
f.B = b
|
|
||||||
f.Subsystem = "go.wit.com/gadgets/smartwindow"
|
|
||||||
f.Short = "smartWin"
|
|
||||||
f.Desc = desc
|
|
||||||
f.Name = name
|
|
||||||
f.Register()
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
myreg(&NOW, true, "NOW", "temp debugging stuff")
|
|
||||||
myreg(&INFO, false, "INFO", "normal debugging stuff")
|
|
||||||
myreg(&SPEW, false, "SPEW", "spew stuff")
|
|
||||||
myreg(&WARN, true, "WARN", "bad things")
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
// This creates a 'smart window'
|
|
||||||
// it should work even when it is hidden
|
|
||||||
// from the gui toolkit plugins
|
|
||||||
package smartwindow
|
|
||||||
|
|
||||||
import (
|
|
||||||
"go.wit.com/log"
|
|
||||||
)
|
|
||||||
|
|
||||||
func (sw *SmartWindow) Ready() bool {
|
|
||||||
log.Log(WARN, "Ready() maybe not ready? sw =", sw)
|
|
||||||
if sw == nil {return false}
|
|
||||||
if sw == nil {return false}
|
|
||||||
if sw.window == nil {return false}
|
|
||||||
return sw.ready
|
|
||||||
}
|
|
||||||
|
|
||||||
func (sw *SmartWindow) Initialized() bool {
|
|
||||||
log.Log(WARN, "checking Initialized()")
|
|
||||||
if sw == nil {return false}
|
|
||||||
if sw == nil {return false}
|
|
||||||
if sw.parent == nil {return false}
|
|
||||||
return true
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
package smartwindow
|
|
||||||
|
|
||||||
import (
|
|
||||||
"go.wit.com/log"
|
|
||||||
|
|
||||||
"go.wit.com/gui/gadgets"
|
|
||||||
)
|
|
||||||
|
|
||||||
func New() *SmartWindow {
|
|
||||||
sw := SmartWindow {
|
|
||||||
hidden: true,
|
|
||||||
ready: false,
|
|
||||||
}
|
|
||||||
|
|
||||||
return &sw
|
|
||||||
}
|
|
||||||
|
|
||||||
func (sw *SmartWindow) InitWindow() {
|
|
||||||
if sw == nil {
|
|
||||||
log.Log(WARN, "not initalized yet (no parent for the window?)")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if sw.window != nil {
|
|
||||||
log.Log(WARN, "You already have a SmartWindow")
|
|
||||||
sw.ready = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Log(WARN, "Creating the Window")
|
|
||||||
sw.window = gadgets.NewBasicWindow(sw.parent, sw.title)
|
|
||||||
sw.ready = true
|
|
||||||
}
|
|
|
@ -1,59 +0,0 @@
|
||||||
// This creates a 'smart window'
|
|
||||||
// it should work even when it is hidden
|
|
||||||
// from the gui toolkit plugins
|
|
||||||
package smartwindow
|
|
||||||
|
|
||||||
import (
|
|
||||||
"go.wit.com/log"
|
|
||||||
"go.wit.com/gui/gui"
|
|
||||||
)
|
|
||||||
|
|
||||||
/*
|
|
||||||
all these functions run after the window is Ready()
|
|
||||||
so they should all start with that check
|
|
||||||
*/
|
|
||||||
|
|
||||||
// reports externally if something has changed
|
|
||||||
// since the last time it was asked about it
|
|
||||||
func (sw *SmartWindow) Changed() bool {
|
|
||||||
if ! sw.Ready() {return false}
|
|
||||||
|
|
||||||
if sw.changed {
|
|
||||||
sw.changed = false
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
func (sw *SmartWindow) Show() {
|
|
||||||
if ! sw.Ready() {return}
|
|
||||||
|
|
||||||
log.Log(WARN, "Show() window ready =", sw.ready)
|
|
||||||
sw.window.Show()
|
|
||||||
sw.hidden = false
|
|
||||||
}
|
|
||||||
|
|
||||||
func (sw *SmartWindow) Hide() {
|
|
||||||
if ! sw.Ready() {return}
|
|
||||||
|
|
||||||
log.Log(WARN, "Hide() window ready =", sw.ready)
|
|
||||||
sw.window.Hide()
|
|
||||||
sw.hidden = true
|
|
||||||
}
|
|
||||||
|
|
||||||
func (sw *SmartWindow) Toggle() {
|
|
||||||
if ! sw.Ready() {return}
|
|
||||||
|
|
||||||
log.Log(WARN, "Toggle() window ready =", sw.ready)
|
|
||||||
if sw.hidden {
|
|
||||||
sw.Show()
|
|
||||||
} else {
|
|
||||||
sw.Hide()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (sw *SmartWindow) Box() *gui.Node {
|
|
||||||
if ! sw.Ready() {return nil}
|
|
||||||
|
|
||||||
return sw.window.Box()
|
|
||||||
}
|
|
|
@ -1,84 +0,0 @@
|
||||||
// these are things you can config
|
|
||||||
package smartwindow
|
|
||||||
|
|
||||||
import (
|
|
||||||
"go.wit.com/log"
|
|
||||||
"go.wit.com/gui/gui"
|
|
||||||
)
|
|
||||||
|
|
||||||
/* for now, run these before the window is ready
|
|
||||||
That is, they all start with:
|
|
||||||
|
|
||||||
if ! sw.Initialized() {return}
|
|
||||||
if sw.Ready() {return}
|
|
||||||
*/
|
|
||||||
|
|
||||||
func (sw *SmartWindow) Title(title string) {
|
|
||||||
if ! sw.Initialized() {return}
|
|
||||||
if sw.Ready() {return}
|
|
||||||
|
|
||||||
log.Log(WARN, "Title() =", title)
|
|
||||||
sw.title = title
|
|
||||||
}
|
|
||||||
|
|
||||||
func (sw *SmartWindow) SetParent(p *gui.Node) {
|
|
||||||
if ! sw.Initialized() {return}
|
|
||||||
if sw.Ready() {return}
|
|
||||||
|
|
||||||
log.Log(WARN, "SetParent")
|
|
||||||
if sw.parent == nil {
|
|
||||||
log.Log(WARN, "SetParent =", p)
|
|
||||||
sw.parent = p
|
|
||||||
return
|
|
||||||
} else {
|
|
||||||
log.Log(WARN, "SetParent was already set. TODO: Move to new parent")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (sw *SmartWindow) SetDraw(f func(*SmartWindow)) {
|
|
||||||
if ! sw.Initialized() {return}
|
|
||||||
if sw.Ready() {return}
|
|
||||||
|
|
||||||
sw.populate = f
|
|
||||||
}
|
|
||||||
|
|
||||||
func (sw *SmartWindow) Make() {
|
|
||||||
if ! sw.Initialized() {return}
|
|
||||||
if sw.Ready() {return}
|
|
||||||
|
|
||||||
log.Log(WARN, "Make() window ready =", sw.ready)
|
|
||||||
sw.window.Make()
|
|
||||||
if (sw.populate != nil) {
|
|
||||||
log.Log(WARN, "Make() trying to run Custom sw.populate() here")
|
|
||||||
sw.populate(sw)
|
|
||||||
}
|
|
||||||
sw.ready = true
|
|
||||||
}
|
|
||||||
|
|
||||||
func (sw *SmartWindow) Draw() {
|
|
||||||
if ! sw.Initialized() {return}
|
|
||||||
if sw.Ready() {return}
|
|
||||||
|
|
||||||
log.Log(WARN, "Draw() window ready =", sw.ready)
|
|
||||||
sw.window.Draw()
|
|
||||||
if (sw.populate != nil) {
|
|
||||||
log.Log(WARN, "Make() trying to run Custom sw.populate() here")
|
|
||||||
sw.populate(sw)
|
|
||||||
}
|
|
||||||
sw.ready = true
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
func (sw *SmartWindow) Vertical() {
|
|
||||||
if ! sw.Initialized() {return}
|
|
||||||
if sw.Ready() {return}
|
|
||||||
|
|
||||||
log.Log(WARN, "Draw() window ready =", sw.ready)
|
|
||||||
sw.window.Draw()
|
|
||||||
if (sw.populate != nil) {
|
|
||||||
log.Log(WARN, "Make() trying to run Custom sw.populate() here")
|
|
||||||
sw.populate(sw)
|
|
||||||
}
|
|
||||||
sw.ready = true
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
package smartwindow
|
|
||||||
|
|
||||||
import (
|
|
||||||
"go.wit.com/gui/gui"
|
|
||||||
"go.wit.com/gui/gadgets"
|
|
||||||
)
|
|
||||||
|
|
||||||
type SmartWindow struct {
|
|
||||||
ready bool // track if the window is ready
|
|
||||||
hidden bool // track if the window is hidden from the toolkits
|
|
||||||
changed bool // track if something changed in the window
|
|
||||||
|
|
||||||
title string // what the user sees as the name
|
|
||||||
name string // the programatic name aka: "CALANDAR"
|
|
||||||
|
|
||||||
parent *gui.Node // where to place the window if you try to draw it
|
|
||||||
window *gadgets.BasicWindow // the underlying BasicWindow
|
|
||||||
box *gui.Node // the box inside the window // get this from BasicWindow() ?
|
|
||||||
|
|
||||||
populate func(*SmartWindow) // the function to generate the widgets
|
|
||||||
}
|
|
36
structs.go
36
structs.go
|
@ -6,9 +6,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
"go.wit.com/gui/gui"
|
"go.wit.com/gui/gui"
|
||||||
"go.wit.com/gui/gadgets"
|
"go.wit.com/gui/gadgets"
|
||||||
// "go.wit.com/gui/cloudflare"
|
|
||||||
"go.wit.com/control-panels/dns/linuxstatus"
|
"go.wit.com/control-panels/dns/linuxstatus"
|
||||||
"go.wit.com/control-panels/dns/smartwindow"
|
|
||||||
|
|
||||||
"github.com/miekg/dns"
|
"github.com/miekg/dns"
|
||||||
)
|
)
|
||||||
|
@ -17,14 +15,8 @@ import (
|
||||||
var me Host
|
var me Host
|
||||||
|
|
||||||
type Host struct {
|
type Host struct {
|
||||||
myGui *gui.Node // the 'gui' binary tree root node
|
status *hostnameStatus // keeps track of the hostname and it's status
|
||||||
|
|
||||||
window *gadgets.BasicWindow // the main window
|
|
||||||
debug *gadgets.BasicWindow // the debug window
|
|
||||||
|
|
||||||
statusDNS *hostnameStatus // keeps track of the hostname and it's status
|
|
||||||
statusOS *linuxstatus.LinuxStatus // what the Linux OS sees
|
statusOS *linuxstatus.LinuxStatus // what the Linux OS sees
|
||||||
digStatus *digStatus // window of the results of DNS lookups
|
|
||||||
|
|
||||||
hostnameStatus *gui.Node // a summary for the user of where things are
|
hostnameStatus *gui.Node // a summary for the user of where things are
|
||||||
hostname *gadgets.OneLiner // the hostname grabbed from gadget.linuxStatus
|
hostname *gadgets.OneLiner // the hostname grabbed from gadget.linuxStatus
|
||||||
|
@ -38,6 +30,7 @@ type Host struct {
|
||||||
localSleep time.Duration
|
localSleep time.Duration
|
||||||
|
|
||||||
changed bool // set to true if things changed
|
changed bool // set to true if things changed
|
||||||
|
user string // name of the user
|
||||||
|
|
||||||
ipmap map[string]*IPtype // the current ip addresses
|
ipmap map[string]*IPtype // the current ip addresses
|
||||||
dnsmap map[string]*IPtype // the current dns addresses
|
dnsmap map[string]*IPtype // the current dns addresses
|
||||||
|
@ -48,6 +41,17 @@ type Host struct {
|
||||||
ipv4s map[string]dns.RR
|
ipv4s map[string]dns.RR
|
||||||
ipv6s map[string]dns.RR
|
ipv6s map[string]dns.RR
|
||||||
|
|
||||||
|
window *gadgets.BasicWindow // the main window
|
||||||
|
debug *gadgets.BasicWindow // more attempts to debug the DNS state
|
||||||
|
|
||||||
|
tab *gui.Node // the main dns tab
|
||||||
|
notes *gui.Node // using this to put notes here
|
||||||
|
|
||||||
|
// local OS settings, network interfaces, etc
|
||||||
|
// fqdn *gui.Node // display the full hostname
|
||||||
|
// Interfaces *gui.Node // Interfaces
|
||||||
|
// LocalSpeedActual *gui.Node // the time it takes to check each network interface
|
||||||
|
|
||||||
// DNS stuff
|
// DNS stuff
|
||||||
DnsAPI *gui.Node // what DNS API to use?
|
DnsAPI *gui.Node // what DNS API to use?
|
||||||
DnsAAAA *gadgets.OneLiner // the actual DNS AAAA results
|
DnsAAAA *gadgets.OneLiner // the actual DNS AAAA results
|
||||||
|
@ -57,12 +61,18 @@ type Host struct {
|
||||||
DnsSpeedActual *gui.Node // the last actual duration
|
DnsSpeedActual *gui.Node // the last actual duration
|
||||||
DnsSpeedLast string // the last state 'FAST', 'OK', etc
|
DnsSpeedLast string // the last state 'FAST', 'OK', etc
|
||||||
|
|
||||||
|
// fix *gui.Node // button for the user to click
|
||||||
|
// fixProc *gui.Node // button for the user to click
|
||||||
|
|
||||||
|
// mainStatus *gui.Node // group for the main display of stuff
|
||||||
|
// cloudflareB *gui.Node // cloudflare button
|
||||||
|
|
||||||
|
digStatus *digStatus
|
||||||
statusIPv6 *gadgets.OneLiner
|
statusIPv6 *gadgets.OneLiner
|
||||||
digStatusButton *gui.Node
|
digStatusButton *gui.Node
|
||||||
statusDNSbutton *gui.Node
|
|
||||||
witcom *gadgets.BasicWindow
|
myDebug *gui.Node
|
||||||
fixButton *gui.Node
|
myGui *gui.Node
|
||||||
fixWindow *smartwindow.SmartWindow
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type IPtype struct {
|
type IPtype struct {
|
||||||
|
|
Loading…
Reference in New Issue