Merge branch 'master' into portal-latest

This commit is contained in:
Filip Rysavy 2021-09-15 13:16:38 +02:00
commit c59188cc43
No known key found for this signature in database
GPG Key ID: EA1F430401C92D99
12 changed files with 46 additions and 48 deletions

View File

@ -1,23 +0,0 @@
# PULL REQUEST
## Overview
## Example for Visual Changes
<!--
For user facing features please provide proof that the format is as expected.
Screen shots and/or asciinema recordings are very helpful.
-->
## 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
<!--
Use the `Closes` keyword to automatically close the issue on merge.
Example: Closes #XXXX
-->

View File

@ -1,4 +1,4 @@
FROM golang:1.15 FROM golang:1.16.7
LABEL maintainer="NebulousLabs <devs@nebulous.tech>" LABEL maintainer="NebulousLabs <devs@nebulous.tech>"
ENV GOOS linux ENV GOOS linux

View File

@ -16,7 +16,7 @@
"autoprefixer": "10.3.4", "autoprefixer": "10.3.4",
"classnames": "2.3.1", "classnames": "2.3.1",
"clipboardy": "2.3.0", "clipboardy": "2.3.0",
"dayjs": "1.10.6", "dayjs": "1.10.7",
"express-jwt": "6.1.0", "express-jwt": "6.1.0",
"fast-levenshtein": "3.0.0", "fast-levenshtein": "3.0.0",
"formik": "2.2.9", "formik": "2.2.9",
@ -31,7 +31,7 @@
"skynet-js": "3.0.2", "skynet-js": "3.0.2",
"stripe": "8.174.0", "stripe": "8.174.0",
"superagent": "6.1.0", "superagent": "6.1.0",
"swr": "1.0.0", "swr": "1.0.1",
"tailwindcss": "2.2.15", "tailwindcss": "2.2.15",
"yup": "0.32.9" "yup": "0.32.9"
} }

View File

@ -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" resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz#594b8973938c5bc2c33046535785341abc4f3636"
integrity sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og== integrity sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og==
dayjs@1.10.6: dayjs@1.10.7:
version "1.10.6" version "1.10.7"
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.10.6.tgz#288b2aa82f2d8418a6c9d4df5898c0737ad02a63" resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.10.7.tgz#2cf5f91add28116748440866a0a1d26f3a6ce468"
integrity sha512-AztC/IOW4L1Q41A86phW5Thhcrco3xuAA+YX/BLpLWWjRcTj5TOt/QImBLmCKlrF7u7k47arTnOyL6GnbG8Hvw== integrity sha512-P6twpd70BcPK34K26uJ1KT3wlhpuOAPoMwJzpsIWUxHZ7wpmbdZL/hQqBDfz7hGurYSa5PhzdhDHtt319hL3ig==
debug@2: debug@2:
version "2.6.9" version "2.6.9"
@ -2934,10 +2934,10 @@ supports-color@^8.0.0:
dependencies: dependencies:
has-flag "^4.0.0" has-flag "^4.0.0"
swr@1.0.0: swr@1.0.1:
version "1.0.0" version "1.0.1"
resolved "https://registry.yarnpkg.com/swr/-/swr-1.0.0.tgz#d047933714d8bd16ae35af67d81149f4ae700a4d" resolved "https://registry.yarnpkg.com/swr/-/swr-1.0.1.tgz#15f62846b87ee000e52fa07812bb65eb62d79483"
integrity sha512-v55Dr+vxIFiUyGxC5W4uN5falxHxYdbpb/R3bO+bSG+svbC9bUWmupy4NM/2pER7X8OvgwJWu0AiSoGy0ND9ew== integrity sha512-EPQAxSjoD4IaM49rpRHK0q+/NzcwoT8c0/Ylu/u3/6mFj/CWnQVjNJ0MV2Iuw/U+EJSd2TX5czdAwKPYZIG0YA==
dependencies: dependencies:
dequal "2.0.2" dequal "2.0.2"

View File

@ -4,11 +4,13 @@ RUN apk update && apk add dnsmasq
WORKDIR /usr/app WORKDIR /usr/app
ENV PATH="/usr/app/bin:${PATH}"
# schedule critical checks to run every 5 minutes (any failures will disable server) # 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) # 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 ./ COPY package.json yarn.lock ./
@ -16,6 +18,7 @@ RUN yarn --frozen-lockfile
COPY src src COPY src src
COPY cli cli COPY cli cli
COPY bin bin
EXPOSE 3100 EXPOSE 3100
ENV NODE_ENV production ENV NODE_ENV production

