You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add HTTP health check without using API Token #8430
enhancementNew features or improvements of some kind, as opposed to a problem (bug)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussion
Description
Each Router or API gateway (for example Traefik) can verify if the destination service is working correctly, usually connecting on a specific path /status and only receiving an empty HTML body with HTTP code 200 OK or 500 ERROR. Such a check gives two crucial information to the gateway:
service is working correctly and it's ready for incoming traffic
service is operated from a network point of view (network and firewall are configured correctly)
I would like to have the possibility to check the status of syncthing by HTTP request.
I know I could try to query /rest/system/ping but the problem is that the REST requires to use of API Token for authorization. I don't want to put full RW API Token just to check PING and some API gateways are not able to send extra headers just for heatlcheck.
I am open to any suggestion on how I could achieve an HTTP health check without API Token
Or it could mean there's a broken proxy or something in between... I can see that it would be nice with something answering with a 200 OK and a small JSON response indicating things are fine.
Well done. Very good and necessary fix. For anyone coming here in the future, when deploying syncthing in a Nomad cluster with Consul, there is a requirement for having such an endpoint in order to check the health of a service. With syncthing the response to Consul was always "Not Authorized", because this wasn't available in previous releases. Consul thought the service was "unhealthy" and Nomad would shut it down. Thanks to this fix, Consul doesn't complain and everything works fine. Thanks again for the good work.
enhancementNew features or improvements of some kind, as opposed to a problem (bug)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussion
Activity
AudriusButkevicius commentedon Jul 13, 2022
What does correctly mean here? If its responding, even with a 401, its working, if its not responding, it's not working.
calmh commentedon Jul 13, 2022
Or it could mean there's a broken proxy or something in between... I can see that it would be nice with something answering with a 200 OK and a small JSON response indicating things are fine.
{"status": "OK"}[-]HTTP health check without using API Token[/-][+]Add /rest/status HTTP health check without using API Token[/+]lib/api: Add Status-page (syncthing#8430)
[-]Add /rest/status HTTP health check without using API Token[/-][+]Add HTTP health check without using API Token[/+]mobiuscreek commentedon Nov 2, 2022
Well done. Very good and necessary fix. For anyone coming here in the future, when deploying
syncthingin a Nomad cluster with Consul, there is a requirement for having such an endpoint in order to check the health of a service. Withsyncthingthe response to Consul was always "Not Authorized", because this wasn't available in previous releases. Consul thought the service was "unhealthy" and Nomad would shut it down. Thanks to this fix, Consul doesn't complain and everything works fine. Thanks again for the good work.richie-tt commentedon Nov 3, 2022
I would like to thank you very much for implementing this feature !!!!