Top
Best
New

Posted by rvermeulen98 10 hours ago

Show HN: Whosthere: A LAN discovery tool with a modern TUI, written in Go(github.com)
169 points | 61 commentspage 2
kapitanjakc 7 hours ago|
Good stuff, this saves me the trouble of going through router GUI. And remembering if it was 192.168.1.1 or 0.1 or what were the admin/root passwords.
Havoc 6 hours ago||
Busy building something similar with a view towards customising it for my LAN.

Specifically it needs to pull additional detail out of proxmox servers and opnsense plus deduce where things are physically based on latency.

Thats a whole lot easier if it doesn’t need to work universally & you can hardcode some assumptions

girishso 7 hours ago||
Great tool, only thing I miss is it doesn't show SAMBA names.
petcat 8 hours ago||
I love the resurgence of TUI apps, but I wonder what the definition of "modern TUI" means in these cases. Does it basically mean just not using curses?
Daviey 8 hours ago|
It means it has a dependency on X11.

  $ go install github.com/ramonvermeulen/whosthere@latest
  # golang.design/x/clipboard
  clipboard_linux.c:14:10: fatal error: X11/Xlib.h: No such file or directory
    14 | #include <X11/Xlib.h>
       |          ^~~~~~~~~~~~
  compilation terminated.
petcat 7 hours ago|||
Yikes, so it's a "TUI" app... that still requires a display server? So I can't run this TUI over SSH or a virtual terminal. Wondering what the point of a tui is that still requires a gui environment to run?
Daviey 7 hours ago||
Sorry, I was unhelpfully flippant. You totally can, and I don't want to distract from the great app that has been shared. This bug was just a compile time issue, which needed X libs to bake in clipboard support which is optional at runtime.
sigmonsays 5 hours ago||||
this stopped me from go installing it too on nixos. I'm not gonna put the effort in to run it.

There should be a build tag to disable clipboard, that'd be the easiest way around this.

Daviey 3 hours ago||
Same, I also had the same issue on NixOS :)
fellerts 8 hours ago|||
That has nothing to do with the UI framework. The X11 dependency comes as part of the clipboard integration (which I'd argue should be optional or even removed). Still, I wouldn't call it modern if Wayland is outright not supported.
rvermeulen98 7 hours ago|||
I think this is only a problem when building from source, right? It is indeed because of the dependency on https://github.com/golang-design/clipboard.

I hesitated a bit bringing in this feature. On one hand, I really like to have clipboard support, on the other hand, I don't like that it requires you to change from static to dynamic linking (and have the x11 dependency).

Maybe I could write an install.sh script for installation that detects the OS and fetches the correct version/tarball from the Github release.

Daviey 7 hours ago||
That library isn't going to support Wayland any time soon, and requiring CGO isn't ideal IMO. See this bug, https://github.com/golang-design/clipboard/issues/6

How about this PR? https://github.com/ramonvermeulen/whosthere/pull/29

It switches to using github.com/dece2183/go-clipboard, which supports Mac, Windows, Linux (X11 + Wayland) and Android.

rvermeulen98 6 hours ago||
Thanks a lot for your contribution, this is something I will look into in the upcoming days. I totally agree that CGO isn't ideal, I had to make the build/release process also a lot more complicated purely for that clipboard requirement (see GHAs and the different goreleaser files).

On the other hand, I also don't want whosthere to be depended on a fork that isn't maintained anymore. I will think about this trade-off, but I am also interested how others look at this problem.

ok123456 7 hours ago|||
What's modern about Wayland?
Anonbrit 9 hours ago||
It says 'Open ports: (None)' for all devices on my network, despite there being open ports on many of them (MacOS Tahoe 26.2 / installed via go)
rvermeulen98 8 hours ago|
It doesn't start port scanning by default, maybe this is a feature I can build in the future. When you are on the `detail` view of a device, you can press `p` and that will open a pop-up to perform the port scan. Also the list of ports that will be scanned is a default list of common ports, and can be configured via the configuration yaml.
47282847 3 hours ago||
In that case maybe print something different for unscanned hosts than „Open ports: None“?

Nice tool!

est 6 hours ago||
I hope browsers could support mDNS or SSDP. We need an Intranet browser!
ryancnelson 5 hours ago||
is the only way to export the results "run in daemon mode and curl yourself"?
coolius 9 hours ago|
this is great! i had to tweak the config file on macos because it was using some weird interface (utun4) instead of en0. otherwise awesome tool, i am definitely going to be using this more often.
rvermeulen98 7 hours ago|
Thanks, I am glad you like it! I couldn't find a Go API that just returns the OS "default" network interface, so struggled a bit with a correct implementation for that part.

When reading some blog posts, I found often a solution where it sends out an UDP dial to for example 8.8.8.8:53 because you can then get the network interface back from the connection it's local address. As fallback I implemented to pick the first non-loopback interface that is up.

Would be open to suggestions to do this in a better way!

fellerts 7 hours ago||
I think this package does exactly what you need: https://pkg.go.dev/github.com/google/gopacket/routing. Works on my machine (error handling left to the reader)

    router, _ := routing.New()
    iface, _, _, _ := router.Route(net.ParseIP("8.8.8.8"))
    fmt.Println(iface.Name)
this prints my Ethernet interface as expected. It doesn't make any requests, it just figures out where to route a packet. I guess it interfaces with the OS routing table.
rvermeulen98 7 hours ago||
Thanks for sharing! This is definitely something I will look into, I am all in favor to simplify the current implementation of finding the "default" OS network interface.
contingencies 4 hours ago||
You'd better use the default route and not some random IP, particularly DNS IPs which people often meddle with.

  # IPv4 default route only
  uname
  Darwin$ route -n get 0.0.0.0 | grep interface | cut -d ':' -f2
  Linux$ route -nv  |grep ^0.0.0.0 | awk '{print $NF}'
More comments...