Echo Status

https://echo.reily.app

Run a Javascript online automatically with slack alerts.

What is it useful for?

  • Monitor you online services' status
  • Alert you 30 days before your https cert expires
  • Check doge price and let you know when it drops / raises
  • Ping your home router every minute to know when it's down

But, it's way more flexible than anything you can found online, because are writing JavaScript.

image

For example,

  • You can alert TLS cert expiration at [30,20,15,10,7,5,4,3,2,1].include(dayRemaining)
  • You can retry your fetch request n time, to loosen or tighten the check
  • You can customize fetch method, payload, acceptable status codes, you can do anything with payload. You can also do two requests where the second one is based on the response of the first one.
  • ...and much more.

You can also invite your teammate to join a projects (with their GitHub email address)

Documentations

The JavaScript is run on node14 similar env, so you get to use a lot of new features that comes with it. But we do limit access to certain degrees for security reasons.

The JavaScript is run on a VM2 Sandbox with following exposed globals.

fetch directly from node-fetch

sslChecker from ssl-checker

tcpPingPort from tcp-ping-port

And JS built-in like URL

We also overwrite console.log to be able to output stuff to the execution log.

If you need access to more NPM packages, please reach out to echo@reily.app

Examples

Try the request 5 times

const retry = (action, limit) => async (input) => {
  try {    
    await action(input)
  } catch(e) {
    if (limit ===0) throw e
    console.log('failed with retry: ' + limit)
    await new Promise(r => setTimeout(r, 1000))
    await retry(action, limit-1)(input)
  }
}
const request = async (urlString) => {
    const response = await fetch(urlString);
    if (!response.ok) {
      throw new Error(response.statusText)
    }
}
retry(request, 5)