mirror of
https://github.com/tailscale/tailscale.git
synced 2025-07-30 07:43:42 +00:00

This adds a new package, net/currenttime, which is a thin wrapper around time.Now. If the value returned by time.Now is before a hard-coded value baked into the binary, that hard-coded value will be returned instead. In the case where the system has a buggy, malfunctioning, or nonexistent RTC, this can improve the likelihood that Tailscale will be able to establish a connection to the control plane (via TLS) and fetch the server certificate. As a future TODO: we should cache this value on-disk between process starts (possibly in the state file?) so that we succeed even if the Tailscale server certificate has already expired from the perspective of the minimum time. Additionally, add a GitHub workflow that bumps the current time to a new value every 14 days, so that the value stays reasonably up-to-date in our repository without introducing impurities into the build process. Signed-off-by: Andrew Dunham <andrew@du.nham.ca> Change-Id: If63cf28c4f188993894d3de589fd65ad447def6f