From 0a5b6bbe70132dd2963567f32fb7f0a5155ce5da Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Mon, 24 May 2021 17:30:29 +0200 Subject: [PATCH] add more comments --- packages/health-check/Dockerfile | 9 +++++++++ packages/health-check/src/checks/critical.js | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/health-check/Dockerfile b/packages/health-check/Dockerfile index 214200e3..d4cbe9df 100644 --- a/packages/health-check/Dockerfile +++ b/packages/health-check/Dockerfile @@ -2,7 +2,10 @@ FROM node:16.1.0-alpine WORKDIR /usr/app +# schedule critical checks to run every 5 minutes (any failures will disable server) RUN echo '*/5 * * * * /usr/app/cli/run critical > /dev/stdout' >> /etc/crontabs/root + +# schedule extended checks to run on every hour (optional checks, report only) RUN echo '0 * * * * /usr/app/cli/run extended > /dev/stdout' >> /etc/crontabs/root COPY package.json . @@ -12,4 +15,10 @@ COPY cli cli EXPOSE 3100 ENV NODE_ENV production + +# command consists of 3 parts: +# 1. starting crond +# 2. aliasing siasky.net and account.siasky.net with current server ip so health checks +# test portal end-to-end on prod domain (important for testing ssl certificates) +# 3. running api service CMD [ "sh", "-c", "crond ; echo $(node src/whatismyip.js) siasky.net account.siasky.net >> /etc/hosts ; node --max-http-header-size=64000 src/index.js" ] diff --git a/packages/health-check/src/checks/critical.js b/packages/health-check/src/checks/critical.js index 6a13a20b..9b71ab03 100644 --- a/packages/health-check/src/checks/critical.js +++ b/packages/health-check/src/checks/critical.js @@ -57,7 +57,7 @@ async function handshakeSubdomainCheck(done) { return genericAccessCheck("hns_via_subdomain", url, done); } -// handshakeSubdomainCheck returns the result of accessing account dashboard website +// accountWebsiteCheck returns the result of accessing account dashboard website async function accountWebsiteCheck(done) { const url = `${process.env.SKYNET_DASHBOARD_URL}/auth/login`;