headplane icon indicating copy to clipboard operation
headplane copied to clipboard

[FR] Client Version

Open mitchellkellett opened this issue 1 year ago • 1 comments

It would be great to see the client version and host OS details in the UI.

I know this might be a bit tricky as I couldn't see a way in the API to get this info, though it's stored in the DB (nodes.host_info).

Perhaps since it's already reading Headscale's config.yaml file, it could then query the DB to get this info whether it's sqlite or postgres.

+------------+------------+-----------------+-----------------------+
| Machine    | Addresses  | Version         | Last Seen             |
+------------+------------+-----------------+-----------------------+
| my-home-pc | 100.64.0.1 | 1.70.0          | Connected             |
|            |            | Windows 11 23H2 |                       |
+------------+------------+-----------------+-----------------------+
| my-work-pc | 100.64.0.2 | 1.70.0          | Jul 27, 10:14 AM AEST |
|            |            | Windows 11 23H2 |                       |
+------------+------------+-----------------+-----------------------+

mitchellkellett avatar Aug 14 '24 02:08 mitchellkellett

I don't want to query the database for safety reasons, however there is this PR that isn't merged in Headscale that would make this possible. https://github.com/juanfont/headscale/pull/1938

tale avatar Aug 15 '24 19:08 tale

It looks like that PR got closed. Perhaps another way forward is to have a TS client built in that can then use the local API to get this info. This potentially would also help with #32.

mitchellkellett avatar Dec 04 '24 08:12 mitchellkellett

Probably, or I could just fold and read the database file (if it's sqlite).

tale avatar Dec 05 '24 00:12 tale

I think the built in client might be a better option, but it's likely more work.

It looks like you can get more data via the local api than what's stored in the DB which might be more advantageous in the long run. And it means that's Postgres users will be able to get the same experience.

mitchellkellett avatar Dec 05 '24 02:12 mitchellkellett

What exactly do you mean by local client, I'm a little confused on that part?

tale avatar Dec 05 '24 07:12 tale

I couldn’t find any official documentation on this, but I came across a mention of it in a blog post. I’ve successfully managed to get it working through the CLI while debugging within my own Tailnet. The command I use for testing it externally to the Tailscale process is: tailscale debug local-creds.

The new Tailscale “localapi” lets local apps query the local tailscale instance over HTTP. For example, it can get a list of peer devices that might be Taildrop targets, or which services are running on those peers. (Source)

mitchellkellett avatar Dec 05 '24 08:12 mitchellkellett

Ah, so it needs to run on a device that's been added into the Tailnet? This is definitely something I'd want to do then if it makes it easier for us to add more functionality like this.

Edit: It only appears to give the OS and not the installed version on devices (I don't think).

tale avatar Dec 05 '24 16:12 tale

Rather than having to run tailscale on the machine that headplane is on. You could embed a tailscale client in it, a working example of this would be tailscale/golink.

I'm 99% sure it provides the version, I'll have a look and see what endpoint it was I saw it in when I can later today. I think it's status or whois off the top of my head.

mitchellkellett avatar Dec 05 '24 22:12 mitchellkellett

It shows version for itself, but not for other devices, meaning it would need to be installed on all devices?

tale avatar Dec 06 '24 02:12 tale

CleanShot 2024-12-05 at 21 45 39

Never mind, looks like whois?addr=<address> gets this information.

tale avatar Dec 06 '24 02:12 tale

Going to close this in favor of #65, it's still happening though.

tale avatar Jan 18 '25 08:01 tale