From 49774d2f04f641bf8d16771846499ee570472f4b Mon Sep 17 00:00:00 2001 From: Ivaylo Novakov Date: Mon, 13 Sep 2021 09:33:22 +0200 Subject: [PATCH 1/9] Bump the go version used by accounts's container to 1.16.7 --- docker/accounts/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/accounts/Dockerfile b/docker/accounts/Dockerfile index b5689f5a..f1670bf4 100644 --- a/docker/accounts/Dockerfile +++ b/docker/accounts/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.15 +FROM golang:1.16.7 LABEL maintainer="NebulousLabs " ENV GOOS linux From 7612043fca881710b9fc29b9112644d9849af10f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Sep 2021 12:11:13 +0000 Subject: [PATCH 2/9] Bump swr from 1.0.0 to 1.0.1 in /packages/dashboard Bumps [swr](https://github.com/vercel/swr) from 1.0.0 to 1.0.1. - [Release notes](https://github.com/vercel/swr/releases) - [Commits](https://github.com/vercel/swr/compare/1.0.0...1.0.1) --- updated-dependencies: - dependency-name: swr dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/dashboard/package.json | 2 +- packages/dashboard/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/dashboard/package.json b/packages/dashboard/package.json index a3caa921..7f4b5053 100644 --- a/packages/dashboard/package.json +++ b/packages/dashboard/package.json @@ -31,7 +31,7 @@ "skynet-js": "3.0.2", "stripe": "8.174.0", "superagent": "6.1.0", - "swr": "1.0.0", + "swr": "1.0.1", "tailwindcss": "2.2.15", "yup": "0.32.9" } diff --git a/packages/dashboard/yarn.lock b/packages/dashboard/yarn.lock index aab93140..f69711a5 100644 --- a/packages/dashboard/yarn.lock +++ b/packages/dashboard/yarn.lock @@ -2934,10 +2934,10 @@ supports-color@^8.0.0: dependencies: has-flag "^4.0.0" -swr@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/swr/-/swr-1.0.0.tgz#d047933714d8bd16ae35af67d81149f4ae700a4d" - integrity sha512-v55Dr+vxIFiUyGxC5W4uN5falxHxYdbpb/R3bO+bSG+svbC9bUWmupy4NM/2pER7X8OvgwJWu0AiSoGy0ND9ew== +swr@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/swr/-/swr-1.0.1.tgz#15f62846b87ee000e52fa07812bb65eb62d79483" + integrity sha512-EPQAxSjoD4IaM49rpRHK0q+/NzcwoT8c0/Ylu/u3/6mFj/CWnQVjNJ0MV2Iuw/U+EJSd2TX5czdAwKPYZIG0YA== dependencies: dequal "2.0.2" From e6a591e5c0a4c1772177b5813f853f345caf9a11 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Sep 2021 12:11:16 +0000 Subject: [PATCH 3/9] Bump swr from 1.0.0 to 1.0.1 in /packages/website Bumps [swr](https://github.com/vercel/swr) from 1.0.0 to 1.0.1. - [Release notes](https://github.com/vercel/swr/releases) - [Commits](https://github.com/vercel/swr/compare/1.0.0...1.0.1) --- updated-dependencies: - dependency-name: swr dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/website/package.json | 2 +- packages/website/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/website/package.json b/packages/website/package.json index cefb0938..8722407c 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -61,7 +61,7 @@ "react-use": "^17.3.1", "skynet-js": "^4.0.11-beta", "stream-browserify": "^3.0.0", - "swr": "^1.0.0", + "swr": "^1.0.1", "tailwindcss": "^2.2.15" }, "devDependencies": { diff --git a/packages/website/yarn.lock b/packages/website/yarn.lock index 6f140038..a2b14e3f 100644 --- a/packages/website/yarn.lock +++ b/packages/website/yarn.lock @@ -12924,10 +12924,10 @@ svgo@^2.3.0: csso "^4.2.0" stable "^0.1.8" -swr@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/swr/-/swr-1.0.0.tgz#d047933714d8bd16ae35af67d81149f4ae700a4d" - integrity sha512-v55Dr+vxIFiUyGxC5W4uN5falxHxYdbpb/R3bO+bSG+svbC9bUWmupy4NM/2pER7X8OvgwJWu0AiSoGy0ND9ew== +swr@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/swr/-/swr-1.0.1.tgz#15f62846b87ee000e52fa07812bb65eb62d79483" + integrity sha512-EPQAxSjoD4IaM49rpRHK0q+/NzcwoT8c0/Ylu/u3/6mFj/CWnQVjNJ0MV2Iuw/U+EJSd2TX5czdAwKPYZIG0YA== dependencies: dequal "2.0.2" From fd70c02d3c24cc70b28278dfc6659acef82f3a16 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Sep 2021 12:11:24 +0000 Subject: [PATCH 4/9] Bump dayjs from 1.10.6 to 1.10.7 in /packages/dashboard Bumps [dayjs](https://github.com/iamkun/dayjs) from 1.10.6 to 1.10.7. - [Release notes](https://github.com/iamkun/dayjs/releases) - [Changelog](https://github.com/iamkun/dayjs/blob/v1.10.7/CHANGELOG.md) - [Commits](https://github.com/iamkun/dayjs/compare/v1.10.6...v1.10.7) --- updated-dependencies: - dependency-name: dayjs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/dashboard/package.json | 2 +- packages/dashboard/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/dashboard/package.json b/packages/dashboard/package.json index a3caa921..e7b00446 100644 --- a/packages/dashboard/package.json +++ b/packages/dashboard/package.json @@ -16,7 +16,7 @@ "autoprefixer": "10.3.4", "classnames": "2.3.1", "clipboardy": "2.3.0", - "dayjs": "1.10.6", + "dayjs": "1.10.7", "express-jwt": "6.1.0", "fast-levenshtein": "3.0.0", "formik": "2.2.9", diff --git a/packages/dashboard/yarn.lock b/packages/dashboard/yarn.lock index aab93140..4df11feb 100644 --- a/packages/dashboard/yarn.lock +++ b/packages/dashboard/yarn.lock @@ -851,10 +851,10 @@ data-uri-to-buffer@3.0.1: resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz#594b8973938c5bc2c33046535785341abc4f3636" integrity sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og== -dayjs@1.10.6: - version "1.10.6" - resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.10.6.tgz#288b2aa82f2d8418a6c9d4df5898c0737ad02a63" - integrity sha512-AztC/IOW4L1Q41A86phW5Thhcrco3xuAA+YX/BLpLWWjRcTj5TOt/QImBLmCKlrF7u7k47arTnOyL6GnbG8Hvw== +dayjs@1.10.7: + version "1.10.7" + resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.10.7.tgz#2cf5f91add28116748440866a0a1d26f3a6ce468" + integrity sha512-P6twpd70BcPK34K26uJ1KT3wlhpuOAPoMwJzpsIWUxHZ7wpmbdZL/hQqBDfz7hGurYSa5PhzdhDHtt319hL3ig== debug@2: version "2.6.9" From ebb34a54a201ba06378531bdb4c1928289e9d608 Mon Sep 17 00:00:00 2001 From: Matthew Sevey Date: Tue, 14 Sep 2021 15:09:29 -0400 Subject: [PATCH 5/9] Delete pull_request_template.md --- .github/pull_request_template.md | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index 27f4c7ec..00000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,23 +0,0 @@ -# PULL REQUEST - -## Overview - -## Example for Visual Changes - - -## Checklist -Review and complete the checklist to ensure that the PR is complete before assigned to an approver. - - [ ] All new methods or updated methods have clear docstrings - - [ ] Testing added or updated for new methods - - [ ] Verify if any changes impact the WebPortal Health Checks - - [ ] Approriate documentation updated - - [ ] Changelog file created - -## Issues Closed - From b768ca99734b4bf832b22a4e0887c853c9039246 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Wed, 15 Sep 2021 12:50:22 +0200 Subject: [PATCH 6/9] fix transitioning to cli command --- packages/health-check/Dockerfile | 7 +++++-- packages/health-check/{ => bin}/cli | 13 ++++++++----- packages/health-check/cli/disable | 3 +++ packages/health-check/cli/enable | 3 +++ packages/health-check/cli/run | 3 +++ setup-scripts/setup-docker-services.sh | 2 +- 6 files changed, 23 insertions(+), 8 deletions(-) rename packages/health-check/{ => bin}/cli (87%) create mode 100755 packages/health-check/cli/disable create mode 100755 packages/health-check/cli/enable create mode 100755 packages/health-check/cli/run diff --git a/packages/health-check/Dockerfile b/packages/health-check/Dockerfile index 9ce4068d..bb4e1a05 100644 --- a/packages/health-check/Dockerfile +++ b/packages/health-check/Dockerfile @@ -4,11 +4,13 @@ RUN apk update && apk add dnsmasq WORKDIR /usr/app +ENV PATH="/usr/app/bin:${PATH}" + # 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 +RUN echo '*/5 * * * * /usr/app/bin/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 +RUN echo '0 * * * * /usr/app/bin/cli run extended > /dev/stdout' >> /etc/crontabs/root COPY package.json yarn.lock ./ @@ -16,6 +18,7 @@ RUN yarn --frozen-lockfile COPY src src COPY cli cli +COPY bin bin EXPOSE 3100 ENV NODE_ENV production diff --git a/packages/health-check/cli b/packages/health-check/bin/cli similarity index 87% rename from packages/health-check/cli rename to packages/health-check/bin/cli index 8e7ee861..176ed23c 100755 --- a/packages/health-check/cli +++ b/packages/health-check/bin/cli @@ -3,12 +3,15 @@ process.env.NODE_ENV = process.env.NODE_ENV || "production"; require("yargs/yargs")(process.argv.slice(2)) + .help() + .demandCommand() + .strict(true) .command( "enable", "Mark portal as enabled", () => {}, () => { - const db = require("./src/db"); + const db = require("../src/db"); db.set("disabled", false).write(); } @@ -18,7 +21,7 @@ require("yargs/yargs")(process.argv.slice(2)) "Mark portal as disabled (provide meaningful reason)", () => {}, ({ reason }) => { - const db = require("./src/db"); + const db = require("../src/db"); db.set("disabled", reason).write(); } @@ -49,9 +52,9 @@ require("yargs/yargs")(process.argv.slice(2)) process.env.STATE_DIR = stateDir; const util = require("util"); - const { getYesterdayISOString } = require("./src/utils"); - const createMiddleware = require("./src/checks/middleware"); - const db = require("./src/db"); + const { getYesterdayISOString } = require("../src/utils"); + const createMiddleware = require("../src/checks/middleware"); + const db = require("../src/db"); const checks = require(`./src/checks/${type}`); const middleware = await createMiddleware(); diff --git a/packages/health-check/cli/disable b/packages/health-check/cli/disable new file mode 100755 index 00000000..ac83f874 --- /dev/null +++ b/packages/health-check/cli/disable @@ -0,0 +1,3 @@ +#!/bin/ash + +cli disable $@ diff --git a/packages/health-check/cli/enable b/packages/health-check/cli/enable new file mode 100755 index 00000000..f1687407 --- /dev/null +++ b/packages/health-check/cli/enable @@ -0,0 +1,3 @@ +#!/bin/ash + +cli enable $@ diff --git a/packages/health-check/cli/run b/packages/health-check/cli/run new file mode 100755 index 00000000..c8fd2ef0 --- /dev/null +++ b/packages/health-check/cli/run @@ -0,0 +1,3 @@ +#!/bin/ash + +cli run $0 diff --git a/setup-scripts/setup-docker-services.sh b/setup-scripts/setup-docker-services.sh index a616509d..679ca135 100755 --- a/setup-scripts/setup-docker-services.sh +++ b/setup-scripts/setup-docker-services.sh @@ -16,7 +16,7 @@ docker --version # sanity check sudo usermod -aG docker user # Install docker-compose -sudo curl -L "https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose +sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose docker-compose --version # sanity check From 410ecff4f25ff90f3a85f62bc63a3e31180f59c3 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Wed, 15 Sep 2021 12:58:05 +0200 Subject: [PATCH 7/9] fix path --- packages/health-check/bin/cli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/health-check/bin/cli b/packages/health-check/bin/cli index 176ed23c..5bf0064c 100755 --- a/packages/health-check/bin/cli +++ b/packages/health-check/bin/cli @@ -55,7 +55,7 @@ require("yargs/yargs")(process.argv.slice(2)) const { getYesterdayISOString } = require("../src/utils"); const createMiddleware = require("../src/checks/middleware"); const db = require("../src/db"); - const checks = require(`./src/checks/${type}`); + const checks = require(`../src/checks/${type}`); const middleware = await createMiddleware(); const entry = { From 863359f227568dfad9cec17c7cfdf05047cc4686 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Wed, 15 Sep 2021 13:03:23 +0200 Subject: [PATCH 8/9] use full path --- packages/health-check/cli/disable | 2 +- packages/health-check/cli/enable | 2 +- packages/health-check/cli/run | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/health-check/cli/disable b/packages/health-check/cli/disable index ac83f874..0f267250 100755 --- a/packages/health-check/cli/disable +++ b/packages/health-check/cli/disable @@ -1,3 +1,3 @@ #!/bin/ash -cli disable $@ +/usr/app/bin/cli disable $@ diff --git a/packages/health-check/cli/enable b/packages/health-check/cli/enable index f1687407..09483295 100755 --- a/packages/health-check/cli/enable +++ b/packages/health-check/cli/enable @@ -1,3 +1,3 @@ #!/bin/ash -cli enable $@ +/usr/app/bin/cli enable $@ diff --git a/packages/health-check/cli/run b/packages/health-check/cli/run index c8fd2ef0..7e38e14d 100755 --- a/packages/health-check/cli/run +++ b/packages/health-check/cli/run @@ -1,3 +1,3 @@ #!/bin/ash -cli run $0 +/usr/app/bin/cli run $0 From 6e555a5efb6fbbd00e2691edfe0e79d734945561 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Wed, 15 Sep 2021 13:06:16 +0200 Subject: [PATCH 9/9] add deprecated note --- packages/health-check/cli/disable | 2 ++ packages/health-check/cli/enable | 2 ++ packages/health-check/cli/run | 2 ++ 3 files changed, 6 insertions(+) diff --git a/packages/health-check/cli/disable b/packages/health-check/cli/disable index 0f267250..e6105112 100755 --- a/packages/health-check/cli/disable +++ b/packages/health-check/cli/disable @@ -1,3 +1,5 @@ #!/bin/ash +echo "DEPRECATED: 'cli/disable' command is deprecated, use 'cli disable' instead" + /usr/app/bin/cli disable $@ diff --git a/packages/health-check/cli/enable b/packages/health-check/cli/enable index 09483295..d362b267 100755 --- a/packages/health-check/cli/enable +++ b/packages/health-check/cli/enable @@ -1,3 +1,5 @@ #!/bin/ash +echo "DEPRECATED: 'cli/enable' command is deprecated, use 'cli enable' instead" + /usr/app/bin/cli enable $@ diff --git a/packages/health-check/cli/run b/packages/health-check/cli/run index 7e38e14d..d76e29d8 100755 --- a/packages/health-check/cli/run +++ b/packages/health-check/cli/run @@ -1,3 +1,5 @@ #!/bin/ash +echo "DEPRECATED: 'cli/run' command is deprecated, use 'cli run' instead" + /usr/app/bin/cli run $0