View File

@ -3,12 +3,15 @@
process.env.NODE_ENV = process.env.NODE_ENV || "production"; process.env.NODE_ENV = process.env.NODE_ENV || "production";
require("yargs/yargs")(process.argv.slice(2)) require("yargs/yargs")(process.argv.slice(2))
.help()
.demandCommand()
.strict(true)
.command( .command(
"enable", "enable",
"Mark portal as enabled", "Mark portal as enabled",
() => {}, () => {},
() => { () => {
const db = require("./src/db"); const db = require("../src/db");
db.set("disabled", false).write(); db.set("disabled", false).write();
} }
@ -18,7 +21,7 @@ require("yargs/yargs")(process.argv.slice(2))
"Mark portal as disabled (provide meaningful reason)", "Mark portal as disabled (provide meaningful reason)",
() => {}, () => {},
({ reason }) => { ({ reason }) => {
const db = require("./src/db"); const db = require("../src/db");
db.set("disabled", reason).write(); db.set("disabled", reason).write();
} }
@ -49,10 +52,10 @@ require("yargs/yargs")(process.argv.slice(2))
process.env.STATE_DIR = stateDir; process.env.STATE_DIR = stateDir;
const util = require("util"); const util = require("util");
const { getYesterdayISOString } = require("./src/utils"); const { getYesterdayISOString } = require("../src/utils");
const createMiddleware = require("./src/checks/middleware"); const createMiddleware = require("../src/checks/middleware");
const db = require("./src/db"); const db = require("../src/db");
const checks = require(`./src/checks/${type}`); const checks = require(`../src/checks/${type}`);
const middleware = await createMiddleware(); const middleware = await createMiddleware();
const entry = { const entry = {

View File

@ -0,0 +1,5 @@
#!/bin/ash
echo "DEPRECATED: 'cli/disable' command is deprecated, use 'cli disable' instead"
/usr/app/bin/cli disable $@

View File

@ -0,0 +1,5 @@
#!/bin/ash
echo "DEPRECATED: 'cli/enable' command is deprecated, use 'cli enable' instead"
/usr/app/bin/cli enable $@

5
packages/health-check/cli/run Executable file
View File

@ -0,0 +1,5 @@
#!/bin/ash
echo "DEPRECATED: 'cli/run' command is deprecated, use 'cli run' instead"
/usr/app/bin/cli run $0

View File

@ -61,7 +61,7 @@
"react-use": "^17.3.1", "react-use": "^17.3.1",
"skynet-js": "^4.0.11-beta", "skynet-js": "^4.0.11-beta",
"stream-browserify": "^3.0.0", "stream-browserify": "^3.0.0",
"swr": "^1.0.0", "swr": "^1.0.1",
"tailwindcss": "^2.2.15" "tailwindcss": "^2.2.15"
}, },
"devDependencies": { "devDependencies": {

View File

@ -12924,10 +12924,10 @@ svgo@^2.3.0:
csso "^4.2.0" csso "^4.2.0"
stable "^0.1.8" stable "^0.1.8"
swr@^1.0.0: swr@^1.0.1:
version "1.0.0" version "1.0.1"
resolved "https://registry.yarnpkg.com/swr/-/swr-1.0.0.tgz#d047933714d8bd16ae35af67d81149f4ae700a4d" resolved "https://registry.yarnpkg.com/swr/-/swr-1.0.1.tgz#15f62846b87ee000e52fa07812bb65eb62d79483"
integrity sha512-v55Dr+vxIFiUyGxC5W4uN5falxHxYdbpb/R3bO+bSG+svbC9bUWmupy4NM/2pER7X8OvgwJWu0AiSoGy0ND9ew== integrity sha512-EPQAxSjoD4IaM49rpRHK0q+/NzcwoT8c0/Ylu/u3/6mFj/CWnQVjNJ0MV2Iuw/U+EJSd2TX5czdAwKPYZIG0YA==
dependencies: dependencies:
dequal "2.0.2" dequal "2.0.2"

View File

@ -16,7 +16,7 @@ docker --version # sanity check
sudo usermod -aG docker user sudo usermod -aG docker user
# Install docker-compose # 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 sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version # sanity check docker-compose --version # sanity check