Skip to content

Add HTTP health check without using API Token #8430

Closed

Description

@richie-tt

/kind feature

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

Activity

  1. added
    enhancement
    needs-triage
    on Jul 13, 2022
  2. AudriusButkevicius commented on Jul 13, 2022

    @AudriusButkevicius
    Member

    What does correctly mean here? If its responding, even with a 401, its working, if its not responding, it's not working.

  3. calmh commented on Jul 13, 2022

    @calmh
    Member

    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"}

  4. removed
    needs-triage
    on Oct 6, 2022
  5. changed the title [-]HTTP health check without using API Token[/-] [+]Add /rest/status HTTP health check without using API Token[/+] on Oct 6, 2022
  6. added a commit that references this issue on Oct 6, 2022
  7. changed the title [-]Add /rest/status HTTP health check without using API Token[/-] [+]Add HTTP health check without using API Token[/+] on Oct 6, 2022
  8. added this to the v1.22.1 milestone on Oct 17, 2022
  9. mobiuscreek commented on Nov 2, 2022

    @mobiuscreek

    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.

  10. richie-tt commented on Nov 3, 2022

    @richie-tt
    Author

    I would like to thank you very much for implementing this feature !!!!

  11. added
    frozen-due-to-age
    on Oct 12, 2023
  12. locked and limited conversation to collaborators on Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementfrozen-due-to-age

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions