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 - 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 diff --git a/packages/dashboard/package.json b/packages/dashboard/package.json index a3caa921..ed7c4926 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", @@ -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..fbaac106 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" @@ -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" 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 85% rename from packages/health-check/cli rename to packages/health-check/bin/cli index 8e7ee861..5bf0064c 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,10 +52,10 @@ 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 checks = require(`./src/checks/${type}`); + 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(); const entry = { diff --git a/packages/health-check/cli/disable b/packages/health-check/cli/disable new file mode 100755 index 00000000..e6105112 --- /dev/null +++ b/packages/health-check/cli/disable @@ -0,0 +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 new file mode 100755 index 00000000..d362b267 --- /dev/null +++ b/packages/health-check/cli/enable @@ -0,0 +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 new file mode 100755 index 00000000..d76e29d8 --- /dev/null +++ b/packages/health-check/cli/run @@ -0,0 +1,5 @@ +#!/bin/ash + +echo "DEPRECATED: 'cli/run' command is deprecated, use 'cli run' instead" + +/usr/app/bin/cli run $0 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" 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