Expose more machine info via api #424

Closed
opened 2025-12-29 01:28:59 +01:00 by adam · 3 comments
Owner

Originally created by @TymanWasTaken on GitHub (Feb 6, 2023).

Feature request

Currently, the headscale http api allows for programs to list and get info on machines connected to the headscale network, such as IP, name, last seen date, and routes. However, it is still missing a lot of information that would be nice to have exposed, such as tailscale SSH support, tailscale client version, or network info (such as DERP latency and connection info such as hairpinning or UPnP/PCP/PMP support).

This information would be beneficial to be exposed in order to both allow for better display of devices from for example a web browser or another API client. My specific use case was that I recently setup home assistant, and noticed that the builtin tailscale integration did not support headscale. I would like to make a headscale integration, however many of the features of the builtin tailscale integration are not possible due to the lack of exposed information in the headscale API.

Additionally, this information would likely be easily exposed, as a quick inspection of the headscale database shows that this information is already stored in the host_info column of the machines table. For example, ssh support can be detected from the sshHostKeys field, and all of the network info such as UPnP and DERP info is seen in the NetInfo field.

Originally created by @TymanWasTaken on GitHub (Feb 6, 2023). <!-- Headscale is a multinational community across the globe. Our common language is English. Please consider raising the feature request in this language. --> **Feature request** <!-- A clear and precise description of what new or changed feature you want. --> Currently, the headscale http api allows for programs to list and get info on machines connected to the headscale network, such as IP, name, last seen date, and routes. However, it is still missing a lot of information that would be nice to have exposed, such as tailscale SSH support, tailscale client version, or network info (such as DERP latency and connection info such as hairpinning or UPnP/PCP/PMP support). <!-- Please include the reason, why you would need the feature. E.g. what problem does it solve? Or which workflow is currently frustrating and will be improved by this? --> This information would be beneficial to be exposed in order to both allow for better display of devices from for example a web browser or another API client. My specific use case was that I recently setup [home assistant](https://home-assistant.io), and noticed that the builtin tailscale integration did not support headscale. I would like to make a headscale integration, however many of the features of the builtin tailscale integration are not possible due to the lack of exposed information in the headscale API. Additionally, this information would likely be easily exposed, as a quick inspection of the headscale database shows that this information is already stored in the `host_info` column of the `machines` table. For example, ssh support can be detected from the `sshHostKeys` field, and all of the network info such as UPnP and DERP info is seen in the `NetInfo` field.
adam added the enhancementstale labels 2025-12-29 01:28:59 +01:00
adam closed this issue 2025-12-29 01:28:59 +01:00
Author
Owner

@juanfont commented on GitHub (May 10, 2023):

Hi @TymanWasTaken, @joshuataylor

There has been a PR on this by @joshuataylor https://github.com/juanfont/headscale/pull/942.

After discussing it with @kradalby, we reckon it would be safer/saner for Headscale if you just marshal the Machine.HostInfo as a string into gRPC, rather than transforming it into a proto object in Headscale. This way, if something changes (and it might from Tailscale side) Headscale would not be affected.

@juanfont commented on GitHub (May 10, 2023): Hi @TymanWasTaken, @joshuataylor There has been a PR on this by @joshuataylor https://github.com/juanfont/headscale/pull/942. After discussing it with @kradalby, we reckon it would be safer/saner for Headscale if you just marshal the Machine.HostInfo as a string into gRPC, rather than transforming it into a proto object in Headscale. This way, if something changes (and it might from Tailscale side) Headscale would not be affected.
Author
Owner

@github-actions[bot] commented on GitHub (Nov 7, 2023):

This issue is stale because it has been open for 180 days with no activity.

@github-actions[bot] commented on GitHub (Nov 7, 2023): This issue is stale because it has been open for 180 days with no activity.
Author
Owner

@github-actions[bot] commented on GitHub (Nov 21, 2023):

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions[bot] commented on GitHub (Nov 21, 2023): This issue was closed because it has been inactive for 14 days since being marked as stale.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#424