The best workaround that we've found is to use the date in a HTTP Header to set the initial time (if we detect this condition):
$ curl -sI http://api.screenlyapp.com | grep Date
Date: Fri, 30 Dec 2022 08:43:56 GMT
With this set, you should be able to trigger the initial NTP service to start and set the date.
There's a Rust library here that can parse these dates for you: https://docs.rs/httpdate/0.3.2/httpdate/
So then you could just query one of the ntp servers using dns instead?
$ curl -sI http://1.1.1.1 | grep Date
$ curl -I http://api.screenlyapp.com
HTTP/1.1 301 Moved Permanently
Date: Fri, 30 Dec 2022 09:01:44 GMT [...]
Your API should not even be listening on port 80, period.
The best workaround that we've found is to use the date in a HTTP Header to set the initial time (if we detect this condition):
$ curl -sI http://api.screenlyapp.com | grep Date
Date: Fri, 30 Dec 2022 08:43:56 GMT
With this set, you should be able to trigger the initial NTP service to start and set the date.
There's a Rust library here that can parse these dates for you: https://docs.rs/httpdate/0.3.2/httpdate/