Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Status check endpoint to prove the server is running #81

Open
mhulet opened this issue Oct 10, 2019 · 1 comment
Open

Status check endpoint to prove the server is running #81

mhulet opened this issue Oct 10, 2019 · 1 comment

Comments

@mhulet
Copy link
Member

mhulet commented Oct 10, 2019

The Rebels Manager should respond with 200 OK to a GET call from ping.extinctionrebellion.be. DNS records for this subdomain will be added on both Heroku and Cloudflare (no proxy).

If the dynos are down, this shouldn't respond.

Then we can point a tool like Uptime Robot at the https://ping.extinctionrebellion.be route, and notify anyone who can take care of this issue.

@mhulet
Copy link
Member Author

mhulet commented Oct 10, 2019

We can do this in a middleware.

  ...
    return status_check(request) if bot?(request)
  ...

  private

  def bot?(request)
    request.url =~ /\/\/bot\./
  end

  def status_check(request)
    [200, {"Content-Type" => request.content_type || "text/html"}, ["OK"]]
  end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant