diff --git a/Makefile b/Makefile index 2c91975..d8e6913 100644 --- a/Makefile +++ b/Makefile @@ -34,3 +34,26 @@ deb: netlink: GO111MODULE="off" go get -v -u github.com/vishvananda/netlink + + +####### MODULE STUFF DOWN HERE +# +# What again is the 'right' way to do this? +# It seems like it changes from year to year. This is better than 'vendor/' (that was a terrible hack) +# maybe it's settled down finally. Use GO111MODULE="off" when you are developing. (?) +# When you are ready to release, version this and all the packages correctly. (?) +# +# At least, that is what I'm going to try to do as of Feb 18 2023. +# + + +build-with-custom-go.mod: + go build -modfile=local.go.mod ./... + +# module +# go 1.18 +# require ( +# github.com/versent/saml2aws/v2 v2.35.0 +# ) +# 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/ diff --git a/debian/control b/debian/control index 1c23c16..1a46081 100644 --- a/debian/control +++ b/debian/control @@ -4,6 +4,6 @@ Package: control-panel-dns Maintainer: Jeff Carr Architecture: amd64 Depends: -Recommends: libgtk-3-0 +Recommends: libgtk-3-0, ddclient, ddupdate Description: a control panel for DNS and IPv6 settings Goals: show the settings, validate & update DNS diff --git a/gui.go b/gui.go index 46ccb2d..51cdca1 100644 --- a/gui.go +++ b/gui.go @@ -33,14 +33,12 @@ func initGUI() { func addDNSTab(window *gui.Node, title string) { var newNode, g, g2, tb *gui.Node - var err error - var name string newNode = window.NewTab(title) log("addDemoTab() newNode.Dump") newNode.Dump() - g = newNode.NewGroup("group 1") + g = newNode.NewGroup("junk") dd := g.NewDropdown("demoCombo2") dd.AddDropdownName("more 1") dd.AddDropdownName("more 2") @@ -51,21 +49,18 @@ func addDNSTab(window *gui.Node, title string) { log("text =", s) } g.NewLabel("UID =") + g.NewButton("hello", func () { + log("world") + }) - g2 = newNode.NewGroup("group 2") + g2 = newNode.NewGroup("Real Stuff") tb = g2.NewTextbox("tb") log("tb =", tb.GetText()) tb.OnChanged = func(*gui.Node) { s := tb.GetText() log("text =", s) } - g2.NewButton("hello", func () { - log("world") - }) - g2.NewButton("scanInterfaces()", func () { - scanInterfaces() - }) g2.NewButton("dump Host.ifmap", func () { for i, t := range me.ifmap { log("int =", i, "name =", t.name, t.iface) @@ -74,15 +69,17 @@ func addDNSTab(window *gui.Node, title string) { g2.NewButton("checkDNS()", func () { me.checkDNS() }) - g2.NewButton("os.Hostname()", func () { - name, err = os.Hostname() - log("name =", name, err) + g2.NewButton("getHostname()", func () { + getHostname() }) g2.NewButton("os.User()", func () { user, _ := user.Current() spew.Dump(user) log("os.Getuid =", os.Getuid()) }) + g2.NewButton("Example_listLink()", func () { + Example_listLink() + }) g2.NewButton("Escalate()", func () { Escalate() }) diff --git a/hostname.go b/hostname.go new file mode 100644 index 0000000..4725d2c --- /dev/null +++ b/hostname.go @@ -0,0 +1,45 @@ +// inspired from: +// https://github.com/mactsouk/opensource.com.git +// and +// https://coderwall.com/p/wohavg/creating-a-simple-tcp-server-in-go + +package main + +// import "net" + +// 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" + +// dnssec IPv6 socket library +import "git.wit.org/jcarr/dnssecsocket" + +func getHostname() { + var err error + me.fqdn, err = fqdn.FqdnHostname() + if (err != nil) { + log("FQDN hostname error =", err) + exit() + return + } + log("FQDN hostname is", me.fqdn) + + var aaaa []string + aaaa = getAAAA(me.fqdn) + log("AAAA =", aaaa) +} + +func getAAAA(s string) []string { + // lookup the IP address from DNS + dnsRR := dnssecsocket.Dnstrace(s, "AAAA") + log(args.VerboseDNS, SPEW, dnsRR) + if (dnsRR == nil) { + return nil + } + ipaddr1 := dns.Field(dnsRR, 1) + ipaddr2 := dns.Field(dnsRR, 2) + log("ipaddr", ipaddr1, ipaddr2) + return []string{ipaddr1, ipaddr2} +} diff --git a/unix.go b/unix.go index 82dc1d4..a8eb28b 100644 --- a/unix.go +++ b/unix.go @@ -51,3 +51,16 @@ func dumpIPs(host string) { log(host, ip) } } + +/* + check if ddclient is installed, working, and/or configured + https://github.com/ddclient/ddclient +*/ +func ddclient() { +} + +/* + check if ddupdate is installed, working, and/or configured +*/ +func ddupdate() { +}