tailscale / golink

A private shortlink service for tailnets
BSD 3-Clause "New" or "Revised" License
1.22k stars 78 forks source link

Can the Docker container have a HEALTHCHECK? #50

Open avidrissman opened 1 year ago

avidrissman commented 1 year ago

The golink binary uses tsnet internally to connect to the tailnet. Is there a way to hook up a HEALTHCHECK to return the status of the golink binary’s internal tsnet connection? That sounds tricky now that I write it, but it would be pretty cool if the Docker health status could reflect the tailnet connection status.

willnorris commented 1 year ago

we could certainly add a health check endpoint, but does it make sense to have it report on the tsnet connection? By default, golink only listens on the tsnet connection, so the fact that you could even reach the healthcheck endpoint at all indicates that it's working. Or were you thinking the healthcheck would listen on a different interface?

avidrissman commented 1 year ago

I’m not referring to a “health check” as a general concept, but HEALTHCHECK the Docker feature; see https://scoutapm.com/blog/how-to-use-docker-healthcheck. This wouldn’t be going through the tsnet connection; this would be a feature of the Docker container.