diff --git a/.dockerignore b/.dockerignore index 9c16887..3d92084 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,8 +2,12 @@ /dist /node_modules /data +/out +/test +/kubernetes /.do **/.dockerignore +/private **/.git **/.gitignore **/docker-compose* diff --git a/.eslintrc.js b/.eslintrc.js index 398d64c..8b45337 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,4 +1,5 @@ module.exports = { + root: true, env: { browser: true, commonjs: true, @@ -16,6 +17,7 @@ module.exports = { requireConfigFile: false, }, rules: { + "linebreak-style": ["error", "unix"], "camelcase": ["warn", { "properties": "never", "ignoreImports": true @@ -32,11 +34,12 @@ module.exports = { }, ], quotes: ["warn", "double"], - //semi: ['off', 'never'], + semi: "warn", "vue/html-indent": ["warn", 4], // default: 2 "vue/max-attributes-per-line": "off", "vue/singleline-html-element-content-newline": "off", "vue/html-self-closing": "off", + "vue/attribute-hyphenation": "off", // This change noNL to "no-n-l" unexpectedly "no-multi-spaces": ["error", { ignoreEOLComments: true, }], @@ -84,10 +87,10 @@ module.exports = { }, "overrides": [ { - "files": [ "src/languages/*.js" ], + "files": [ "src/languages/*.js", "src/icon.js" ], "rules": { "comma-dangle": ["error", "always-multiline"], } } ] -} +}; diff --git a/.github/ISSUE_TEMPLATE/ask-for-help.md b/.github/ISSUE_TEMPLATE/ask-for-help.md index f1ea1ac..c0c8d1e 100644 --- a/.github/ISSUE_TEMPLATE/ask-for-help.md +++ b/.github/ISSUE_TEMPLATE/ask-for-help.md @@ -16,4 +16,3 @@ Docker Version: Node.js Version (Without Docker only): OS: Browser: - diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 158b3e7..370b88b 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -15,6 +15,7 @@ A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: + 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' @@ -23,7 +24,6 @@ Steps to reproduce the behavior: **Expected behavior** A clear and concise description of what you expected to happen. - **Info** Uptime Kuma Version: Using Docker?: Yes/No @@ -32,13 +32,11 @@ Node.js Version (Without Docker only): OS: Browser: - **Screenshots** If applicable, add screenshots to help explain your problem. **Error Log** It is easier for us to find out the problem. -Docker: "docker logs " -PM2: "~/.pm2/logs/" (e.g. /home/ubuntu/.pm2/logs) - +Docker: `docker logs ` +PM2: `~/.pm2/logs/` (e.g. `/home/ubuntu/.pm2/logs`) diff --git a/.gitignore b/.gitignore index 9caa313..2bf60f7 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,7 @@ dist-ssr /data !/data/.gitkeep -.vscode \ No newline at end of file +.vscode + +/private +/out diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 4cbcc7b..b618a2c 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban. ### 4. Permanent Ban **Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an +standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. **Consequence**: A permanent ban from any sort of public interaction within diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0851cd3..7a0ee2d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,7 @@ First of all, thank you everyone who made pull requests for Uptime Kuma, I never thought GitHub Community can be that nice! And also because of this, I also never thought other people actually read my code and edit my code. It is not structed and commented so well, lol. Sorry about that. -The project was created with vite.js (vue3). Then I created a sub-directory called "server" for server part. Both frontend and backend share the same package.json. +The project was created with vite.js (vue3). Then I created a sub-directory called "server" for server part. Both frontend and backend share the same package.json. The frontend code build into "dist" directory. The server uses "dist" as root. This is how production is working. @@ -20,13 +20,13 @@ If you are not sure, feel free to create an empty pull request draft first. - Add a chart - Fix a bug -### *️⃣ Requires one more reviewer +### *️⃣ Requires one more reviewer I do not have such knowledge to test it. -- Add k8s supports +- Add k8s supports -### *️⃣ Low Priority +### *️⃣ Low Priority It changed my current workflow and require further studies. @@ -41,9 +41,9 @@ It changed my current workflow and require further studies. # Project Styles -I personally do not like something need to learn so much and need to config so much before you can finally start the app. +I personally do not like something need to learn so much and need to config so much before you can finally start the app. -For example, recently, because I am not a python expert, I spent a 2 hours to resolve all problems in order to install and use the Apprise cli. Apprise requires so many hidden requirements, I have to figure out myself how to solve the problems by Google search for my OS. That is painful. I do not want Uptime Kuma to be like this way, so: +For example, recently, because I am not a python expert, I spent a 2 hours to resolve all problems in order to install and use the Apprise cli. Apprise requires so many hidden requirements, I have to figure out myself how to solve the problems by Google search for my OS. That is painful. I do not want Uptime Kuma to be like this way, so: - Easy to install for non-Docker users, no native build dependency is needed (at least for x86_64), no extra config, no extra effort to get it run - Single container for Docker users, no very complex docker-composer file. Just map the volume and expose the port, then good to go @@ -52,8 +52,8 @@ For example, recently, because I am not a python expert, I spent a 2 hours to re # Coding Styles -- Follow .editorconfig -- Follow eslint +- Follow `.editorconfig` +- Follow ESLint ## Name convention @@ -62,12 +62,13 @@ For example, recently, because I am not a python expert, I spent a 2 hours to re - CSS/SCSS: dash-type # Tools + - Node.js >= 14 - Git -- IDE that supports .editorconfig and eslint (I am using Intellji Idea) +- IDE that supports EditorConfig and ESLint (I am using Intellji Idea) - A SQLite tool (I am using SQLite Expert Personal) -# Install dependencies +# Install dependencies ```bash npm install --dev @@ -75,32 +76,29 @@ npm install --dev For npm@7, you need --legacy-peer-deps -``` +```bash npm install --legacy-peer-deps --dev ``` # Backend Dev -```bash -npm run start-server - -# Or +(2021-09-23 Update) -node server/server.js +```bash +npm run start-server-dev ``` -It binds to 0.0.0.0:3001 by default. - +It binds to `0.0.0.0:3001` by default. ## Backend Details It is mainly a socket.io app + express.js. -express.js is just used for serving the frontend built files (index.html, .js and .css etc.) +express.js is just used for serving the frontend built files (index.html, .js and .css etc.) # Frontend Dev -Start frontend dev server. Hot-reload enabled in this way. It binds to 0.0.0.0:3000. +Start frontend dev server. Hot-reload enabled in this way. It binds to `0.0.0.0:3000` by default. ```bash npm run dev @@ -108,7 +106,7 @@ npm run dev PS: You can ignore those scss warnings, those warnings are from Bootstrap that I cannot fix. -You can use Vue Devtool Chrome extension for debugging. +You can use Vue.js devtools Chrome extension for debugging. After the frontend server started. It cannot connect to the websocket server even you have started the server. You need to tell the frontend that is a dev env by running this in DevTool console and refresh: @@ -118,8 +116,7 @@ localStorage.dev = "dev"; So that the frontend will try to connect websocket server in 3001. -Alternately, you can specific NODE_ENV to "development". - +Alternately, you can specific `NODE_ENV` to "development". ## Build the frontend @@ -131,22 +128,17 @@ npm run build Uptime Kuma Frontend is a single page application (SPA). Most paths are handled by Vue Router. -The router in "src/main.js" +The router is in `src/router.js` As you can see, most data in frontend is stored in root level, even though you changed the current router to any other pages. -The data and socket logic in "src/mixins/socket.js" +The data and socket logic are in `src/mixins/socket.js`. # Database Migration -1. create `patch{num}.sql` in `./db/` -1. update `latestVersion` in `./server/database.js` +1. Create `patch{num}.sql` in `./db/` +2. Update `latestVersion` in `./server/database.js` # Unit Test Yes, no unit test for now. I know it is very important, but at the same time my spare time is very limited. I want to implement my ideas first. I will go back to this in some points. - - - - - diff --git a/README.md b/README.md index 724bdd6..f0fa92d 100644 --- a/README.md +++ b/README.md @@ -20,12 +20,11 @@ It is a 5 minutes live demo, all data will be deleted after that. The server is VPS is sponsored by Uptime Kuma sponsors on [Open Collective](https://opencollective.com/uptime-kuma)! Thank you so much! - ## ⭐ Features * Monitoring uptime for HTTP(s) / TCP / Ping / DNS Record. * Fancy, Reactive, Fast UI/UX. -* Notifications via Telegram, Discord, Gotify, Slack, Pushover, Email (SMTP), and [70+ notification services, click here for the full list](https://github.com/louislam/uptime-kuma/issues/284). +* Notifications via Telegram, Discord, Gotify, Slack, Pushover, Email (SMTP), and [70+ notification services, click here for the full list](https://github.com/louislam/uptime-kuma/issues/284). * 20 seconds interval. * [Multi Languages](https://github.com/louislam/uptime-kuma/tree/master/src/languages) @@ -45,6 +44,9 @@ Browse to http://localhost:3001 after started. Required Tools: Node.js >= 14, git and pm2. ```bash +# Update your npm to the latest version +npm install npm -g + git clone https://github.com/louislam/uptime-kuma.git cd uptime-kuma npm run setup @@ -65,7 +67,6 @@ If you need more options or need to browse via a reserve proxy, please read: https://github.com/louislam/uptime-kuma/wiki/%F0%9F%94%A7-How-to-Install - ## 🆙 How to Update Please read: @@ -107,15 +108,15 @@ Telegram Notification Sample: If you love this project, please consider giving me a ⭐. - ## 🗣️ Discussion -You can also discuss or ask for help in [Issues](https://github.com/louislam/uptime-kuma/issues). - -Alternatively, you can discuss in my original post on reddit: https://www.reddit.com/r/selfhosted/comments/oi7dc7/uptime_kuma_a_fancy_selfhosted_monitoring_tool_an/ - -I think the real "Discussion" tab is hard to use, as it is reddit-like flow, I always missed new comments. +### Issues Page +You can discuss or ask for help in [Issues](https://github.com/louislam/uptime-kuma/issues). +### Subreddit +My Reddit account: louislamlam +You can mention me if you ask question on Reddit. +https://www.reddit.com/r/UptimeKuma/ ## Contribute @@ -126,4 +127,3 @@ If you want to translate Uptime Kuma into your langauge, please read: https://gi If you want to modify Uptime Kuma, this guideline may be useful for you: https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md English proofreading is needed too because my grammar is not that great sadly. Feel free to correct my grammar in this readme, source code, or wiki. - diff --git a/SECURITY.md b/SECURITY.md index 47f0786..1271565 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -10,5 +10,6 @@ currently being supported with security updates. | 1.x.x | :white_check_mark: | ## Reporting a Vulnerability +Please report security issues to uptime@kuma.pet. -https://github.com/louislam/uptime-kuma/issues +Do not use the issue tracker or discuss it in the public as it will cause more damage. diff --git a/db/demo_kuma.db b/db/demo_kuma.db deleted file mode 100644 index 2042fcf..0000000 Binary files a/db/demo_kuma.db and /dev/null differ diff --git a/db/patch-add-retry-interval-monitor.sql b/db/patch-add-retry-interval-monitor.sql new file mode 100644 index 0000000..adb6462 --- /dev/null +++ b/db/patch-add-retry-interval-monitor.sql @@ -0,0 +1,7 @@ +-- You should not modify if this have pushed to Github, unless it does serious wrong with the db. +BEGIN TRANSACTION; + +ALTER TABLE monitor + ADD retry_interval INTEGER default 0 not null; + +COMMIT; \ No newline at end of file diff --git a/db/patch-group-table.sql b/db/patch-group-table.sql new file mode 100644 index 0000000..1c6f366 --- /dev/null +++ b/db/patch-group-table.sql @@ -0,0 +1,30 @@ +-- You should not modify if this have pushed to Github, unless it does serious wrong with the db. +BEGIN TRANSACTION; + +create table `group` +( + id INTEGER not null + constraint group_pk + primary key autoincrement, + name VARCHAR(255) not null, + created_date DATETIME default (DATETIME('now')) not null, + public BOOLEAN default 0 not null, + active BOOLEAN default 1 not null, + weight BOOLEAN NOT NULL DEFAULT 1000 +); + +CREATE TABLE [monitor_group] +( + [id] INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + [monitor_id] INTEGER NOT NULL REFERENCES [monitor] ([id]) ON DELETE CASCADE ON UPDATE CASCADE, + [group_id] INTEGER NOT NULL REFERENCES [group] ([id]) ON DELETE CASCADE ON UPDATE CASCADE, + weight BOOLEAN NOT NULL DEFAULT 1000 +); + +CREATE INDEX [fk] + ON [monitor_group] ( + [monitor_id], + [group_id]); + + +COMMIT; diff --git a/db/patch-incident-table.sql b/db/patch-incident-table.sql new file mode 100644 index 0000000..531cfb3 --- /dev/null +++ b/db/patch-incident-table.sql @@ -0,0 +1,18 @@ +-- You should not modify if this have pushed to Github, unless it does serious wrong with the db. +BEGIN TRANSACTION; + +create table incident +( + id INTEGER not null + constraint incident_pk + primary key autoincrement, + title VARCHAR(255) not null, + content TEXT not null, + style VARCHAR(30) default 'warning' not null, + created_date DATETIME default (DATETIME('now')) not null, + last_updated_date DATETIME, + pin BOOLEAN default 1 not null, + active BOOLEAN default 1 not null +); + +COMMIT; diff --git a/db/patch10.sql b/db/patch10.sql new file mode 100644 index 0000000..488db11 --- /dev/null +++ b/db/patch10.sql @@ -0,0 +1,19 @@ +-- You should not modify if this have pushed to Github, unless it does serious wrong with the db. +CREATE TABLE tag ( + id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + name VARCHAR(255) NOT NULL, + color VARCHAR(255) NOT NULL, + created_date DATETIME DEFAULT (DATETIME('now')) NOT NULL +); + +CREATE TABLE monitor_tag ( + id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + monitor_id INTEGER NOT NULL, + tag_id INTEGER NOT NULL, + value TEXT, + CONSTRAINT FK_tag FOREIGN KEY (tag_id) REFERENCES tag(id) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT FK_monitor FOREIGN KEY (monitor_id) REFERENCES monitor(id) ON DELETE CASCADE ON UPDATE CASCADE +); + +CREATE INDEX monitor_tag_monitor_id_index ON monitor_tag (monitor_id); +CREATE INDEX monitor_tag_tag_id_index ON monitor_tag (tag_id); diff --git a/dockerfile b/dockerfile index 6622def..9793601 100644 --- a/dockerfile +++ b/dockerfile @@ -1,36 +1,32 @@ # DON'T UPDATE TO node:14-bullseye-slim, see #372. +# If the image changed, the second stage image should be changed too FROM node:14-buster-slim AS build WORKDIR /app -# split the sqlite install here, so that it can caches the arm prebuilt -# do not modify it, since we don't want to re-compile the arm prebuilt again -RUN apt update && \ - apt --yes install python3 python3-pip python3-dev git g++ make && \ - ln -s /usr/bin/python3 /usr/bin/python && \ - npm install mapbox/node-sqlite3#593c9d --build-from-source - COPY . . -RUN npm install --legacy-peer-deps && npm run build && npm prune --production +RUN npm install --legacy-peer-deps && \ + npm run build && \ + npm prune --production && \ + chmod +x /app/extra/entrypoint.sh + -FROM node:14-bullseye-slim AS release +FROM node:14-buster-slim AS release WORKDIR /app -# Install Apprise, -# add sqlite3 cli for debugging in the future -# iputils-ping for ping +# Install Apprise, add sqlite3 cli for debugging in the future, iputils-ping for ping, util-linux for setpriv RUN apt update && \ - apt --yes install python3 python3-pip python3-cryptography python3-six python3-yaml python3-click python3-markdown python3-requests python3-requests-oauthlib \ - sqlite3 \ - iputils-ping && \ - pip3 --no-cache-dir install apprise && \ - rm -rf /var/lib/apt/lists/* + apt --yes install python3 python3-pip python3-cryptography python3-six python3-yaml python3-click python3-markdown python3-requests python3-requests-oauthlib \ + sqlite3 iputils-ping util-linux && \ + pip3 --no-cache-dir install apprise && \ + rm -rf /var/lib/apt/lists/* # Copy app files from build layer -COPY --from=build /app /app +COPY --from=build /app /app EXPOSE 3001 VOLUME ["/app/data"] HEALTHCHECK --interval=60s --timeout=30s --start-period=180s --retries=5 CMD node extra/healthcheck.js +ENTRYPOINT ["extra/entrypoint.sh"] CMD ["node", "server/server.js"] FROM release AS nightly diff --git a/dockerfile-alpine b/dockerfile-alpine index 9982046..f30da5b 100644 --- a/dockerfile-alpine +++ b/dockerfile-alpine @@ -2,31 +2,28 @@ FROM node:14-alpine3.12 AS build WORKDIR /app -# split the sqlite install here, so that it can caches the arm prebuilt -RUN apk add --no-cache --virtual .build-deps make g++ python3 python3-dev git && \ - ln -s /usr/bin/python3 /usr/bin/python && \ - npm install mapbox/node-sqlite3#593c9d && \ - apk del .build-deps && \ - rm -f /usr/bin/python - COPY . . -RUN npm install --legacy-peer-deps && npm run build && npm prune --production +RUN npm install --legacy-peer-deps && \ + npm run build && \ + npm prune --production && \ + chmod +x /app/extra/entrypoint.sh FROM node:14-alpine3.12 AS release WORKDIR /app -# Install apprise -RUN apk add --no-cache python3 py3-cryptography py3-pip py3-six py3-yaml py3-click py3-markdown py3-requests py3-requests-oauthlib && \ - pip3 --no-cache-dir install apprise && \ - rm -rf /root/.cache +# Install apprise, iputils for non-root ping, setpriv +RUN apk add --no-cache iputils setpriv python3 py3-cryptography py3-pip py3-six py3-yaml py3-click py3-markdown py3-requests py3-requests-oauthlib && \ + pip3 --no-cache-dir install apprise && \ + rm -rf /root/.cache # Copy app files from build layer -COPY --from=build /app /app +COPY --from=build /app /app EXPOSE 3001 VOLUME ["/app/data"] HEALTHCHECK --interval=60s --timeout=30s --start-period=180s --retries=5 CMD node extra/healthcheck.js +ENTRYPOINT ["extra/entrypoint.sh"] CMD ["node", "server/server.js"] FROM release AS nightly diff --git a/extra/entrypoint.sh b/extra/entrypoint.sh new file mode 100644 index 0000000..0f1d4e2 --- /dev/null +++ b/extra/entrypoint.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env sh + +# set -e Exit the script if an error happens +set -e +PUID=${PUID=1000} +PGID=${PGID=1000} + +files_ownership () { + # -h Changes the ownership of an encountered symbolic link and not that of the file or directory pointed to by the symbolic link. + # -R Recursively descends the specified directories + # -c Like verbose but report only when a change is made + chown -hRc "$PUID":"$PGID" /app/data +} + +echo "==> Performing startup jobs and maintenance tasks" +files_ownership + +echo "==> Starting application with user $PUID group $PGID" + +# --clear-groups Clear supplementary groups. +exec setpriv --reuid "$PUID" --regid "$PGID" --clear-groups "$@" diff --git a/extra/reset-password.js b/extra/reset-password.js index b849848..be03958 100644 --- a/extra/reset-password.js +++ b/extra/reset-password.js @@ -6,12 +6,14 @@ const Database = require("../server/database"); const { R } = require("redbean-node"); const readline = require("readline"); const { initJWTSecret } = require("../server/util-server"); +const args = require("args-parser")(process.argv); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); (async () => { + Database.init(args); await Database.connect(); try { diff --git a/extra/update-language-files/index.js b/extra/update-language-files/index.js index ee7c0b5..a90f9f3 100644 --- a/extra/update-language-files/index.js +++ b/extra/update-language-files/index.js @@ -1,4 +1,4 @@ -// Need to use es6 to read language files +// Need to use ES6 to read language files import fs from "fs"; import path from "path"; @@ -14,6 +14,7 @@ const copyRecursiveSync = function (src, dest) { let exists = fs.existsSync(src); let stats = exists && fs.statSync(src); let isDirectory = exists && stats.isDirectory(); + if (isDirectory) { fs.mkdirSync(dest); fs.readdirSync(src).forEach(function (childItemName) { @@ -24,8 +25,9 @@ const copyRecursiveSync = function (src, dest) { fs.copyFileSync(src, dest); } }; -console.log(process.argv) -const baseLangCode = process.argv[2] || "zh-HK"; + +console.log("Arguments:", process.argv) +const baseLangCode = process.argv[2] || "en"; console.log("Base Lang: " + baseLangCode); fs.rmdirSync("./languages", { recursive: true }); copyRecursiveSync("../../src/languages", "./languages"); @@ -33,46 +35,50 @@ copyRecursiveSync("../../src/languages", "./languages"); const en = (await import("./languages/en.js")).default; const baseLang = (await import(`./languages/${baseLangCode}.js`)).default; const files = fs.readdirSync("./languages"); -console.log(files); +console.log("Files:", files); + for (const file of files) { - if (file.endsWith(".js")) { - console.log("Processing " + file); - const lang = await import("./languages/" + file); + if (!file.endsWith(".js")) { + console.log("Skipping " + file) + continue; + } - let obj; + console.log("Processing " + file); + const lang = await import("./languages/" + file); - if (lang.default) { - console.log("is js module"); - obj = lang.default; - } else { - console.log("empty file"); - obj = { - languageName: "" - }; - } + let obj; - // En first - for (const key in en) { - if (! obj[key]) { - obj[key] = en[key]; - } + if (lang.default) { + obj = lang.default; + } else { + console.log("Empty file"); + obj = { + languageName: "" + }; + } + + // En first + for (const key in en) { + if (! obj[key]) { + obj[key] = en[key]; } + } + if (baseLang !== en) { // Base second for (const key in baseLang) { if (! obj[key]) { obj[key] = key; } } + } - const code = "export default " + util.inspect(obj, { - depth: null, - }); - - fs.writeFileSync(`../../src/languages/${file}`, code); + const code = "export default " + util.inspect(obj, { + depth: null, + }); - } + fs.writeFileSync(`../../src/languages/${file}`, code); } fs.rmdirSync("./languages", { recursive: true }); -console.log("Done, fix the format by eslint now"); +console.log("Done. Fixing formatting by ESLint..."); diff --git a/index.html b/index.html index 61d0f42..cd5da93 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,7 @@ + Uptime Kuma diff --git a/kubernetes/README.md b/kubernetes/README.md index 3057a53..e85b0c4 100644 --- a/kubernetes/README.md +++ b/kubernetes/README.md @@ -8,24 +8,25 @@ Kustomize is a tool which builds a complete deployment file for all config eleme You can edit the files in the ```uptime-kuma``` folder except the ```kustomization.yml``` until you know what you're doing. If you want to choose another namespace you can edit the ```kustomization.yml``` in the ```kubernetes```-Folder and change the ```namespace: uptime-kuma``` to something you like. -It creates a certificate with the specified Issuer and creates the Ingress for the Uptime-Kuma ClusterIP-Service +It creates a certificate with the specified Issuer and creates the Ingress for the Uptime-Kuma ClusterIP-Service. + +## What do I have to edit? -## What do i have to edit? You have to edit the ```ingressroute.yml``` to your needs. This ingressroute.yml is for the [nginx-ingress-controller](https://kubernetes.github.io/ingress-nginx/) in combination with the [cert-manager](https://cert-manager.io/). -- host -- secrets and secret names +- Host +- Secrets and secret names - (Cluster)Issuer (optional) -- the Version in the Deployment-File - - update: - - change to newer version and run the above commands, it will update the pods one after another +- The Version in the Deployment-File + - Update: + - Change to newer version and run the above commands, it will update the pods one after another -## How To use: +## How To use -- install [kustomize](https://kubectl.docs.kubernetes.io/installation/kustomize/) +- Install [kustomize](https://kubectl.docs.kubernetes.io/installation/kustomize/) - Edit files mentioned above to your needs -- run ```kustomize build > apply.yml``` -- run ```kubectl apply -f apply.yml``` +- Run ```kustomize build > apply.yml``` +- Run ```kubectl apply -f apply.yml``` Now you should see some k8s magic and Uptime-Kuma should be available at the specified address. diff --git a/package-lock.json b/package-lock.json index 54ef9a2..511f02d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,22 +13,23 @@ "@fortawesome/free-regular-svg-icons": "^5.15.4", "@fortawesome/free-solid-svg-icons": "^5.15.4", "@fortawesome/vue-fontawesome": "^3.0.0-4", - "@popperjs/core": "^2.9.3", + "@louislam/sqlite3": "^5.0.6", + "@popperjs/core": "^2.10.1", "args-parser": "^1.3.0", - "axios": "^0.21.1", + "axios": "^0.21.4", "bcryptjs": "^2.4.3", - "bootstrap": "^5.1.0", + "bootstrap": "^5.1.1", "chart.js": "^3.5.1", "chartjs-adapter-dayjs": "^1.0.0", "command-exists": "^1.2.9", "compare-versions": "^3.6.0", - "dayjs": "^1.10.6", + "dayjs": "^1.10.7", "express": "^4.17.1", "express-basic-auth": "^1.2.0", "form-data": "^4.0.0", "http-graceful-shutdown": "^3.1.4", "jsonwebtoken": "^8.5.1", - "nodemailer": "^6.6.3", + "nodemailer": "^6.6.5", "notp": "^2.0.3", "password-hash": "^1.2.2", "prom-client": "^13.2.0", @@ -37,34 +38,38 @@ "redbean-node": "0.1.2", "socket.io": "^4.2.0", "socket.io-client": "^4.2.0", - "sqlite3": "github:mapbox/node-sqlite3#593c9d", "tcp-ping": "^0.1.1", "thirty-two": "^1.0.2", + "timezones-list": "^3.0.1", "v-pagination-3": "^0.1.6", - "vue": "^3.2.8", - "vue-chart-3": "^0.5.7", + "vue": "next", + "vue-chart-3": "^0.5.8", "vue-confirm-dialog": "^1.0.2", + "vue-contenteditable": "^3.0.4", "vue-i18n": "^9.1.7", + "vue-image-crop-upload": "^3.0.3", "vue-multiselect": "^3.0.0-alpha.2", "vue-qrcode": "^1.0.0", "vue-router": "^4.0.11", - "vue-toastification": "^2.0.0-rc.1" + "vue-toastification": "^2.0.0-rc.1", + "vuedraggable": "^4.1.0" }, "devDependencies": { - "@babel/eslint-parser": "^7.15.0", - "@types/bootstrap": "^5.1.2", - "@vitejs/plugin-legacy": "^1.5.2", - "@vitejs/plugin-vue": "^1.6.0", - "@vue/compiler-sfc": "^3.2.6", - "core-js": "^3.17.0", + "@babel/eslint-parser": "^7.15.7", + "@types/bootstrap": "^5.1.6", + "@vitejs/plugin-legacy": "^1.5.3", + "@vitejs/plugin-vue": "^1.9.1", + "@vue/compiler-sfc": "^3.2.16", + "core-js": "^3.18.0", + "cross-env": "^7.0.3", "dns2": "^2.0.1", "eslint": "^7.32.0", - "eslint-plugin-vue": "^7.17.0", - "sass": "^1.38.2", + "eslint-plugin-vue": "^7.18.0", + "sass": "^1.42.1", "stylelint": "^13.13.1", "stylelint-config-standard": "^22.0.0", - "typescript": "^4.4.2", - "vite": "^2.5.3" + "typescript": "^4.4.3", + "vite": "^2.5.10" }, "engines": { "node": "14.*" @@ -89,9 +94,9 @@ } }, "node_modules/@babel/core": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.15.4.tgz", - "integrity": "sha512-Lkcv9I4a8bgUI8LJOLM6IKv6hnz1KOju6KM1lceqVMKlKKqNRopYd2Pc9MgIurqvMJ6BooemrnJz8jlIiQIpsA==", + "version": "7.15.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.15.5.tgz", + "integrity": "sha512-pYgXxiwAgQpgM1bNkZsDEq85f0ggXMA5L7c+o3tskGMh2BunCI9QUwB9Z4jpvXUOuMdyGKiGKQiRe11VS6Jzvg==", "dev": true, "dependencies": { "@babel/code-frame": "^7.14.5", @@ -99,7 +104,7 @@ "@babel/helper-compilation-targets": "^7.15.4", "@babel/helper-module-transforms": "^7.15.4", "@babel/helpers": "^7.15.4", - "@babel/parser": "^7.15.4", + "@babel/parser": "^7.15.5", "@babel/template": "^7.15.4", "@babel/traverse": "^7.15.4", "@babel/types": "^7.15.4", @@ -155,9 +160,9 @@ } }, "node_modules/@babel/eslint-parser": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.15.4.tgz", - "integrity": "sha512-hPMIAmGNbmQzXJIo2P43Zj9UhRmGev5f9nqdBFOWNGDGh6XKmjby79woBvg6y0Jur6yRfQBneDbUQ8ZVc1krFw==", + "version": "7.15.7", + "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.15.7.tgz", + "integrity": "sha512-yJkHyomClm6A2Xzb8pdAo4HzYMSXFn1O5zrCYvbFP0yQFvHueLedV8WiEno8yJOKStjUXzBZzJFeWQ7b3YMsqQ==", "dev": true, "dependencies": { "eslint-scope": "^5.1.1", @@ -462,9 +467,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.15.4.tgz", - "integrity": "sha512-xmzz+7fRpjrvDUj+GV7zfz/R3gSK2cOxGlazaXooxspCr539cbTXJKvBJzSVI2pPhcRGquoOtaIkKCsHQUiO3w==", + "version": "7.15.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.15.6.tgz", + "integrity": "sha512-S/TSCcsRuCkmpUuoWijua0Snt+f3ewU/8spLo+4AXJCZfT0bVCzLD5MuOKdrx0mlAptbKzn5AdgEIIKXxXkz9Q==", "bin": { "parser": "bin/babel-parser.js" }, @@ -473,9 +478,9 @@ } }, "node_modules/@babel/standalone": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/standalone/-/standalone-7.15.4.tgz", - "integrity": "sha512-UO0QCTFjX5NSuwX/i8+/pesmRPoRTtf46Cpn8VHcXvNinEr2lxqe8Ix10TfU/UK5qsaOrcKk24We8wH1G0nTZA==", + "version": "7.15.6", + "resolved": "https://registry.npmjs.org/@babel/standalone/-/standalone-7.15.6.tgz", + "integrity": "sha512-1N9+KHL9ZYKiDDXFgBvg8Sl135evIJgP/YZdOhqdfMMTL/zuAm6bUi/FYEwzTXYhQS8MBtRMVmmcIurif7hYiQ==", "dev": true, "engines": { "node": ">=6.9.0" @@ -549,9 +554,9 @@ } }, "node_modules/@babel/types": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.15.4.tgz", - "integrity": "sha512-0f1HJFuGmmbrKTCZtbm3cU+b/AqdEYk5toj5iQur58xkVMlS0JWaKxTBSmCXd47uiN7vbcozAupm6Mvs80GNhw==", + "version": "7.15.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.15.6.tgz", + "integrity": "sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig==", "dependencies": { "@babel/helper-validator-identifier": "^7.14.9", "to-fast-properties": "^2.0.0" @@ -736,6 +741,27 @@ "node": ">= 10" } }, + "node_modules/@louislam/sqlite3": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/@louislam/sqlite3/-/sqlite3-5.0.6.tgz", + "integrity": "sha512-uitL0jdbki5XSrmGKGgvHVMHEe00O6GAMoPrVOnh4KTcFOJ1T8SWypbnyqSxBr7PrjAVfgnIGu3kzYCCqIxd4g==", + "hasInstallScript": true, + "dependencies": { + "@mapbox/node-pre-gyp": "^1.0.0", + "node-addon-api": "^3.0.0" + }, + "optionalDependencies": { + "node-gyp": "^7.1.2" + }, + "peerDependencies": { + "node-gyp": "7.x" + }, + "peerDependenciesMeta": { + "node-gyp": { + "optional": true + } + } + }, "node_modules/@mapbox/node-pre-gyp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.5.tgz", @@ -874,9 +900,9 @@ } }, "node_modules/@types/bootstrap": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/@types/bootstrap/-/bootstrap-5.1.4.tgz", - "integrity": "sha512-VAY+o6sCKrJ7Xix/lugdvQz0PpOn7Go+fQzCXOZvIdp7E/TDaiJddInVhNB/84bk9NX6uuKFSfl2pqslNYH9aA==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/@types/bootstrap/-/bootstrap-5.1.6.tgz", + "integrity": "sha512-3L6IvOCKyoVd3e4bgQTH7VBPbuYEOG8IQbRcuZ0AbjfwPdRX+kVf5L/7mVt1EVM+D/BVw4+71rtp7Z8yYROlpQ==", "dev": true, "dependencies": { "@popperjs/core": "^2.9.2", @@ -922,12 +948,6 @@ "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz", "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==" }, - "node_modules/@types/estree": { - "version": "0.0.48", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.48.tgz", - "integrity": "sha512-LfZwXoGUDo0C3me81HXgkBg5CTQYb6xzEl+fNmbO4JdRiSKQ8A0GD1OBBvKAIsbCUgoyAty7m99GqqMQe784ew==", - "dev": true - }, "node_modules/@types/express": { "version": "4.17.13", "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", @@ -1017,9 +1037,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "16.7.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.10.tgz", - "integrity": "sha512-S63Dlv4zIPb8x6MMTgDq5WWRJQe56iBEY0O3SOFA9JrRienkOVDXSXBjjJw6HTNQYSE2JI6GMCR6LVbIMHJVvA==" + "version": "16.9.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz", + "integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==" }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", @@ -1065,9 +1085,9 @@ "dev": true }, "node_modules/@vitejs/plugin-legacy": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-legacy/-/plugin-legacy-1.5.2.tgz", - "integrity": "sha512-b1CaWY/wi7gQZnZaxH+ujPTPb91bEPgnnk7l0WIwxoQtW5UC5MQywRcAbFX+Ise62exXctOMBtsnXKJw2KajXw==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-legacy/-/plugin-legacy-1.5.3.tgz", + "integrity": "sha512-/b2x6dU+BbdW7C7KWxh9kMrVzv1JlUi1ucPQpSzWUUUVJjihbG+GRlpqcvfQ0p/TnAKl2d/VecbTLByVJJHORg==", "dev": true, "dependencies": { "@babel/standalone": "^7.14.9", @@ -1084,123 +1104,189 @@ } }, "node_modules/@vitejs/plugin-vue": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-1.6.0.tgz", - "integrity": "sha512-n3i8htn8pTg9M+kM3cnEfsPZx/6ngInlTroth6fA1LQTJq5aTVQ8ggaE5pPoAy9vCgHPtcaXMzwpldhqRAkebQ==", + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-1.9.1.tgz", + "integrity": "sha512-9YuxaU2nLoSS/S1Ep4QTG/pEIh96LlauNM1g7LN/EOJ14Nj8HBeSy1OL26ydxb+MPhKn5XKGARh5wQF0UjHbLw==", "dev": true, "engines": { "node": ">=12.0.0" }, "peerDependencies": { - "@vue/compiler-sfc": "^3.2.6" + "vite": "^2.5.10" } }, "node_modules/@vue/compiler-core": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.8.tgz", - "integrity": "sha512-Sx8qJ030+QM/NakUrkQuUGCeDEb+0d0AgFOl5W4qRvR6e+YgLnW2ew0jREf4T1hak9Fdk8Edl67StECHrhEuew==", + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.11.tgz", + "integrity": "sha512-bcbsLx5XyQg8WDDEGwmpX0BfEfv82wIs9fWFelpyVhNRGMaABvUTalYINyfhVT+jOqNaD4JBhJiVKd/8TmsHWg==", "dependencies": { "@babel/parser": "^7.15.0", "@babel/types": "^7.15.0", - "@vue/shared": "3.2.8", + "@vue/shared": "3.2.11", "estree-walker": "^2.0.2", "source-map": "^0.6.1" } }, "node_modules/@vue/compiler-dom": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.8.tgz", - "integrity": "sha512-nxBW6k8FMWQ74294CRbqR+iEJRO5vIjx85I3YCOyZFD6FsDHyFL60g76TcJzucp+F2XXIDaYz+A+F4gQlDatjw==", + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.11.tgz", + "integrity": "sha512-DNvhUHI/1Hn0/+ZYDYGAuDGasUm+XHKC3FE4GqkNCTO/fcLaJMRg/7eT1m1lkc7jPffUwwfh1rZru5mwzOjrNw==", "dependencies": { - "@vue/compiler-core": "3.2.8", - "@vue/shared": "3.2.8" + "@vue/compiler-core": "3.2.11", + "@vue/shared": "3.2.11" } }, "node_modules/@vue/compiler-sfc": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.8.tgz", - "integrity": "sha512-XClueQAXoWtN2EToKgfYH9FCL70Ac4bxx6OZFZzxYSg1bei8IB9srJP1UOfnJb2IpnM1heikAz1dp1HI1wHcyQ==", + "version": "3.2.16", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.16.tgz", + "integrity": "sha512-AxaDDg0ZjY7lCoVnCq7V+K3SIEfhyIHtten7k/LRupVC/VzSbelBmW0J8bawgsjLJAfTsdWZjeezZ5JJp2DM/A==", "dev": true, "dependencies": { "@babel/parser": "^7.15.0", - "@babel/types": "^7.15.0", - "@types/estree": "^0.0.48", - "@vue/compiler-core": "3.2.8", - "@vue/compiler-dom": "3.2.8", - "@vue/compiler-ssr": "3.2.8", - "@vue/ref-transform": "3.2.8", - "@vue/shared": "3.2.8", - "consolidate": "^0.16.0", + "@vue/compiler-core": "3.2.16", + "@vue/compiler-dom": "3.2.16", + "@vue/compiler-ssr": "3.2.16", + "@vue/ref-transform": "3.2.16", + "@vue/shared": "3.2.16", "estree-walker": "^2.0.2", - "hash-sum": "^2.0.0", - "lru-cache": "^5.1.1", "magic-string": "^0.25.7", - "merge-source-map": "^1.1.0", "postcss": "^8.1.10", - "postcss-modules": "^4.0.0", - "postcss-selector-parser": "^6.0.4", "source-map": "^0.6.1" } }, + "node_modules/@vue/compiler-sfc/node_modules/@vue/compiler-core": { + "version": "3.2.16", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.16.tgz", + "integrity": "sha512-60LD3f1GpMtoCPWKP7HacFxv97/EUY8m4WNqfFYmfaILVGO0icojdOCYOfgGFiYC+kgk1MOVdiI4vrWci0CnhQ==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.15.0", + "@vue/shared": "3.2.16", + "estree-walker": "^2.0.2", + "source-map": "^0.6.1" + } + }, + "node_modules/@vue/compiler-sfc/node_modules/@vue/compiler-dom": { + "version": "3.2.16", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.16.tgz", + "integrity": "sha512-K7lYfwvsp5OLb0+/rKI9XT2RJy2RB7TyJBjvlfCDAF0KOJGqWAx++DLJPm+F3D29Mhxgt6ozSKP+rC3dSabvYA==", + "dev": true, + "dependencies": { + "@vue/compiler-core": "3.2.16", + "@vue/shared": "3.2.16" + } + }, + "node_modules/@vue/compiler-sfc/node_modules/@vue/shared": { + "version": "3.2.16", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.16.tgz", + "integrity": "sha512-zpv8lxuatl3ruCJCsGzrO/F4+IlLug4jbu3vaIi/wJVZKQgnsW1R/xSRJMQS6K57cl4fT/2zkrYsWh1/6H7Esw==", + "dev": true + }, "node_modules/@vue/compiler-ssr": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.8.tgz", - "integrity": "sha512-QqyiFRiIl55W0abDNQ6cNG/7iIfBHmbXVtssUAjX3IlI87ELeT0xackmrCyTSnfIX12ixljg9AN0COIZwlvt5A==", + "version": "3.2.16", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.16.tgz", + "integrity": "sha512-u2Inuqp3QpEV3E03ppBLdba40mU0dz/fisbfGjRPlxH5uuQ9v9i5qgrFl7xZ+N5C0ugg5+5KI7MgsbsCAPn0mQ==", "dev": true, "dependencies": { - "@vue/compiler-dom": "3.2.8", - "@vue/shared": "3.2.8" + "@vue/compiler-dom": "3.2.16", + "@vue/shared": "3.2.16" } }, + "node_modules/@vue/compiler-ssr/node_modules/@vue/compiler-core": { + "version": "3.2.16", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.16.tgz", + "integrity": "sha512-60LD3f1GpMtoCPWKP7HacFxv97/EUY8m4WNqfFYmfaILVGO0icojdOCYOfgGFiYC+kgk1MOVdiI4vrWci0CnhQ==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.15.0", + "@vue/shared": "3.2.16", + "estree-walker": "^2.0.2", + "source-map": "^0.6.1" + } + }, + "node_modules/@vue/compiler-ssr/node_modules/@vue/compiler-dom": { + "version": "3.2.16", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.16.tgz", + "integrity": "sha512-K7lYfwvsp5OLb0+/rKI9XT2RJy2RB7TyJBjvlfCDAF0KOJGqWAx++DLJPm+F3D29Mhxgt6ozSKP+rC3dSabvYA==", + "dev": true, + "dependencies": { + "@vue/compiler-core": "3.2.16", + "@vue/shared": "3.2.16" + } + }, + "node_modules/@vue/compiler-ssr/node_modules/@vue/shared": { + "version": "3.2.16", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.16.tgz", + "integrity": "sha512-zpv8lxuatl3ruCJCsGzrO/F4+IlLug4jbu3vaIi/wJVZKQgnsW1R/xSRJMQS6K57cl4fT/2zkrYsWh1/6H7Esw==", + "dev": true + }, "node_modules/@vue/devtools-api": { "version": "6.0.0-beta.15", "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.0.0-beta.15.tgz", "integrity": "sha512-quBx4Jjpexo6KDiNUGFr/zF/2A4srKM9S9v2uHgMXSU//hjgq1eGzqkIFql8T9gfX5ZaVOUzYBP3jIdIR3PKIA==" }, "node_modules/@vue/reactivity": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.8.tgz", - "integrity": "sha512-/Hj3Uz28SG+xB5SDWPOXUs0emvHkq82EmTgk44/plTVFeswCZ3i3Hd7WmsrPT4rGajlDKd5uqMmW0ith1ED0FA==", + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.11.tgz", + "integrity": "sha512-hEQstxPQbgGZq5qApzrvbDmRdK1KP96O/j4XrwT8fVkT1ytkFs4fH2xNEh9QKwXfybbQkLs77W7OfXCv5o6qbA==", "dependencies": { - "@vue/shared": "3.2.8" + "@vue/shared": "3.2.11" } }, "node_modules/@vue/ref-transform": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/@vue/ref-transform/-/ref-transform-3.2.8.tgz", - "integrity": "sha512-9LdADd4JM3klt+b2qNT8a7b7JvBETNBy2Btv5rDzyPrAVS4Vrw+1WWay6gZBgnxfJ9TPSvG8f/9zu6gNGHmJLA==", + "version": "3.2.16", + "resolved": "https://registry.npmjs.org/@vue/ref-transform/-/ref-transform-3.2.16.tgz", + "integrity": "sha512-IXFgxGnyd5jIXPQ/QlOoz+daeikeR1AA6DujgqalmW/ndCX9ZKW1rhFsoMGR0WAUZ4VHbT3eluUJhBF8ikNzPg==", "dev": true, "dependencies": { "@babel/parser": "^7.15.0", - "@vue/compiler-core": "3.2.8", - "@vue/shared": "3.2.8", + "@vue/compiler-core": "3.2.16", + "@vue/shared": "3.2.16", "estree-walker": "^2.0.2", "magic-string": "^0.25.7" } }, + "node_modules/@vue/ref-transform/node_modules/@vue/compiler-core": { + "version": "3.2.16", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.16.tgz", + "integrity": "sha512-60LD3f1GpMtoCPWKP7HacFxv97/EUY8m4WNqfFYmfaILVGO0icojdOCYOfgGFiYC+kgk1MOVdiI4vrWci0CnhQ==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.15.0", + "@vue/shared": "3.2.16", + "estree-walker": "^2.0.2", + "source-map": "^0.6.1" + } + }, + "node_modules/@vue/ref-transform/node_modules/@vue/shared": { + "version": "3.2.16", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.16.tgz", + "integrity": "sha512-zpv8lxuatl3ruCJCsGzrO/F4+IlLug4jbu3vaIi/wJVZKQgnsW1R/xSRJMQS6K57cl4fT/2zkrYsWh1/6H7Esw==", + "dev": true + }, "node_modules/@vue/runtime-core": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.2.8.tgz", - "integrity": "sha512-hwzXLGw1njBEY5JSyRXIIdCtzMFFF6F38WcKMmoIE3p7da30jEbWt8EwwrBomjT8ZbqzElOGlewBcnXNOiiIUg==", + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.2.11.tgz", + "integrity": "sha512-horlxjWwSvModC87WdsWswzzHE5IexmKkQA65S5vFgP5hLUBW+HRyScDeuB/RRcFmqnf+ozacNCfap0kqcpODw==", "dependencies": { - "@vue/reactivity": "3.2.8", - "@vue/shared": "3.2.8" + "@vue/reactivity": "3.2.11", + "@vue/shared": "3.2.11" } }, "node_modules/@vue/runtime-dom": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.2.8.tgz", - "integrity": "sha512-A/aRrlGLJ5y4Z7eNbnO/xHwx2RiPijQo7D3OIwESroG3HNP+dpuoqamajo5TXS9ZGjbMOih82COoe7xb9P4BZw==", + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.2.11.tgz", + "integrity": "sha512-cOK1g0INdiCbds2xrrJKrrN+pDHuLz6esUs/crdEiupDuX7IeiMbdqrAQCkYHp5P1KLWcbGlkmwfVD7HQGii0Q==", "dependencies": { - "@vue/runtime-core": "3.2.8", - "@vue/shared": "3.2.8", + "@vue/runtime-core": "3.2.11", + "@vue/shared": "3.2.11", "csstype": "^2.6.8" } }, "node_modules/@vue/shared": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.8.tgz", - "integrity": "sha512-E2DQQnG7Qr4GwTs3GlfPPlHliGVADoufTnhpwfoViw7JlyLMmYtjfnTwM6nXAwvSJWiF7D+7AxpnWBBT3VWo6Q==" + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.11.tgz", + "integrity": "sha512-ovfXAsSsCvV9JVceWjkqC/7OF5HbgLOtCWjCIosmPGG8lxbPuavhIxRH1dTx4Dg9xLgRTNLvI3pVxG4ItQZekg==" }, "node_modules/abbrev": { "version": "1.1.1", @@ -1277,9 +1363,9 @@ } }, "node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "engines": { "node": ">=8" @@ -1540,11 +1626,11 @@ "optional": true }, "node_modules/axios": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", - "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", "dependencies": { - "follow-redirects": "^1.10.0" + "follow-redirects": "^1.14.0" } }, "node_modules/babel-plugin-add-module-exports": { @@ -1552,6 +1638,27 @@ "resolved": "https://registry.npmjs.org/babel-plugin-add-module-exports/-/babel-plugin-add-module-exports-0.2.1.tgz", "integrity": "sha1-mumh9KjcZ/DN7E9K7aHkOl/2XiU=" }, + "node_modules/babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "dependencies": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + } + }, + "node_modules/babel-runtime/node_modules/core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "deprecated": "core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.", + "hasInstallScript": true + }, + "node_modules/babel-runtime/node_modules/regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + }, "node_modules/backo2": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", @@ -1632,15 +1739,6 @@ "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz", "integrity": "sha1-mrVie5PmBiH/fNrF2pczAn3x0Ms=" }, - "node_modules/big.js": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", - "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", - "dev": true, - "engines": { - "node": "*" - } - }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -1655,12 +1753,6 @@ "resolved": "https://registry.npmjs.org/bintrees/-/bintrees-1.0.1.tgz", "integrity": "sha1-DmVcm5wkNeqraL9AJyJtK1WjRSQ=" }, - "node_modules/bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true - }, "node_modules/body-parser": { "version": "1.19.0", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", @@ -1695,15 +1787,15 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, "node_modules/bootstrap": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.0.tgz", - "integrity": "sha512-bs74WNI9BgBo3cEovmdMHikSKoXnDgA6VQjJ7TyTotU6L7d41ZyCEEelPwkYEzsG/Zjv3ie9IE3EMAje0W9Xew==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.1.tgz", + "integrity": "sha512-/jUa4sSuDZWlDLQ1gwQQR8uoYSvLJzDd8m5o6bPKh3asLAMYVZKdRCjb1joUd5WXf0WwCNzd2EjwQQhupou0dA==", "funding": { "type": "opencollective", "url": "https://opencollective.com/bootstrap" }, "peerDependencies": { - "@popperjs/core": "^2.9.3" + "@popperjs/core": "^2.10.1" } }, "node_modules/brace-expansion": { @@ -1728,14 +1820,14 @@ } }, "node_modules/browserslist": { - "version": "4.16.8", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.8.tgz", - "integrity": "sha512-sc2m9ohR/49sWEbPj14ZSSZqp+kbi16aLao42Hmn3Z8FpjuMaq2xCA2l4zl9ITfyzvnvyE0hcg62YkIGKxgaNQ==", + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.17.0.tgz", + "integrity": "sha512-g2BJ2a0nEYvEFQC208q8mVAhfNwpZ5Mu8BwgtCdZKO3qx98HChmeg448fPdUzld8aFmfLgVh7yymqV+q1lJZ5g==", "dev": true, "dependencies": { - "caniuse-lite": "^1.0.30001251", + "caniuse-lite": "^1.0.30001254", "colorette": "^1.3.0", - "electron-to-chromium": "^1.3.811", + "electron-to-chromium": "^1.3.830", "escalade": "^3.1.1", "node-releases": "^1.1.75" }, @@ -1845,9 +1937,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001252", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001252.tgz", - "integrity": "sha512-I56jhWDGMtdILQORdusxBOH+Nl/KgQSdDmpJezYddnAkVOmnoU8zwjTV9xAjMIYxr0iPreEAVylCGcmHCjfaOw==", + "version": "1.0.30001257", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001257.tgz", + "integrity": "sha512-JN49KplOgHSXpIsVSF+LUyhD8PUp6xPpAXeRrrcBh4KBeP7W864jHn6RvzJgDlrReyeVjMFJL3PLpPvKIxlIHA==", "dev": true, "funding": { "type": "opencollective", @@ -1967,11 +2059,6 @@ "node": ">=6" } }, - "node_modules/cliui/node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" - }, "node_modules/cliui/node_modules/is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", @@ -2043,9 +2130,9 @@ "dev": true }, "node_modules/colorette": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.3.0.tgz", - "integrity": "sha512-ecORCqbSFP7Wm8Y6lyqMJjexBQqXSF7SSeaTyGGphogUjBlFP9m9o08wy86HL2uB7fMTxtOUzLMk7ogKcxMg1w==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz", + "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==", "dev": true }, "node_modules/combined-stream": { @@ -2092,18 +2179,6 @@ "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" }, - "node_modules/consolidate": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/consolidate/-/consolidate-0.16.0.tgz", - "integrity": "sha512-Nhl1wzCslqXYTJVDyJCu3ODohy9OfBMB5uD2BiBTzd7w+QY0lBzafkR8y8755yMYHAaMD4NuzbAw03/xzfw+eQ==", - "dev": true, - "dependencies": { - "bluebird": "^3.7.2" - }, - "engines": { - "node": ">= 0.10.0" - } - }, "node_modules/content-disposition": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", @@ -2146,9 +2221,9 @@ "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" }, "node_modules/core-js": { - "version": "3.17.2", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.17.2.tgz", - "integrity": "sha512-XkbXqhcXeMHPRk2ItS+zQYliAMilea2euoMsnpRRdDad6b2VY6CQQcwz1K8AnWesfw4p165RzY0bTnr3UrbYiA==", + "version": "3.18.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.18.0.tgz", + "integrity": "sha512-WJeQqq6jOYgVgg4NrXKL0KLQhi0CT4ZOCvFL+3CQ5o7I6J8HkT5wd53EadMfqTDp1so/MT1J+w2ujhWcCJtN7w==", "dev": true, "hasInstallScript": true, "funding": { @@ -2189,6 +2264,24 @@ "node": ">=10" } }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -2216,9 +2309,9 @@ } }, "node_modules/csstype": { - "version": "2.6.17", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.17.tgz", - "integrity": "sha512-u1wmTI1jJGzCJzWndZo8mk4wnPTZd1eOIYTYvuEyOQGfmDl3TrabCCfKnOC86FZwW/9djqTl933UF/cS425i9A==" + "version": "2.6.18", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.18.tgz", + "integrity": "sha512-RSU6Hyeg14am3Ah4VZEmeX8H7kLwEEirXe6aU2IPfKNvhXwTflK5HQRDNI0ypQXoqmm+QPyG2IaPuQE5zMwSIQ==" }, "node_modules/dashdash": { "version": "1.14.1", @@ -2233,9 +2326,9 @@ } }, "node_modules/dayjs": { - "version": "1.10.6", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.10.6.tgz", - "integrity": "sha512-AztC/IOW4L1Q41A86phW5Thhcrco3xuAA+YX/BLpLWWjRcTj5TOt/QImBLmCKlrF7u7k47arTnOyL6GnbG8Hvw==" + "version": "1.10.7", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.10.7.tgz", + "integrity": "sha512-P6twpd70BcPK34K26uJ1KT3wlhpuOAPoMwJzpsIWUxHZ7wpmbdZL/hQqBDfz7hGurYSa5PhzdhDHtt319hL3ig==" }, "node_modules/debug": { "version": "4.3.2", @@ -2284,9 +2377,9 @@ } }, "node_modules/deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, "node_modules/delayed-stream": { @@ -2441,25 +2534,15 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "node_modules/electron-to-chromium": { - "version": "1.3.830", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.830.tgz", - "integrity": "sha512-gBN7wNAxV5vl1430dG+XRcQhD4pIeYeak6p6rjdCtlz5wWNwDad8jwvphe5oi1chL5MV6RNRikfffBBiFuj+rQ==", + "version": "1.3.840", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.840.tgz", + "integrity": "sha512-yRoUmTLDJnkIJx23xLY7GbSvnmDCq++NSuxHDQ0jiyDJ9YZBUGJcrdUqm+ZwZFzMbCciVzfem2N2AWiHJcWlbw==", "dev": true }, "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/emojis-list": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", - "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", - "dev": true, - "engines": { - "node": ">= 4" - } + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" }, "node_modules/encodeurl": { "version": "1.0.2", @@ -2559,9 +2642,9 @@ } }, "node_modules/esbuild": { - "version": "0.12.25", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.12.25.tgz", - "integrity": "sha512-woie0PosbRSoN8gQytrdCzUbS2ByKgO8nD1xCZkEup3D9q92miCze4PqEI9TZDYAuwn6CruEnQpJxgTRWdooAg==", + "version": "0.12.28", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.12.28.tgz", + "integrity": "sha512-pZ0FrWZXlvQOATlp14lRSk1N9GkeJ3vLIwOcUoo3ICQn9WNR4rWoNi81pbn6sC1iYUy7QPqNzI3+AEzokwyVcA==", "dev": true, "hasInstallScript": true, "bin": { @@ -2651,9 +2734,9 @@ } }, "node_modules/eslint-plugin-vue": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-7.17.0.tgz", - "integrity": "sha512-Rq5R2QetDCgC+kBFQw1+aJ5B93tQ4xqZvoCUxuIzwTonngNArsdP8ChM8PowIzsJvRtWl4ltGh/bZcN3xhFWSw==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-7.18.0.tgz", + "integrity": "sha512-ceDXlXYMMPMSXw7tdKUR42w9jlzthJGJ3Kvm3YrZ0zuQfvAySNxe8sm6VHuksBW0+060GzYXhHJG6IHVOfF83Q==", "dev": true, "dependencies": { "eslint-utils": "^2.1.0", @@ -2993,9 +3076,9 @@ "dev": true }, "node_modules/fastq": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.12.0.tgz", - "integrity": "sha512-VNX0QkHK3RsXVKr9KrlUv/FoTa0NdbYoHHl7uXHv2rzyHSlxjdNAKug2twd9luJxpcyNeAgf5iPPMutJO67Dfg==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", "dev": true, "dependencies": { "reusify": "^1.0.4" @@ -3088,9 +3171,9 @@ "dev": true }, "node_modules/follow-redirects": { - "version": "1.14.3", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.3.tgz", - "integrity": "sha512-3MkHxknWMUtb23apkgz/83fDoe+y+qr0TdgacGIA7bew+QLBo3vdgEN2xEsuXNivpFy4CyDhBBZnNZOtalmenw==", + "version": "1.14.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz", + "integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==", "funding": [ { "type": "individual", @@ -3219,15 +3302,6 @@ "node": ">=0.10.0" } }, - "node_modules/generic-names": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/generic-names/-/generic-names-2.0.1.tgz", - "integrity": "sha512-kPCHWa1m9wGG/OwQpeweTwM/PYiQLrUIxXbt/P4Nic3LbGjCP0YwrALHW1uNLKZ0LIMg+RF+XRlj2ekT9ZlZAQ==", - "dev": true, - "dependencies": { - "loader-utils": "^1.1.0" - } - }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -3473,12 +3547,6 @@ "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" }, - "node_modules/hash-sum": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-2.0.0.tgz", - "integrity": "sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg==", - "dev": true - }, "node_modules/hosted-git-info": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.0.2.tgz", @@ -3610,24 +3678,6 @@ "node": ">=0.10.0" } }, - "node_modules/icss-replace-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz", - "integrity": "sha1-Bupvg2ead0njhs/h/oEq5dsiPe0=", - "dev": true - }, - "node_modules/icss-utils": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", - "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==", - "dev": true, - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, "node_modules/ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -3909,9 +3959,9 @@ } }, "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" }, "node_modules/isexe": { "version": "2.0.0", @@ -3992,18 +4042,6 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", "optional": true }, - "node_modules/json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "dev": true, - "dependencies": { - "minimist": "^1.2.0" - }, - "bin": { - "json5": "lib/cli.js" - } - }, "node_modules/jsonwebtoken": { "version": "8.5.1", "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", @@ -4157,20 +4195,6 @@ "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", "dev": true }, - "node_modules/loader-utils": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", - "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", - "dev": true, - "dependencies": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^1.0.1" - }, - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -4188,12 +4212,6 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, - "node_modules/lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=", - "dev": true - }, "node_modules/lodash.clonedeep": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", @@ -4278,15 +4296,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "dependencies": { - "yallist": "^3.0.2" - } - }, "node_modules/magic-string": { "version": "0.25.7", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", @@ -4433,15 +4442,6 @@ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" }, - "node_modules/merge-source-map": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz", - "integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==", - "dev": true, - "dependencies": { - "source-map": "^0.6.1" - } - }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -4563,9 +4563,9 @@ } }, "node_modules/minipass": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.3.tgz", - "integrity": "sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.5.tgz", + "integrity": "sha512-+8NzxD82XQoNKNrl1d/FSi+X8wAEWR+sbYAfIvub4Nz0d22plFG72CEVVaufV8PNf4qSslFTD8VMOxNVhHCjTw==", "dependencies": { "yallist": "^4.0.0" }, @@ -4642,9 +4642,9 @@ "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==" }, "node_modules/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz", + "integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA==", "engines": { "node": "4.x || >=6.0.0" } @@ -4713,9 +4713,9 @@ "dev": true }, "node_modules/nodemailer": { - "version": "6.6.3", - "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.6.3.tgz", - "integrity": "sha512-faZFufgTMrphYoDjvyVpbpJcYzwyFnbAMmQtj1lVBYAUSm3SOy2fIdd9+Mr4UxPosBa0JRw9bJoIwQn+nswiew==", + "version": "6.6.5", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.6.5.tgz", + "integrity": "sha512-C/v856DBijUzHcHIgGpQoTrfsH3suKIRAGliIzCstatM2cAa+MYX3LuyCrABiO/cdJTxgBBHXxV1ztiqUwst5A==", "engines": { "node": ">=6.0.0" } @@ -5237,84 +5237,6 @@ "integrity": "sha1-J7Ocb02U+Bsac7j3Y1HGCeXO8kQ=", "dev": true }, - "node_modules/postcss-modules": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/postcss-modules/-/postcss-modules-4.2.2.tgz", - "integrity": "sha512-/H08MGEmaalv/OU8j6bUKi/kZr2kqGF6huAW8m9UAgOLWtpFdhA14+gPBoymtqyv+D4MLsmqaF2zvIegdCxJXg==", - "dev": true, - "dependencies": { - "generic-names": "^2.0.1", - "icss-replace-symbols": "^1.1.0", - "lodash.camelcase": "^4.3.0", - "postcss-modules-extract-imports": "^3.0.0", - "postcss-modules-local-by-default": "^4.0.0", - "postcss-modules-scope": "^3.0.0", - "postcss-modules-values": "^4.0.0", - "string-hash": "^1.1.1" - }, - "peerDependencies": { - "postcss": "^8.0.0" - } - }, - "node_modules/postcss-modules-extract-imports": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz", - "integrity": "sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==", - "dev": true, - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/postcss-modules-local-by-default": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.0.tgz", - "integrity": "sha512-sT7ihtmGSF9yhm6ggikHdV0hlziDTX7oFoXtuVWeDd3hHObNkcHRo9V3yg7vCAY7cONyxJC/XXCmmiHHcvX7bQ==", - "dev": true, - "dependencies": { - "icss-utils": "^5.0.0", - "postcss-selector-parser": "^6.0.2", - "postcss-value-parser": "^4.1.0" - }, - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/postcss-modules-scope": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-3.0.0.tgz", - "integrity": "sha512-hncihwFA2yPath8oZ15PZqvWGkWf+XUfQgUGamS4LqoP1anQLOsOJw0vr7J7IwLpoY9fatA2qiGUGmuZL0Iqlg==", - "dev": true, - "dependencies": { - "postcss-selector-parser": "^6.0.4" - }, - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/postcss-modules-values": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz", - "integrity": "sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==", - "dev": true, - "dependencies": { - "icss-utils": "^5.0.0" - }, - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, "node_modules/postcss-resolve-nested-selector": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.1.tgz", @@ -5791,11 +5713,6 @@ "node": ">=4" } }, - "node_modules/qrcode/node_modules/isarray": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" - }, "node_modules/qs": { "version": "6.7.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", @@ -5946,6 +5863,11 @@ "util-deprecate": "~1.0.1" } }, + "node_modules/readable-stream/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -5983,9 +5905,9 @@ } }, "node_modules/redbean-node/node_modules/@types/node": { - "version": "14.17.14", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.14.tgz", - "integrity": "sha512-rsAj2u8Xkqfc332iXV12SqIsjVi07H479bOP4q94NAcjzmAvapumEhuVIt53koEf7JFrpjgNKjBga5Pnn/GL8A==" + "version": "14.17.16", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.16.tgz", + "integrity": "sha512-WiFf2izl01P1CpeY8WqFAeKWwByMueBEkND38EcN8N68qb0aDG3oIS1P5MhAX5kUdr469qRyqsY/MjanLjsFbQ==" }, "node_modules/redent": { "version": "3.0.0", @@ -6239,9 +6161,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/sass": { - "version": "1.39.0", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.39.0.tgz", - "integrity": "sha512-F4o+RhJkNOIG0b6QudYU8c78ZADKZjKDk5cyrf8XTKWfrgbtyVVXImFstJrc+1pkQDCggyidIOytq6gS4gCCZg==", + "version": "1.42.1", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.42.1.tgz", + "integrity": "sha512-/zvGoN8B7dspKc5mC6HlaygyCBRvnyzzgD5khiaCfglWztY99cYoiTUksVx11NlnemrcfH5CEaCpsUKoW0cQqg==", "dev": true, "dependencies": { "chokidar": ">=3.0.0 <4.0.0" @@ -6348,9 +6270,9 @@ } }, "node_modules/signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.4.tgz", + "integrity": "sha512-rqYhcAnZ6d/vTPGghdrw7iumdcbXpsk1b8IG/rz+VWV51DM0p7XCtMoJ3qhPLIbp3tvyt3pKRbaaEMZYpHto8Q==" }, "node_modules/slash": { "version": "3.0.0", @@ -6441,6 +6363,11 @@ "node": ">=10.0.0" } }, + "node_modules/sortablejs": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.14.0.tgz", + "integrity": "sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w==" + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -6511,27 +6438,6 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, - "node_modules/sqlite3": { - "version": "5.0.2", - "resolved": "git+ssh://git@github.com/mapbox/node-sqlite3.git#593c9d498be2510d286349134537e3bf89401c4a", - "hasInstallScript": true, - "license": "BSD-3-Clause", - "dependencies": { - "@mapbox/node-pre-gyp": "^1.0.0", - "node-addon-api": "^3.0.0" - }, - "optionalDependencies": { - "node-gyp": "7.x" - }, - "peerDependencies": { - "node-gyp": "7.x" - }, - "peerDependenciesMeta": { - "node-gyp": { - "optional": true - } - } - }, "node_modules/sshpk": { "version": "1.16.1", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", @@ -6573,12 +6479,6 @@ "safe-buffer": "~5.1.0" } }, - "node_modules/string-hash": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/string-hash/-/string-hash-1.1.3.tgz", - "integrity": "sha1-6Kr8CsGFW0Zmkp7X3RJ1311sgRs=", - "dev": true - }, "node_modules/string-width": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", @@ -6773,6 +6673,12 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "node_modules/stylelint/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, "node_modules/stylelint/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -7040,9 +6946,9 @@ } }, "node_modules/table/node_modules/ajv": { - "version": "8.6.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.2.tgz", - "integrity": "sha512-9807RlWAgT564wT+DjeyU5OFMPjmzxVobvDFmNAhY+5zD6A2ly3jDp6sgnfyDtlIQ+7H97oc/DGCzzfu9rjw9w==", + "version": "8.6.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.3.tgz", + "integrity": "sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw==", "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", @@ -7055,6 +6961,12 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/table/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, "node_modules/table/node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -7148,6 +7060,11 @@ "node": ">=8" } }, + "node_modules/timezones-list": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/timezones-list/-/timezones-list-3.0.1.tgz", + "integrity": "sha512-yfOzyuVwzgD0LkldD3Epkr+JUdUIxEUL147Fa6ZgG/23KU28iOv3e3M7vQOCFMPyopAhDX7dqOLWttIP7tkTKg==" + }, "node_modules/to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -7277,9 +7194,9 @@ } }, "node_modules/typescript": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.2.tgz", - "integrity": "sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz", + "integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -7477,9 +7394,9 @@ } }, "node_modules/vite": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/vite/-/vite-2.5.3.tgz", - "integrity": "sha512-1wMDnjflvtTTkMov8O/Xb5+w1/VW/Gw8oCf8f6dqgHn8lMOEqq0SaPtFEQeikFcOKCfSbiU0nEi0LDIx6DNsaQ==", + "version": "2.5.10", + "resolved": "https://registry.npmjs.org/vite/-/vite-2.5.10.tgz", + "integrity": "sha512-0ObiHTi5AHyXdJcvZ67HMsDgVpjT5RehvVKv6+Q0jFZ7zDI28PF5zK9mYz2avxdA+4iJMdwCz6wnGNnn4WX5Gg==", "dev": true, "dependencies": { "esbuild": "^0.12.17", @@ -7498,13 +7415,13 @@ } }, "node_modules/vue": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.2.8.tgz", - "integrity": "sha512-x7lwdnOSkceHQUXRVVHBaZzcp6v7M2CYtSZH75zZaT1mTjB4plC4KZHKP/5jAvdqOLBHZGwDSMkWXm3YbAufrA==", + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.2.11.tgz", + "integrity": "sha512-JkI3/eIgfk4E0f/p319TD3EZgOwBQfftgnkRsXlT7OrRyyiyoyUXn6embPGZXSBxD3LoZ9SWhJoxLhFh5AleeA==", "dependencies": { - "@vue/compiler-dom": "3.2.8", - "@vue/runtime-dom": "3.2.8", - "@vue/shared": "3.2.8" + "@vue/compiler-dom": "3.2.11", + "@vue/runtime-dom": "3.2.11", + "@vue/shared": "3.2.11" } }, "node_modules/vue-chart-3": { @@ -7538,6 +7455,14 @@ "vue": "^2.6.10" } }, + "node_modules/vue-contenteditable": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/vue-contenteditable/-/vue-contenteditable-3.0.4.tgz", + "integrity": "sha512-CmtqT4zHQwLoJEyNVaXUjjUFPUVYlXXBHfSbRCHCUjODMqrn6L293LM1nc1ELx8epitZZvecTfIqOLlSzB3d+w==", + "peerDependencies": { + "vue": "^3.0.0" + } + }, "node_modules/vue-demi": { "version": "0.10.1", "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.10.1.tgz", @@ -7561,9 +7486,9 @@ } }, "node_modules/vue-eslint-parser": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-7.10.0.tgz", - "integrity": "sha512-7tc/ewS9Vq9Bn741pvpg8op2fWJPH3k32aL+jcIcWGCTzh/zXSdh7pZ5FV3W2aJancP9+ftPAv292zY5T5IPCg==", + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-7.11.0.tgz", + "integrity": "sha512-qh3VhDLeh773wjgNTl7ss0VejY9bMMa0GoDG2fQVyDzRFdiU3L7fw74tWZDHNQXdZqxO3EveQroa9ct39D2nqg==", "dev": true, "dependencies": { "debug": "^4.1.1", @@ -7624,6 +7549,14 @@ "vue": "^3.0.0" } }, + "node_modules/vue-image-crop-upload": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/vue-image-crop-upload/-/vue-image-crop-upload-3.0.3.tgz", + "integrity": "sha512-VeBsU0oI1hXeCvdpnu19DM/r3KTlI8SUXTxsHsU4MhDXR0ahRziiL9tf4FbILGx+gRVNZhGbl32yuM6TiaGNhA==", + "dependencies": { + "babel-runtime": "^6.11.6" + } + }, "node_modules/vue-multiselect": { "version": "3.0.0-alpha.2", "resolved": "https://registry.npmjs.org/vue-multiselect/-/vue-multiselect-3.0.0-alpha.2.tgz", @@ -7696,6 +7629,17 @@ "vue": "^3.0.2" } }, + "node_modules/vuedraggable": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/vuedraggable/-/vuedraggable-4.1.0.tgz", + "integrity": "sha512-FU5HCWBmsf20GpP3eudURW3WdWTKIbEIQxh9/8GE806hydR9qZqRRxRE3RjqX7PkuLuMQG/A7n3cfj9rCEchww==", + "dependencies": { + "sortablejs": "1.14.0" + }, + "peerDependencies": { + "vue": "^3.0.1" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -7778,11 +7722,6 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, - "node_modules/wrap-ansi/node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" - }, "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", @@ -7865,12 +7804,6 @@ "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" }, - "node_modules/yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true - }, "node_modules/yaml": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", @@ -7914,11 +7847,6 @@ "node": ">=6" } }, - "node_modules/yargs/node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" - }, "node_modules/yargs/node_modules/find-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", @@ -8035,9 +7963,9 @@ "dev": true }, "@babel/core": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.15.4.tgz", - "integrity": "sha512-Lkcv9I4a8bgUI8LJOLM6IKv6hnz1KOju6KM1lceqVMKlKKqNRopYd2Pc9MgIurqvMJ6BooemrnJz8jlIiQIpsA==", + "version": "7.15.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.15.5.tgz", + "integrity": "sha512-pYgXxiwAgQpgM1bNkZsDEq85f0ggXMA5L7c+o3tskGMh2BunCI9QUwB9Z4jpvXUOuMdyGKiGKQiRe11VS6Jzvg==", "dev": true, "requires": { "@babel/code-frame": "^7.14.5", @@ -8045,7 +7973,7 @@ "@babel/helper-compilation-targets": "^7.15.4", "@babel/helper-module-transforms": "^7.15.4", "@babel/helpers": "^7.15.4", - "@babel/parser": "^7.15.4", + "@babel/parser": "^7.15.5", "@babel/template": "^7.15.4", "@babel/traverse": "^7.15.4", "@babel/types": "^7.15.4", @@ -8084,9 +8012,9 @@ } }, "@babel/eslint-parser": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.15.4.tgz", - "integrity": "sha512-hPMIAmGNbmQzXJIo2P43Zj9UhRmGev5f9nqdBFOWNGDGh6XKmjby79woBvg6y0Jur6yRfQBneDbUQ8ZVc1krFw==", + "version": "7.15.7", + "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.15.7.tgz", + "integrity": "sha512-yJkHyomClm6A2Xzb8pdAo4HzYMSXFn1O5zrCYvbFP0yQFvHueLedV8WiEno8yJOKStjUXzBZzJFeWQ7b3YMsqQ==", "dev": true, "requires": { "eslint-scope": "^5.1.1", @@ -8319,14 +8247,14 @@ } }, "@babel/parser": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.15.4.tgz", - "integrity": "sha512-xmzz+7fRpjrvDUj+GV7zfz/R3gSK2cOxGlazaXooxspCr539cbTXJKvBJzSVI2pPhcRGquoOtaIkKCsHQUiO3w==" + "version": "7.15.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.15.6.tgz", + "integrity": "sha512-S/TSCcsRuCkmpUuoWijua0Snt+f3ewU/8spLo+4AXJCZfT0bVCzLD5MuOKdrx0mlAptbKzn5AdgEIIKXxXkz9Q==" }, "@babel/standalone": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/standalone/-/standalone-7.15.4.tgz", - "integrity": "sha512-UO0QCTFjX5NSuwX/i8+/pesmRPoRTtf46Cpn8VHcXvNinEr2lxqe8Ix10TfU/UK5qsaOrcKk24We8wH1G0nTZA==", + "version": "7.15.6", + "resolved": "https://registry.npmjs.org/@babel/standalone/-/standalone-7.15.6.tgz", + "integrity": "sha512-1N9+KHL9ZYKiDDXFgBvg8Sl135evIJgP/YZdOhqdfMMTL/zuAm6bUi/FYEwzTXYhQS8MBtRMVmmcIurif7hYiQ==", "dev": true }, "@babel/template": { @@ -8386,9 +8314,9 @@ } }, "@babel/types": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.15.4.tgz", - "integrity": "sha512-0f1HJFuGmmbrKTCZtbm3cU+b/AqdEYk5toj5iQur58xkVMlS0JWaKxTBSmCXd47uiN7vbcozAupm6Mvs80GNhw==", + "version": "7.15.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.15.6.tgz", + "integrity": "sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig==", "requires": { "@babel/helper-validator-identifier": "^7.14.9", "to-fast-properties": "^2.0.0" @@ -8443,7 +8371,8 @@ "@fortawesome/vue-fontawesome": { "version": "3.0.0-4", "resolved": "https://registry.npmjs.org/@fortawesome/vue-fontawesome/-/vue-fontawesome-3.0.0-4.tgz", - "integrity": "sha512-dQVhhMRcUPCb0aqk5ohm0KGk5OJ7wFZ9aYapLzJB3Z+xs7LhkRWLTb87reelUAG5PFDjutDAXuloT9hi6cz72A==" + "integrity": "sha512-dQVhhMRcUPCb0aqk5ohm0KGk5OJ7wFZ9aYapLzJB3Z+xs7LhkRWLTb87reelUAG5PFDjutDAXuloT9hi6cz72A==", + "requires": {} }, "@humanwhocodes/config-array": { "version": "0.5.0", @@ -8523,6 +8452,16 @@ "@intlify/shared": "9.1.7" } }, + "@louislam/sqlite3": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/@louislam/sqlite3/-/sqlite3-5.0.6.tgz", + "integrity": "sha512-uitL0jdbki5XSrmGKGgvHVMHEe00O6GAMoPrVOnh4KTcFOJ1T8SWypbnyqSxBr7PrjAVfgnIGu3kzYCCqIxd4g==", + "requires": { + "@mapbox/node-pre-gyp": "^1.0.0", + "node-addon-api": "^3.0.0", + "node-gyp": "^7.1.2" + } + }, "@mapbox/node-pre-gyp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.5.tgz", @@ -8630,9 +8569,9 @@ } }, "@types/bootstrap": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/@types/bootstrap/-/bootstrap-5.1.4.tgz", - "integrity": "sha512-VAY+o6sCKrJ7Xix/lugdvQz0PpOn7Go+fQzCXOZvIdp7E/TDaiJddInVhNB/84bk9NX6uuKFSfl2pqslNYH9aA==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/@types/bootstrap/-/bootstrap-5.1.6.tgz", + "integrity": "sha512-3L6IvOCKyoVd3e4bgQTH7VBPbuYEOG8IQbRcuZ0AbjfwPdRX+kVf5L/7mVt1EVM+D/BVw4+71rtp7Z8yYROlpQ==", "dev": true, "requires": { "@popperjs/core": "^2.9.2", @@ -8678,12 +8617,6 @@ "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz", "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==" }, - "@types/estree": { - "version": "0.0.48", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.48.tgz", - "integrity": "sha512-LfZwXoGUDo0C3me81HXgkBg5CTQYb6xzEl+fNmbO4JdRiSKQ8A0GD1OBBvKAIsbCUgoyAty7m99GqqMQe784ew==", - "dev": true - }, "@types/express": { "version": "4.17.13", "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", @@ -8773,9 +8706,9 @@ "dev": true }, "@types/node": { - "version": "16.7.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.10.tgz", - "integrity": "sha512-S63Dlv4zIPb8x6MMTgDq5WWRJQe56iBEY0O3SOFA9JrRienkOVDXSXBjjJw6HTNQYSE2JI6GMCR6LVbIMHJVvA==" + "version": "16.9.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz", + "integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==" }, "@types/normalize-package-data": { "version": "2.4.1", @@ -8821,9 +8754,9 @@ "dev": true }, "@vitejs/plugin-legacy": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-legacy/-/plugin-legacy-1.5.2.tgz", - "integrity": "sha512-b1CaWY/wi7gQZnZaxH+ujPTPb91bEPgnnk7l0WIwxoQtW5UC5MQywRcAbFX+Ise62exXctOMBtsnXKJw2KajXw==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-legacy/-/plugin-legacy-1.5.3.tgz", + "integrity": "sha512-/b2x6dU+BbdW7C7KWxh9kMrVzv1JlUi1ucPQpSzWUUUVJjihbG+GRlpqcvfQ0p/TnAKl2d/VecbTLByVJJHORg==", "dev": true, "requires": { "@babel/standalone": "^7.14.9", @@ -8834,66 +8767,119 @@ } }, "@vitejs/plugin-vue": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-1.6.0.tgz", - "integrity": "sha512-n3i8htn8pTg9M+kM3cnEfsPZx/6ngInlTroth6fA1LQTJq5aTVQ8ggaE5pPoAy9vCgHPtcaXMzwpldhqRAkebQ==", - "dev": true + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-1.9.1.tgz", + "integrity": "sha512-9YuxaU2nLoSS/S1Ep4QTG/pEIh96LlauNM1g7LN/EOJ14Nj8HBeSy1OL26ydxb+MPhKn5XKGARh5wQF0UjHbLw==", + "dev": true, + "requires": {} }, "@vue/compiler-core": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.8.tgz", - "integrity": "sha512-Sx8qJ030+QM/NakUrkQuUGCeDEb+0d0AgFOl5W4qRvR6e+YgLnW2ew0jREf4T1hak9Fdk8Edl67StECHrhEuew==", + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.11.tgz", + "integrity": "sha512-bcbsLx5XyQg8WDDEGwmpX0BfEfv82wIs9fWFelpyVhNRGMaABvUTalYINyfhVT+jOqNaD4JBhJiVKd/8TmsHWg==", "requires": { "@babel/parser": "^7.15.0", "@babel/types": "^7.15.0", - "@vue/shared": "3.2.8", + "@vue/shared": "3.2.11", "estree-walker": "^2.0.2", "source-map": "^0.6.1" } }, "@vue/compiler-dom": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.8.tgz", - "integrity": "sha512-nxBW6k8FMWQ74294CRbqR+iEJRO5vIjx85I3YCOyZFD6FsDHyFL60g76TcJzucp+F2XXIDaYz+A+F4gQlDatjw==", + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.11.tgz", + "integrity": "sha512-DNvhUHI/1Hn0/+ZYDYGAuDGasUm+XHKC3FE4GqkNCTO/fcLaJMRg/7eT1m1lkc7jPffUwwfh1rZru5mwzOjrNw==", "requires": { - "@vue/compiler-core": "3.2.8", - "@vue/shared": "3.2.8" + "@vue/compiler-core": "3.2.11", + "@vue/shared": "3.2.11" } }, "@vue/compiler-sfc": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.8.tgz", - "integrity": "sha512-XClueQAXoWtN2EToKgfYH9FCL70Ac4bxx6OZFZzxYSg1bei8IB9srJP1UOfnJb2IpnM1heikAz1dp1HI1wHcyQ==", + "version": "3.2.16", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.16.tgz", + "integrity": "sha512-AxaDDg0ZjY7lCoVnCq7V+K3SIEfhyIHtten7k/LRupVC/VzSbelBmW0J8bawgsjLJAfTsdWZjeezZ5JJp2DM/A==", "dev": true, "requires": { "@babel/parser": "^7.15.0", - "@babel/types": "^7.15.0", - "@types/estree": "^0.0.48", - "@vue/compiler-core": "3.2.8", - "@vue/compiler-dom": "3.2.8", - "@vue/compiler-ssr": "3.2.8", - "@vue/ref-transform": "3.2.8", - "@vue/shared": "3.2.8", - "consolidate": "^0.16.0", + "@vue/compiler-core": "3.2.16", + "@vue/compiler-dom": "3.2.16", + "@vue/compiler-ssr": "3.2.16", + "@vue/ref-transform": "3.2.16", + "@vue/shared": "3.2.16", "estree-walker": "^2.0.2", - "hash-sum": "^2.0.0", - "lru-cache": "^5.1.1", "magic-string": "^0.25.7", - "merge-source-map": "^1.1.0", "postcss": "^8.1.10", - "postcss-modules": "^4.0.0", - "postcss-selector-parser": "^6.0.4", "source-map": "^0.6.1" + }, + "dependencies": { + "@vue/compiler-core": { + "version": "3.2.16", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.16.tgz", + "integrity": "sha512-60LD3f1GpMtoCPWKP7HacFxv97/EUY8m4WNqfFYmfaILVGO0icojdOCYOfgGFiYC+kgk1MOVdiI4vrWci0CnhQ==", + "dev": true, + "requires": { + "@babel/parser": "^7.15.0", + "@vue/shared": "3.2.16", + "estree-walker": "^2.0.2", + "source-map": "^0.6.1" + } + }, + "@vue/compiler-dom": { + "version": "3.2.16", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.16.tgz", + "integrity": "sha512-K7lYfwvsp5OLb0+/rKI9XT2RJy2RB7TyJBjvlfCDAF0KOJGqWAx++DLJPm+F3D29Mhxgt6ozSKP+rC3dSabvYA==", + "dev": true, + "requires": { + "@vue/compiler-core": "3.2.16", + "@vue/shared": "3.2.16" + } + }, + "@vue/shared": { + "version": "3.2.16", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.16.tgz", + "integrity": "sha512-zpv8lxuatl3ruCJCsGzrO/F4+IlLug4jbu3vaIi/wJVZKQgnsW1R/xSRJMQS6K57cl4fT/2zkrYsWh1/6H7Esw==", + "dev": true + } } }, "@vue/compiler-ssr": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.8.tgz", - "integrity": "sha512-QqyiFRiIl55W0abDNQ6cNG/7iIfBHmbXVtssUAjX3IlI87ELeT0xackmrCyTSnfIX12ixljg9AN0COIZwlvt5A==", + "version": "3.2.16", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.16.tgz", + "integrity": "sha512-u2Inuqp3QpEV3E03ppBLdba40mU0dz/fisbfGjRPlxH5uuQ9v9i5qgrFl7xZ+N5C0ugg5+5KI7MgsbsCAPn0mQ==", "dev": true, "requires": { - "@vue/compiler-dom": "3.2.8", - "@vue/shared": "3.2.8" + "@vue/compiler-dom": "3.2.16", + "@vue/shared": "3.2.16" + }, + "dependencies": { + "@vue/compiler-core": { + "version": "3.2.16", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.16.tgz", + "integrity": "sha512-60LD3f1GpMtoCPWKP7HacFxv97/EUY8m4WNqfFYmfaILVGO0icojdOCYOfgGFiYC+kgk1MOVdiI4vrWci0CnhQ==", + "dev": true, + "requires": { + "@babel/parser": "^7.15.0", + "@vue/shared": "3.2.16", + "estree-walker": "^2.0.2", + "source-map": "^0.6.1" + } + }, + "@vue/compiler-dom": { + "version": "3.2.16", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.16.tgz", + "integrity": "sha512-K7lYfwvsp5OLb0+/rKI9XT2RJy2RB7TyJBjvlfCDAF0KOJGqWAx++DLJPm+F3D29Mhxgt6ozSKP+rC3dSabvYA==", + "dev": true, + "requires": { + "@vue/compiler-core": "3.2.16", + "@vue/shared": "3.2.16" + } + }, + "@vue/shared": { + "version": "3.2.16", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.16.tgz", + "integrity": "sha512-zpv8lxuatl3ruCJCsGzrO/F4+IlLug4jbu3vaIi/wJVZKQgnsW1R/xSRJMQS6K57cl4fT/2zkrYsWh1/6H7Esw==", + "dev": true + } } }, "@vue/devtools-api": { @@ -8902,49 +8888,69 @@ "integrity": "sha512-quBx4Jjpexo6KDiNUGFr/zF/2A4srKM9S9v2uHgMXSU//hjgq1eGzqkIFql8T9gfX5ZaVOUzYBP3jIdIR3PKIA==" }, "@vue/reactivity": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.8.tgz", - "integrity": "sha512-/Hj3Uz28SG+xB5SDWPOXUs0emvHkq82EmTgk44/plTVFeswCZ3i3Hd7WmsrPT4rGajlDKd5uqMmW0ith1ED0FA==", + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.11.tgz", + "integrity": "sha512-hEQstxPQbgGZq5qApzrvbDmRdK1KP96O/j4XrwT8fVkT1ytkFs4fH2xNEh9QKwXfybbQkLs77W7OfXCv5o6qbA==", "requires": { - "@vue/shared": "3.2.8" + "@vue/shared": "3.2.11" } }, "@vue/ref-transform": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/@vue/ref-transform/-/ref-transform-3.2.8.tgz", - "integrity": "sha512-9LdADd4JM3klt+b2qNT8a7b7JvBETNBy2Btv5rDzyPrAVS4Vrw+1WWay6gZBgnxfJ9TPSvG8f/9zu6gNGHmJLA==", + "version": "3.2.16", + "resolved": "https://registry.npmjs.org/@vue/ref-transform/-/ref-transform-3.2.16.tgz", + "integrity": "sha512-IXFgxGnyd5jIXPQ/QlOoz+daeikeR1AA6DujgqalmW/ndCX9ZKW1rhFsoMGR0WAUZ4VHbT3eluUJhBF8ikNzPg==", "dev": true, "requires": { "@babel/parser": "^7.15.0", - "@vue/compiler-core": "3.2.8", - "@vue/shared": "3.2.8", + "@vue/compiler-core": "3.2.16", + "@vue/shared": "3.2.16", "estree-walker": "^2.0.2", "magic-string": "^0.25.7" + }, + "dependencies": { + "@vue/compiler-core": { + "version": "3.2.16", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.16.tgz", + "integrity": "sha512-60LD3f1GpMtoCPWKP7HacFxv97/EUY8m4WNqfFYmfaILVGO0icojdOCYOfgGFiYC+kgk1MOVdiI4vrWci0CnhQ==", + "dev": true, + "requires": { + "@babel/parser": "^7.15.0", + "@vue/shared": "3.2.16", + "estree-walker": "^2.0.2", + "source-map": "^0.6.1" + } + }, + "@vue/shared": { + "version": "3.2.16", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.16.tgz", + "integrity": "sha512-zpv8lxuatl3ruCJCsGzrO/F4+IlLug4jbu3vaIi/wJVZKQgnsW1R/xSRJMQS6K57cl4fT/2zkrYsWh1/6H7Esw==", + "dev": true + } } }, "@vue/runtime-core": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.2.8.tgz", - "integrity": "sha512-hwzXLGw1njBEY5JSyRXIIdCtzMFFF6F38WcKMmoIE3p7da30jEbWt8EwwrBomjT8ZbqzElOGlewBcnXNOiiIUg==", + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.2.11.tgz", + "integrity": "sha512-horlxjWwSvModC87WdsWswzzHE5IexmKkQA65S5vFgP5hLUBW+HRyScDeuB/RRcFmqnf+ozacNCfap0kqcpODw==", "requires": { - "@vue/reactivity": "3.2.8", - "@vue/shared": "3.2.8" + "@vue/reactivity": "3.2.11", + "@vue/shared": "3.2.11" } }, "@vue/runtime-dom": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.2.8.tgz", - "integrity": "sha512-A/aRrlGLJ5y4Z7eNbnO/xHwx2RiPijQo7D3OIwESroG3HNP+dpuoqamajo5TXS9ZGjbMOih82COoe7xb9P4BZw==", + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.2.11.tgz", + "integrity": "sha512-cOK1g0INdiCbds2xrrJKrrN+pDHuLz6esUs/crdEiupDuX7IeiMbdqrAQCkYHp5P1KLWcbGlkmwfVD7HQGii0Q==", "requires": { - "@vue/runtime-core": "3.2.8", - "@vue/shared": "3.2.8", + "@vue/runtime-core": "3.2.11", + "@vue/shared": "3.2.11", "csstype": "^2.6.8" } }, "@vue/shared": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.8.tgz", - "integrity": "sha512-E2DQQnG7Qr4GwTs3GlfPPlHliGVADoufTnhpwfoViw7JlyLMmYtjfnTwM6nXAwvSJWiF7D+7AxpnWBBT3VWo6Q==" + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.11.tgz", + "integrity": "sha512-ovfXAsSsCvV9JVceWjkqC/7OF5HbgLOtCWjCIosmPGG8lxbPuavhIxRH1dTx4Dg9xLgRTNLvI3pVxG4ItQZekg==" }, "abbrev": { "version": "1.1.1", @@ -8970,7 +8976,8 @@ "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true + "dev": true, + "requires": {} }, "agent-base": { "version": "6.0.2", @@ -8999,9 +9006,9 @@ "dev": true }, "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "ansi-styles": { @@ -9207,11 +9214,11 @@ "optional": true }, "axios": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", - "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", "requires": { - "follow-redirects": "^1.10.0" + "follow-redirects": "^1.14.0" } }, "babel-plugin-add-module-exports": { @@ -9219,6 +9226,27 @@ "resolved": "https://registry.npmjs.org/babel-plugin-add-module-exports/-/babel-plugin-add-module-exports-0.2.1.tgz", "integrity": "sha1-mumh9KjcZ/DN7E9K7aHkOl/2XiU=" }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "requires": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + }, + "dependencies": { + "core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==" + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + } + } + }, "backo2": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", @@ -9272,12 +9300,6 @@ "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz", "integrity": "sha1-mrVie5PmBiH/fNrF2pczAn3x0Ms=" }, - "big.js": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", - "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", - "dev": true - }, "binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -9289,12 +9311,6 @@ "resolved": "https://registry.npmjs.org/bintrees/-/bintrees-1.0.1.tgz", "integrity": "sha1-DmVcm5wkNeqraL9AJyJtK1WjRSQ=" }, - "bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true - }, "body-parser": { "version": "1.19.0", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", @@ -9328,9 +9344,10 @@ } }, "bootstrap": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.0.tgz", - "integrity": "sha512-bs74WNI9BgBo3cEovmdMHikSKoXnDgA6VQjJ7TyTotU6L7d41ZyCEEelPwkYEzsG/Zjv3ie9IE3EMAje0W9Xew==" + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.1.tgz", + "integrity": "sha512-/jUa4sSuDZWlDLQ1gwQQR8uoYSvLJzDd8m5o6bPKh3asLAMYVZKdRCjb1joUd5WXf0WwCNzd2EjwQQhupou0dA==", + "requires": {} }, "brace-expansion": { "version": "1.1.11", @@ -9351,14 +9368,14 @@ } }, "browserslist": { - "version": "4.16.8", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.8.tgz", - "integrity": "sha512-sc2m9ohR/49sWEbPj14ZSSZqp+kbi16aLao42Hmn3Z8FpjuMaq2xCA2l4zl9ITfyzvnvyE0hcg62YkIGKxgaNQ==", + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.17.0.tgz", + "integrity": "sha512-g2BJ2a0nEYvEFQC208q8mVAhfNwpZ5Mu8BwgtCdZKO3qx98HChmeg448fPdUzld8aFmfLgVh7yymqV+q1lJZ5g==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001251", + "caniuse-lite": "^1.0.30001254", "colorette": "^1.3.0", - "electron-to-chromium": "^1.3.811", + "electron-to-chromium": "^1.3.830", "escalade": "^3.1.1", "node-releases": "^1.1.75" } @@ -9429,9 +9446,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001252", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001252.tgz", - "integrity": "sha512-I56jhWDGMtdILQORdusxBOH+Nl/KgQSdDmpJezYddnAkVOmnoU8zwjTV9xAjMIYxr0iPreEAVylCGcmHCjfaOw==", + "version": "1.0.30001257", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001257.tgz", + "integrity": "sha512-JN49KplOgHSXpIsVSF+LUyhD8PUp6xPpAXeRrrcBh4KBeP7W864jHn6RvzJgDlrReyeVjMFJL3PLpPvKIxlIHA==", "dev": true }, "caseless": { @@ -9476,7 +9493,8 @@ "chartjs-adapter-dayjs": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/chartjs-adapter-dayjs/-/chartjs-adapter-dayjs-1.0.0.tgz", - "integrity": "sha512-EnbVqTJGFKLpg1TROLdCEufrzbmIa2oeLGx8O2Wdjw2EoMudoOo9+YFu+6CM0Z0hQ/v3yq/e/Y6efQMu22n8Jg==" + "integrity": "sha512-EnbVqTJGFKLpg1TROLdCEufrzbmIa2oeLGx8O2Wdjw2EoMudoOo9+YFu+6CM0Z0hQ/v3yq/e/Y6efQMu22n8Jg==", + "requires": {} }, "chokidar": { "version": "3.5.2", @@ -9514,11 +9532,6 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" - }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", @@ -9574,9 +9587,9 @@ "dev": true }, "colorette": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.3.0.tgz", - "integrity": "sha512-ecORCqbSFP7Wm8Y6lyqMJjexBQqXSF7SSeaTyGGphogUjBlFP9m9o08wy86HL2uB7fMTxtOUzLMk7ogKcxMg1w==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz", + "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==", "dev": true }, "combined-stream": { @@ -9617,15 +9630,6 @@ "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" }, - "consolidate": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/consolidate/-/consolidate-0.16.0.tgz", - "integrity": "sha512-Nhl1wzCslqXYTJVDyJCu3ODohy9OfBMB5uD2BiBTzd7w+QY0lBzafkR8y8755yMYHAaMD4NuzbAw03/xzfw+eQ==", - "dev": true, - "requires": { - "bluebird": "^3.7.2" - } - }, "content-disposition": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", @@ -9659,9 +9663,9 @@ "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" }, "core-js": { - "version": "3.17.2", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.17.2.tgz", - "integrity": "sha512-XkbXqhcXeMHPRk2ItS+zQYliAMilea2euoMsnpRRdDad6b2VY6CQQcwz1K8AnWesfw4p165RzY0bTnr3UrbYiA==", + "version": "3.18.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.18.0.tgz", + "integrity": "sha512-WJeQqq6jOYgVgg4NrXKL0KLQhi0CT4ZOCvFL+3CQ5o7I6J8HkT5wd53EadMfqTDp1so/MT1J+w2ujhWcCJtN7w==", "dev": true }, "core-util-is": { @@ -9691,6 +9695,15 @@ "yaml": "^1.10.0" } }, + "cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.1" + } + }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -9709,9 +9722,9 @@ "dev": true }, "csstype": { - "version": "2.6.17", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.17.tgz", - "integrity": "sha512-u1wmTI1jJGzCJzWndZo8mk4wnPTZd1eOIYTYvuEyOQGfmDl3TrabCCfKnOC86FZwW/9djqTl933UF/cS425i9A==" + "version": "2.6.18", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.18.tgz", + "integrity": "sha512-RSU6Hyeg14am3Ah4VZEmeX8H7kLwEEirXe6aU2IPfKNvhXwTflK5HQRDNI0ypQXoqmm+QPyG2IaPuQE5zMwSIQ==" }, "dashdash": { "version": "1.14.1", @@ -9723,9 +9736,9 @@ } }, "dayjs": { - "version": "1.10.6", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.10.6.tgz", - "integrity": "sha512-AztC/IOW4L1Q41A86phW5Thhcrco3xuAA+YX/BLpLWWjRcTj5TOt/QImBLmCKlrF7u7k47arTnOyL6GnbG8Hvw==" + "version": "1.10.7", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.10.7.tgz", + "integrity": "sha512-P6twpd70BcPK34K26uJ1KT3wlhpuOAPoMwJzpsIWUxHZ7wpmbdZL/hQqBDfz7hGurYSa5PhzdhDHtt319hL3ig==" }, "debug": { "version": "4.3.2", @@ -9759,9 +9772,9 @@ } }, "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, "delayed-stream": { @@ -9891,22 +9904,15 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "electron-to-chromium": { - "version": "1.3.830", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.830.tgz", - "integrity": "sha512-gBN7wNAxV5vl1430dG+XRcQhD4pIeYeak6p6rjdCtlz5wWNwDad8jwvphe5oi1chL5MV6RNRikfffBBiFuj+rQ==", + "version": "1.3.840", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.840.tgz", + "integrity": "sha512-yRoUmTLDJnkIJx23xLY7GbSvnmDCq++NSuxHDQ0jiyDJ9YZBUGJcrdUqm+ZwZFzMbCciVzfem2N2AWiHJcWlbw==", "dev": true }, "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "emojis-list": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", - "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", - "dev": true + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" }, "encodeurl": { "version": "1.0.2", @@ -9990,9 +9996,9 @@ } }, "esbuild": { - "version": "0.12.25", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.12.25.tgz", - "integrity": "sha512-woie0PosbRSoN8gQytrdCzUbS2ByKgO8nD1xCZkEup3D9q92miCze4PqEI9TZDYAuwn6CruEnQpJxgTRWdooAg==", + "version": "0.12.28", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.12.28.tgz", + "integrity": "sha512-pZ0FrWZXlvQOATlp14lRSk1N9GkeJ3vLIwOcUoo3ICQn9WNR4rWoNi81pbn6sC1iYUy7QPqNzI3+AEzokwyVcA==", "dev": true }, "escalade": { @@ -10086,9 +10092,9 @@ } }, "eslint-plugin-vue": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-7.17.0.tgz", - "integrity": "sha512-Rq5R2QetDCgC+kBFQw1+aJ5B93tQ4xqZvoCUxuIzwTonngNArsdP8ChM8PowIzsJvRtWl4ltGh/bZcN3xhFWSw==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-7.18.0.tgz", + "integrity": "sha512-ceDXlXYMMPMSXw7tdKUR42w9jlzthJGJ3Kvm3YrZ0zuQfvAySNxe8sm6VHuksBW0+060GzYXhHJG6IHVOfF83Q==", "dev": true, "requires": { "eslint-utils": "^2.1.0", @@ -10335,9 +10341,9 @@ "dev": true }, "fastq": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.12.0.tgz", - "integrity": "sha512-VNX0QkHK3RsXVKr9KrlUv/FoTa0NdbYoHHl7uXHv2rzyHSlxjdNAKug2twd9luJxpcyNeAgf5iPPMutJO67Dfg==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", "dev": true, "requires": { "reusify": "^1.0.4" @@ -10417,9 +10423,9 @@ "dev": true }, "follow-redirects": { - "version": "1.14.3", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.3.tgz", - "integrity": "sha512-3MkHxknWMUtb23apkgz/83fDoe+y+qr0TdgacGIA7bew+QLBo3vdgEN2xEsuXNivpFy4CyDhBBZnNZOtalmenw==" + "version": "1.14.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz", + "integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==" }, "forever-agent": { "version": "0.6.1", @@ -10508,15 +10514,6 @@ } } }, - "generic-names": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/generic-names/-/generic-names-2.0.1.tgz", - "integrity": "sha512-kPCHWa1m9wGG/OwQpeweTwM/PYiQLrUIxXbt/P4Nic3LbGjCP0YwrALHW1uNLKZ0LIMg+RF+XRlj2ekT9ZlZAQ==", - "dev": true, - "requires": { - "loader-utils": "^1.1.0" - } - }, "gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -10699,12 +10696,6 @@ "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" }, - "hash-sum": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-2.0.0.tgz", - "integrity": "sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg==", - "dev": true - }, "hosted-git-info": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.0.2.tgz", @@ -10812,18 +10803,6 @@ "safer-buffer": ">= 2.1.2 < 3" } }, - "icss-replace-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz", - "integrity": "sha1-Bupvg2ead0njhs/h/oEq5dsiPe0=", - "dev": true - }, - "icss-utils": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", - "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==", - "dev": true - }, "ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -11004,9 +10983,9 @@ "dev": true }, "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" }, "isexe": { "version": "2.0.0", @@ -11078,15 +11057,6 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", "optional": true }, - "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "dev": true, - "requires": { - "minimist": "^1.2.0" - } - }, "jsonwebtoken": { "version": "8.5.1", "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", @@ -11202,17 +11172,6 @@ "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", "dev": true }, - "loader-utils": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", - "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", - "dev": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^1.0.1" - } - }, "locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -11227,12 +11186,6 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, - "lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=", - "dev": true - }, "lodash.clonedeep": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", @@ -11307,15 +11260,6 @@ "integrity": "sha512-vM6rUVCVUJJt33bnmHiZEvr7wPT78ztX7rojL+LW51bHtLh6HTjx84LA5W4+oa6aKEJA7jJu5LR6vQRBpA5DVg==", "dev": true }, - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - }, "magic-string": { "version": "0.25.7", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", @@ -11421,15 +11365,6 @@ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" }, - "merge-source-map": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz", - "integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==", - "dev": true, - "requires": { - "source-map": "^0.6.1" - } - }, "merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -11511,9 +11446,9 @@ } }, "minipass": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.3.tgz", - "integrity": "sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.5.tgz", + "integrity": "sha512-+8NzxD82XQoNKNrl1d/FSi+X8wAEWR+sbYAfIvub4Nz0d22plFG72CEVVaufV8PNf4qSslFTD8VMOxNVhHCjTw==", "requires": { "yallist": "^4.0.0" }, @@ -11573,9 +11508,9 @@ "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==" }, "node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz", + "integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA==" }, "node-gyp": { "version": "7.1.2", @@ -11628,9 +11563,9 @@ "dev": true }, "nodemailer": { - "version": "6.6.3", - "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.6.3.tgz", - "integrity": "sha512-faZFufgTMrphYoDjvyVpbpJcYzwyFnbAMmQtj1lVBYAUSm3SOy2fIdd9+Mr4UxPosBa0JRw9bJoIwQn+nswiew==" + "version": "6.6.5", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.6.5.tgz", + "integrity": "sha512-C/v856DBijUzHcHIgGpQoTrfsH3suKIRAGliIzCstatM2cAa+MYX3LuyCrABiO/cdJTxgBBHXxV1ztiqUwst5A==" }, "nopt": { "version": "5.0.0", @@ -12016,57 +11951,6 @@ "integrity": "sha1-J7Ocb02U+Bsac7j3Y1HGCeXO8kQ=", "dev": true }, - "postcss-modules": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/postcss-modules/-/postcss-modules-4.2.2.tgz", - "integrity": "sha512-/H08MGEmaalv/OU8j6bUKi/kZr2kqGF6huAW8m9UAgOLWtpFdhA14+gPBoymtqyv+D4MLsmqaF2zvIegdCxJXg==", - "dev": true, - "requires": { - "generic-names": "^2.0.1", - "icss-replace-symbols": "^1.1.0", - "lodash.camelcase": "^4.3.0", - "postcss-modules-extract-imports": "^3.0.0", - "postcss-modules-local-by-default": "^4.0.0", - "postcss-modules-scope": "^3.0.0", - "postcss-modules-values": "^4.0.0", - "string-hash": "^1.1.1" - } - }, - "postcss-modules-extract-imports": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz", - "integrity": "sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==", - "dev": true - }, - "postcss-modules-local-by-default": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.0.tgz", - "integrity": "sha512-sT7ihtmGSF9yhm6ggikHdV0hlziDTX7oFoXtuVWeDd3hHObNkcHRo9V3yg7vCAY7cONyxJC/XXCmmiHHcvX7bQ==", - "dev": true, - "requires": { - "icss-utils": "^5.0.0", - "postcss-selector-parser": "^6.0.2", - "postcss-value-parser": "^4.1.0" - } - }, - "postcss-modules-scope": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-3.0.0.tgz", - "integrity": "sha512-hncihwFA2yPath8oZ15PZqvWGkWf+XUfQgUGamS4LqoP1anQLOsOJw0vr7J7IwLpoY9fatA2qiGUGmuZL0Iqlg==", - "dev": true, - "requires": { - "postcss-selector-parser": "^6.0.4" - } - }, - "postcss-modules-values": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz", - "integrity": "sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==", - "dev": true, - "requires": { - "icss-utils": "^5.0.0" - } - }, "postcss-resolve-nested-selector": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.1.tgz", @@ -12355,7 +12239,8 @@ "version": "0.36.2", "resolved": "https://registry.npmjs.org/postcss-syntax/-/postcss-syntax-0.36.2.tgz", "integrity": "sha512-nBRg/i7E3SOHWxF3PpF5WnJM/jQ1YpY9000OaVXlAQj6Zp/kIqJxEDWIZ67tAd7NLuk7zqN4yqe9nc0oNAOs1w==", - "dev": true + "dev": true, + "requires": {} }, "postcss-value-parser": { "version": "4.1.0", @@ -12444,13 +12329,6 @@ "isarray": "^2.0.1", "pngjs": "^3.3.0", "yargs": "^13.2.4" - }, - "dependencies": { - "isarray": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" - } } }, "qs": { @@ -12561,6 +12439,13 @@ "safe-buffer": "~5.1.1", "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + } } }, "readdirp": { @@ -12594,9 +12479,9 @@ }, "dependencies": { "@types/node": { - "version": "14.17.14", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.14.tgz", - "integrity": "sha512-rsAj2u8Xkqfc332iXV12SqIsjVi07H479bOP4q94NAcjzmAvapumEhuVIt53koEf7JFrpjgNKjBga5Pnn/GL8A==" + "version": "14.17.16", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.16.tgz", + "integrity": "sha512-WiFf2izl01P1CpeY8WqFAeKWwByMueBEkND38EcN8N68qb0aDG3oIS1P5MhAX5kUdr469qRyqsY/MjanLjsFbQ==" } } }, @@ -12778,9 +12663,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "sass": { - "version": "1.39.0", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.39.0.tgz", - "integrity": "sha512-F4o+RhJkNOIG0b6QudYU8c78ZADKZjKDk5cyrf8XTKWfrgbtyVVXImFstJrc+1pkQDCggyidIOytq6gS4gCCZg==", + "version": "1.42.1", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.42.1.tgz", + "integrity": "sha512-/zvGoN8B7dspKc5mC6HlaygyCBRvnyzzgD5khiaCfglWztY99cYoiTUksVx11NlnemrcfH5CEaCpsUKoW0cQqg==", "dev": true, "requires": { "chokidar": ">=3.0.0 <4.0.0" @@ -12870,9 +12755,9 @@ "dev": true }, "signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.4.tgz", + "integrity": "sha512-rqYhcAnZ6d/vTPGghdrw7iumdcbXpsk1b8IG/rz+VWV51DM0p7XCtMoJ3qhPLIbp3tvyt3pKRbaaEMZYpHto8Q==" }, "slash": { "version": "3.0.0", @@ -12944,6 +12829,11 @@ "debug": "~4.3.1" } }, + "sortablejs": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.14.0.tgz", + "integrity": "sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w==" + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -13005,15 +12895,6 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, - "sqlite3": { - "version": "git+ssh://git@github.com/mapbox/node-sqlite3.git#593c9d498be2510d286349134537e3bf89401c4a", - "from": "sqlite3@github:mapbox/node-sqlite3#593c9d", - "requires": { - "@mapbox/node-pre-gyp": "^1.0.0", - "node-addon-api": "^3.0.0", - "node-gyp": "7.x" - } - }, "sshpk": { "version": "1.16.1", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", @@ -13044,12 +12925,6 @@ "safe-buffer": "~5.1.0" } }, - "string-hash": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/string-hash/-/string-hash-1.1.3.tgz", - "integrity": "sha1-6Kr8CsGFW0Zmkp7X3RJ1311sgRs=", - "dev": true - }, "string-width": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", @@ -13191,6 +13066,12 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -13282,7 +13163,8 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-5.0.0.tgz", "integrity": "sha512-c8aubuARSu5A3vEHLBeOSJt1udOdS+1iue7BmJDTSXoCBmfEQmmWX+59vYIj3NQdJBY6a/QRv1ozVFpaB9jaqA==", - "dev": true + "dev": true, + "requires": {} }, "stylelint-config-standard": { "version": "22.0.0", @@ -13418,9 +13300,9 @@ }, "dependencies": { "ajv": { - "version": "8.6.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.2.tgz", - "integrity": "sha512-9807RlWAgT564wT+DjeyU5OFMPjmzxVobvDFmNAhY+5zD6A2ly3jDp6sgnfyDtlIQ+7H97oc/DGCzzfu9rjw9w==", + "version": "8.6.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.3.tgz", + "integrity": "sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", @@ -13429,6 +13311,12 @@ "uri-js": "^4.2.2" } }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -13508,6 +13396,11 @@ "resolved": "https://registry.npmjs.org/tildify/-/tildify-2.0.0.tgz", "integrity": "sha512-Cc+OraorugtXNfs50hU9KS369rFXCfgGLpfCfvlc+Ud5u6VWmUQsOAa9HbTvheQdYnrdJqqv1e5oIqXppMYnSw==" }, + "timezones-list": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/timezones-list/-/timezones-list-3.0.1.tgz", + "integrity": "sha512-yfOzyuVwzgD0LkldD3Epkr+JUdUIxEUL147Fa6ZgG/23KU28iOv3e3M7vQOCFMPyopAhDX7dqOLWttIP7tkTKg==" + }, "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -13603,9 +13496,9 @@ } }, "typescript": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.2.tgz", - "integrity": "sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz", + "integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==", "dev": true }, "unified": { @@ -13757,9 +13650,9 @@ } }, "vite": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/vite/-/vite-2.5.3.tgz", - "integrity": "sha512-1wMDnjflvtTTkMov8O/Xb5+w1/VW/Gw8oCf8f6dqgHn8lMOEqq0SaPtFEQeikFcOKCfSbiU0nEi0LDIx6DNsaQ==", + "version": "2.5.10", + "resolved": "https://registry.npmjs.org/vite/-/vite-2.5.10.tgz", + "integrity": "sha512-0ObiHTi5AHyXdJcvZ67HMsDgVpjT5RehvVKv6+Q0jFZ7zDI28PF5zK9mYz2avxdA+4iJMdwCz6wnGNnn4WX5Gg==", "dev": true, "requires": { "esbuild": "^0.12.17", @@ -13770,13 +13663,13 @@ } }, "vue": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.2.8.tgz", - "integrity": "sha512-x7lwdnOSkceHQUXRVVHBaZzcp6v7M2CYtSZH75zZaT1mTjB4plC4KZHKP/5jAvdqOLBHZGwDSMkWXm3YbAufrA==", + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.2.11.tgz", + "integrity": "sha512-JkI3/eIgfk4E0f/p319TD3EZgOwBQfftgnkRsXlT7OrRyyiyoyUXn6embPGZXSBxD3LoZ9SWhJoxLhFh5AleeA==", "requires": { - "@vue/compiler-dom": "3.2.8", - "@vue/runtime-dom": "3.2.8", - "@vue/shared": "3.2.8" + "@vue/compiler-dom": "3.2.11", + "@vue/runtime-dom": "3.2.11", + "@vue/shared": "3.2.11" } }, "vue-chart-3": { @@ -13795,17 +13688,25 @@ "vue-confirm-dialog": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/vue-confirm-dialog/-/vue-confirm-dialog-1.0.2.tgz", - "integrity": "sha512-gTo1bMDWOLd/6ihmWv8VlPxhc9QaKoE5YqlsKydUOfrrQ3Q3taljF6yI+1TMtAtJLrvZ8DYrePhgBhY1VCJzbQ==" + "integrity": "sha512-gTo1bMDWOLd/6ihmWv8VlPxhc9QaKoE5YqlsKydUOfrrQ3Q3taljF6yI+1TMtAtJLrvZ8DYrePhgBhY1VCJzbQ==", + "requires": {} + }, + "vue-contenteditable": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/vue-contenteditable/-/vue-contenteditable-3.0.4.tgz", + "integrity": "sha512-CmtqT4zHQwLoJEyNVaXUjjUFPUVYlXXBHfSbRCHCUjODMqrn6L293LM1nc1ELx8epitZZvecTfIqOLlSzB3d+w==", + "requires": {} }, "vue-demi": { "version": "0.10.1", "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.10.1.tgz", - "integrity": "sha512-L6Oi+BvmMv6YXvqv5rJNCFHEKSVu7llpWWJczqmAQYOdmPPw5PNYoz1KKS//Fxhi+4QP64dsPjtmvnYGo1jemA==" + "integrity": "sha512-L6Oi+BvmMv6YXvqv5rJNCFHEKSVu7llpWWJczqmAQYOdmPPw5PNYoz1KKS//Fxhi+4QP64dsPjtmvnYGo1jemA==", + "requires": {} }, "vue-eslint-parser": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-7.10.0.tgz", - "integrity": "sha512-7tc/ewS9Vq9Bn741pvpg8op2fWJPH3k32aL+jcIcWGCTzh/zXSdh7pZ5FV3W2aJancP9+ftPAv292zY5T5IPCg==", + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-7.11.0.tgz", + "integrity": "sha512-qh3VhDLeh773wjgNTl7ss0VejY9bMMa0GoDG2fQVyDzRFdiU3L7fw74tWZDHNQXdZqxO3EveQroa9ct39D2nqg==", "dev": true, "requires": { "debug": "^4.1.1", @@ -13847,6 +13748,14 @@ "@vue/devtools-api": "^6.0.0-beta.7" } }, + "vue-image-crop-upload": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/vue-image-crop-upload/-/vue-image-crop-upload-3.0.3.tgz", + "integrity": "sha512-VeBsU0oI1hXeCvdpnu19DM/r3KTlI8SUXTxsHsU4MhDXR0ahRziiL9tf4FbILGx+gRVNZhGbl32yuM6TiaGNhA==", + "requires": { + "babel-runtime": "^6.11.6" + } + }, "vue-multiselect": { "version": "3.0.0-alpha.2", "resolved": "https://registry.npmjs.org/vue-multiselect/-/vue-multiselect-3.0.0-alpha.2.tgz", @@ -13864,7 +13773,8 @@ "vue-demi": { "version": "0.11.4", "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.11.4.tgz", - "integrity": "sha512-/3xFwzSykLW2HiiLie43a+FFgNOcokbBJ+fzvFXd0r2T8MYohqvphUyDQ8lbAwzQ3Dlcrb1c9ykifGkhSIAk6A==" + "integrity": "sha512-/3xFwzSykLW2HiiLie43a+FFgNOcokbBJ+fzvFXd0r2T8MYohqvphUyDQ8lbAwzQ3Dlcrb1c9ykifGkhSIAk6A==", + "requires": {} } } }, @@ -13879,7 +13789,16 @@ "vue-toastification": { "version": "2.0.0-rc.1", "resolved": "https://registry.npmjs.org/vue-toastification/-/vue-toastification-2.0.0-rc.1.tgz", - "integrity": "sha512-hjauv/FyesNZdwcr5m1SCyvu1JmlB+Ts5bTptDLDmsYYlj6Oqv8NYakiElpCF+Abwkn9J/AChh6FwkTL1HOb7Q==" + "integrity": "sha512-hjauv/FyesNZdwcr5m1SCyvu1JmlB+Ts5bTptDLDmsYYlj6Oqv8NYakiElpCF+Abwkn9J/AChh6FwkTL1HOb7Q==", + "requires": {} + }, + "vuedraggable": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/vuedraggable/-/vuedraggable-4.1.0.tgz", + "integrity": "sha512-FU5HCWBmsf20GpP3eudURW3WdWTKIbEIQxh9/8GE806hydR9qZqRRxRE3RjqX7PkuLuMQG/A7n3cfj9rCEchww==", + "requires": { + "sortablejs": "1.14.0" + } }, "which": { "version": "2.0.2", @@ -13945,11 +13864,6 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" - }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", @@ -13995,7 +13909,8 @@ "ws": { "version": "7.4.6", "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", - "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==" + "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", + "requires": {} }, "xmlhttprequest-ssl": { "version": "2.0.0", @@ -14007,12 +13922,6 @@ "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" }, - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true - }, "yaml": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", @@ -14041,11 +13950,6 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" - }, "find-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", diff --git a/package.json b/package.json index 51d9ab0..5c3f8e0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "uptime-kuma", - "version": "1.6.0", + "version": "1.7.0", "license": "MIT", "repository": { "type": "git", @@ -10,22 +10,25 @@ "node": "14.*" }, "scripts": { - "install-legacy-peer-deps": "npm install --legacy-peer-deps", - "update-legacy-peer-deps": "npm update --legacy-peer-deps", + "install-legacy": "npm install --legacy-peer-deps", + "update-legacy": "npm update --legacy-peer-deps", "lint:js": "eslint --ext \".js,.vue\" --ignore-path .gitignore .", "lint:style": "stylelint \"**/*.{vue,css,scss}\" --ignore-path .gitignore", "lint": "npm run lint:js && npm run lint:style", "dev": "vite --host", "start": "npm run start-server", "start-server": "node server/server.js", + "start-server-dev": "cross-env NODE_ENV=development node server/server.js", "build": "vite build", + "tsc": "tsc", "vite-preview-dist": "vite preview --host", "build-docker": "npm run build-docker-debian && npm run build-docker-alpine", - "build-docker-alpine": "docker buildx build -f dockerfile-alpine --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:alpine -t louislam/uptime-kuma:1-alpine -t louislam/uptime-kuma:1.6.0-alpine --target release . --push", - "build-docker-debian": "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma -t louislam/uptime-kuma:1 -t louislam/uptime-kuma:1.6.0 -t louislam/uptime-kuma:debian -t louislam/uptime-kuma:1-debian -t louislam/uptime-kuma:1.6.0-debian --target release . --push", + "build-docker-alpine": "docker buildx build -f dockerfile-alpine --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:alpine -t louislam/uptime-kuma:1-alpine -t louislam/uptime-kuma:1.7.0-alpine --target release . --push", + "build-docker-debian": "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma -t louislam/uptime-kuma:1 -t louislam/uptime-kuma:1.7.0 -t louislam/uptime-kuma:debian -t louislam/uptime-kuma:1-debian -t louislam/uptime-kuma:1.7.0-debian --target release . --push", "build-docker-nightly": "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:nightly --target nightly . --push", + "build-docker-nightly-alpine": "docker buildx build -f dockerfile-alpine --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:nightly-alpine --target nightly . --push", "build-docker-nightly-amd64": "docker buildx build --platform linux/amd64 -t louislam/uptime-kuma:nightly-amd64 --target nightly . --push --progress plain", - "setup": "git checkout 1.6.0 && npm install --legacy-peer-deps && node node_modules/esbuild/install.js && npm run build && npm prune", + "setup": "git checkout 1.7.0 && npm install --legacy-peer-deps && node node_modules/esbuild/install.js && npm run build && npm prune", "update-version": "node extra/update-version.js", "mark-as-nightly": "node extra/mark-as-nightly.js", "reset-password": "node extra/reset-password.js", @@ -34,30 +37,33 @@ "test-install-script-alpine3": "npm run compile-install-script && docker build --progress plain -f test/test_install_script/alpine3.dockerfile .", "test-install-script-ubuntu": "npm run compile-install-script && docker build --progress plain -f test/test_install_script/ubuntu.dockerfile .", "test-install-script-ubuntu1604": "npm run compile-install-script && docker build --progress plain -f test/test_install_script/ubuntu1604.dockerfile .", + "test-nodejs16": "docker build --progress plain -f test/ubuntu-nodejs16.dockerfile .", "simple-dns-server": "node extra/simple-dns-server.js", - "update-language-files": "cd extra/update-language-files && node index.js %npm_config_base_lang% && eslint ../../src/languages/**.js --fix" + "update-language-files-with-base-lang": "cd extra/update-language-files && node index.js %npm_config_base_lang% && eslint ../../src/languages/**.js --fix", + "update-language-files": "cd extra/update-language-files && node index.js && eslint ../../src/languages/**.js --fix" }, "dependencies": { "@fortawesome/fontawesome-svg-core": "^1.2.36", "@fortawesome/free-regular-svg-icons": "^5.15.4", "@fortawesome/free-solid-svg-icons": "^5.15.4", "@fortawesome/vue-fontawesome": "^3.0.0-4", - "@popperjs/core": "^2.9.3", + "@louislam/sqlite3": "^5.0.6", + "@popperjs/core": "^2.10.1", "args-parser": "^1.3.0", - "axios": "^0.21.1", + "axios": "^0.21.4", "bcryptjs": "^2.4.3", - "bootstrap": "^5.1.0", + "bootstrap": "^5.1.1", "chart.js": "^3.5.1", "chartjs-adapter-dayjs": "^1.0.0", "command-exists": "^1.2.9", "compare-versions": "^3.6.0", - "dayjs": "^1.10.6", + "dayjs": "^1.10.7", "express": "^4.17.1", "express-basic-auth": "^1.2.0", "form-data": "^4.0.0", "http-graceful-shutdown": "^3.1.4", "jsonwebtoken": "^8.5.1", - "nodemailer": "^6.6.3", + "nodemailer": "^6.6.5", "notp": "^2.0.3", "password-hash": "^1.2.2", "prom-client": "^13.2.0", @@ -66,33 +72,37 @@ "redbean-node": "0.1.2", "socket.io": "^4.2.0", "socket.io-client": "^4.2.0", - "sqlite3": "github:mapbox/node-sqlite3#593c9d", "tcp-ping": "^0.1.1", "thirty-two": "^1.0.2", + "timezones-list": "^3.0.1", "v-pagination-3": "^0.1.6", - "vue": "^3.2.8", - "vue-chart-3": "^0.5.7", + "vue": "next", + "vue-chart-3": "^0.5.8", "vue-confirm-dialog": "^1.0.2", + "vue-contenteditable": "^3.0.4", "vue-i18n": "^9.1.7", + "vue-image-crop-upload": "^3.0.3", "vue-multiselect": "^3.0.0-alpha.2", "vue-qrcode": "^1.0.0", "vue-router": "^4.0.11", - "vue-toastification": "^2.0.0-rc.1" + "vue-toastification": "^2.0.0-rc.1", + "vuedraggable": "^4.1.0" }, "devDependencies": { - "@babel/eslint-parser": "^7.15.0", - "@types/bootstrap": "^5.1.2", - "@vitejs/plugin-legacy": "^1.5.2", - "@vitejs/plugin-vue": "^1.6.0", - "@vue/compiler-sfc": "^3.2.6", - "core-js": "^3.17.0", + "@babel/eslint-parser": "^7.15.7", + "@types/bootstrap": "^5.1.6", + "@vitejs/plugin-legacy": "^1.5.3", + "@vitejs/plugin-vue": "^1.9.1", + "@vue/compiler-sfc": "^3.2.16", + "core-js": "^3.18.0", + "cross-env": "^7.0.3", "dns2": "^2.0.1", "eslint": "^7.32.0", - "eslint-plugin-vue": "^7.17.0", - "sass": "^1.38.2", + "eslint-plugin-vue": "^7.18.0", + "sass": "^1.42.1", "stylelint": "^13.13.1", "stylelint-config-standard": "^22.0.0", - "typescript": "^4.4.2", - "vite": "^2.5.3" + "typescript": "^4.4.3", + "vite": "^2.5.10" } } diff --git a/public/icon-192x192.png b/public/icon-192x192.png new file mode 100644 index 0000000..89d60d7 Binary files /dev/null and b/public/icon-192x192.png differ diff --git a/public/icon-512x512.png b/public/icon-512x512.png new file mode 100644 index 0000000..cd3ab77 Binary files /dev/null and b/public/icon-512x512.png differ diff --git a/public/manifest.json b/public/manifest.json new file mode 100644 index 0000000..38e1d17 --- /dev/null +++ b/public/manifest.json @@ -0,0 +1,19 @@ +{ + "name": "Uptime Kuma", + "short_name": "Uptime Kuma", + "start_url": "/", + "background_color": "#fff", + "display": "standalone", + "icons": [ + { + "src": "icon-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icon-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ] +} diff --git a/server/check-version.js b/server/check-version.js index 96e8aec..3ac2eee 100644 --- a/server/check-version.js +++ b/server/check-version.js @@ -18,7 +18,7 @@ exports.startInterval = () => { // For debug if (process.env.TEST_CHECK_VERSION === "1") { - res.data.version = "1000.0.0" + res.data.version = "1000.0.0"; } exports.latestVersion = res.data.version; diff --git a/server/database.js b/server/database.js index 6847c0b..6df07c3 100644 --- a/server/database.js +++ b/server/database.js @@ -3,11 +3,25 @@ const { R } = require("redbean-node"); const { setSetting, setting } = require("./util-server"); const { debug, sleep } = require("../src/util"); const dayjs = require("dayjs"); +const knex = require("knex"); +/** + * Database & App Data Folder + */ class Database { static templatePath = "./db/kuma.db"; + + /** + * Data Dir (Default: ./data) + */ static dataDir; + + /** + * User Upload Dir (Default: ./data/upload) + */ + static uploadDir; + static path; /** @@ -31,6 +45,9 @@ class Database { "patch-setting-value-type.sql": true, "patch-improve-performance.sql": true, "patch-2fa.sql": true, + "patch-add-retry-interval-monitor.sql": true, + "patch-incident-table.sql": true, + "patch-group-table.sql": true, "patch-add-monitor-checks-table.sql": true, } @@ -38,31 +55,57 @@ class Database { * The finally version should be 10 after merged tag feature * @deprecated Use patchList for any new feature */ - static latestVersion = 9; + static latestVersion = 10; static noReject = true; + static init(args) { + // Data Directory (must be end with "/") + Database.dataDir = process.env.DATA_DIR || args["data-dir"] || "./data/"; + Database.path = Database.dataDir + "kuma.db"; + if (! fs.existsSync(Database.dataDir)) { + fs.mkdirSync(Database.dataDir, { recursive: true }); + } + + Database.uploadDir = Database.dataDir + "upload/"; + + if (! fs.existsSync(Database.uploadDir)) { + fs.mkdirSync(Database.uploadDir, { recursive: true }); + } + + console.log(`Data Dir: ${Database.dataDir}`); + } + static async connect() { const acquireConnectionTimeout = 120 * 1000; - R.setup("sqlite", { - filename: Database.path, + const Dialect = require("knex/lib/dialects/sqlite3/index.js"); + Dialect.prototype._driver = () => require("@louislam/sqlite3"); + + const knexInstance = knex({ + client: Dialect, + connection: { + filename: Database.path, + acquireConnectionTimeout: acquireConnectionTimeout, + }, useNullAsDefault: true, - acquireConnectionTimeout: acquireConnectionTimeout, - }, { - min: 1, - max: 1, - idleTimeoutMillis: 120 * 1000, - propagateCreateError: false, - acquireTimeoutMillis: acquireConnectionTimeout, + pool: { + min: 1, + max: 1, + idleTimeoutMillis: 120 * 1000, + propagateCreateError: false, + acquireTimeoutMillis: acquireConnectionTimeout, + } }); + R.setup(knexInstance); + if (process.env.SQL_LOG === "1") { R.debug(true); } // Auto map the model to a bean object - R.freeze(true) + R.freeze(true); await R.autoloadModels("./server/model"); // Change to WAL @@ -72,6 +115,7 @@ class Database { console.log("SQLite config:"); console.log(await R.getAll("PRAGMA journal_mode")); console.log(await R.getAll("PRAGMA cache_size")); + console.log("SQLite Version: " + await R.getCell("SELECT sqlite_version()")); } static async patch() { @@ -89,7 +133,7 @@ class Database { } else if (version > this.latestVersion) { console.info("Warning: Database version is newer than expected"); } else { - console.info("Database patch is needed") + console.info("Database patch is needed"); this.backup(version); @@ -104,11 +148,12 @@ class Database { } } catch (ex) { await Database.close(); - this.restore(); - console.error(ex) - console.error("Start Uptime-Kuma failed due to patch db failed") - console.error("Please submit the bug report if you still encounter the problem after restart: https://github.com/louislam/uptime-kuma/issues") + console.error(ex); + console.error("Start Uptime-Kuma failed due to patch db failed"); + console.error("Please submit the bug report if you still encounter the problem after restart: https://github.com/louislam/uptime-kuma/issues"); + + this.restore(); process.exit(1); } } @@ -133,7 +178,7 @@ class Database { try { for (let sqlFilename in this.patchList) { - await this.patch2Recursion(sqlFilename, databasePatchedFiles) + await this.patch2Recursion(sqlFilename, databasePatchedFiles); } if (this.patched) { @@ -142,11 +187,13 @@ class Database { } catch (ex) { await Database.close(); - this.restore(); - console.error(ex) + console.error(ex); console.error("Start Uptime-Kuma failed due to patch db failed"); console.error("Please submit the bug report if you still encounter the problem after restart: https://github.com/louislam/uptime-kuma/issues"); + + this.restore(); + process.exit(1); } @@ -186,7 +233,7 @@ class Database { console.log(sqlFilename + " is patched successfully"); } else { - console.log(sqlFilename + " is already patched, skip"); + debug(sqlFilename + " is already patched, skip"); } } @@ -204,12 +251,12 @@ class Database { // Remove all comments (--) let lines = text.split("\n"); lines = lines.filter((line) => { - return ! line.startsWith("--") + return ! line.startsWith("--"); }); // Split statements by semicolon // Filter out empty line - text = lines.join("\n") + text = lines.join("\n"); let statements = text.split(";") .map((statement) => { @@ -217,7 +264,7 @@ class Database { }) .filter((statement) => { return statement !== ""; - }) + }); for (let statement of statements) { await R.exec(statement); @@ -263,7 +310,7 @@ class Database { */ static backup(version) { if (! this.backupPath) { - console.info("Backup the db") + console.info("Backup the db"); this.backupPath = this.dataDir + "kuma.db.bak" + version; fs.copyFileSync(Database.path, this.backupPath); diff --git a/server/image-data-uri.js b/server/image-data-uri.js new file mode 100644 index 0000000..3ccaab7 --- /dev/null +++ b/server/image-data-uri.js @@ -0,0 +1,57 @@ +/* + From https://github.com/DiegoZoracKy/image-data-uri/blob/master/lib/image-data-uri.js + Modified with 0 dependencies + */ +let fs = require("fs"); + +let ImageDataURI = (() => { + + function decode(dataURI) { + if (!/data:image\//.test(dataURI)) { + console.log("ImageDataURI :: Error :: It seems that it is not an Image Data URI. Couldn't match \"data:image/\""); + return null; + } + + let regExMatches = dataURI.match("data:(image/.*);base64,(.*)"); + return { + imageType: regExMatches[1], + dataBase64: regExMatches[2], + dataBuffer: new Buffer(regExMatches[2], "base64") + }; + } + + function encode(data, mediaType) { + if (!data || !mediaType) { + console.log("ImageDataURI :: Error :: Missing some of the required params: data, mediaType "); + return null; + } + + mediaType = (/\//.test(mediaType)) ? mediaType : "image/" + mediaType; + let dataBase64 = (Buffer.isBuffer(data)) ? data.toString("base64") : new Buffer(data).toString("base64"); + let dataImgBase64 = "data:" + mediaType + ";base64," + dataBase64; + + return dataImgBase64; + } + + function outputFile(dataURI, filePath) { + filePath = filePath || "./"; + return new Promise((resolve, reject) => { + let imageDecoded = decode(dataURI); + + fs.writeFile(filePath, imageDecoded.dataBuffer, err => { + if (err) { + return reject("ImageDataURI :: Error :: " + JSON.stringify(err, null, 4)); + } + resolve(filePath); + }); + }); + } + + return { + decode: decode, + encode: encode, + outputFile: outputFile, + }; +})(); + +module.exports = ImageDataURI; diff --git a/server/model/group.js b/server/model/group.js new file mode 100644 index 0000000..567f386 --- /dev/null +++ b/server/model/group.js @@ -0,0 +1,34 @@ +const { BeanModel } = require("redbean-node/dist/bean-model"); +const { R } = require("redbean-node"); + +class Group extends BeanModel { + + async toPublicJSON() { + let monitorBeanList = await this.getMonitorList(); + let monitorList = []; + + for (let bean of monitorBeanList) { + monitorList.push(await bean.toPublicJSON()); + } + + return { + id: this.id, + name: this.name, + weight: this.weight, + monitorList, + }; + } + + async getMonitorList() { + return R.convertToBeans("monitor", await R.getAll(` + SELECT monitor.* FROM monitor, monitor_group + WHERE monitor.id = monitor_group.monitor_id + AND group_id = ? + ORDER BY monitor_group.weight + `, [ + this.id, + ])); + } +} + +module.exports = Group; diff --git a/server/model/heartbeat.js b/server/model/heartbeat.js index 5467941..e0a77c0 100644 --- a/server/model/heartbeat.js +++ b/server/model/heartbeat.js @@ -1,8 +1,8 @@ const dayjs = require("dayjs"); -const utc = require("dayjs/plugin/utc") -let timezone = require("dayjs/plugin/timezone") -dayjs.extend(utc) -dayjs.extend(timezone) +const utc = require("dayjs/plugin/utc"); +let timezone = require("dayjs/plugin/timezone"); +dayjs.extend(utc); +dayjs.extend(timezone); const { BeanModel } = require("redbean-node/dist/bean-model"); /** @@ -13,6 +13,15 @@ const { BeanModel } = require("redbean-node/dist/bean-model"); */ class Heartbeat extends BeanModel { + toPublicJSON() { + return { + status: this.status, + time: this.time, + msg: "", // Hide for public + ping: this.ping, + }; + } + toJSON() { return { monitorID: this.monitor_id, diff --git a/server/model/incident.js b/server/model/incident.js new file mode 100644 index 0000000..89c117e --- /dev/null +++ b/server/model/incident.js @@ -0,0 +1,18 @@ +const { BeanModel } = require("redbean-node/dist/bean-model"); + +class Incident extends BeanModel { + + toPublicJSON() { + return { + id: this.id, + style: this.style, + title: this.title, + content: this.content, + pin: this.pin, + createdDate: this.createdDate, + lastUpdatedDate: this.lastUpdatedDate, + }; + } +} + +module.exports = Incident; diff --git a/server/model/monitor.js b/server/model/monitor.js index 89208a3..9a80225 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -1,16 +1,16 @@ const https = require("https"); const dayjs = require("dayjs"); -const utc = require("dayjs/plugin/utc") -let timezone = require("dayjs/plugin/timezone") -dayjs.extend(utc) -dayjs.extend(timezone) +const utc = require("dayjs/plugin/utc"); +let timezone = require("dayjs/plugin/timezone"); +dayjs.extend(utc); +dayjs.extend(timezone); const axios = require("axios"); const { Prometheus } = require("../prometheus"); const { debug, UP, DOWN, PENDING, flipStatus, TimeLogger } = require("../../src/util"); const { tcping, ping, dnsResolve, checkCertificate, checkStatusCode, getTotalClientInRoom } = require("../util-server"); const { R } = require("redbean-node"); const { BeanModel } = require("redbean-node/dist/bean-model"); -const { Notification } = require("../notification") +const { Notification } = require("../notification"); const version = require("../../package.json").version; /** @@ -20,18 +20,35 @@ const version = require("../../package.json").version; * 2 = PENDING */ class Monitor extends BeanModel { + + /** + * Return a object that ready to parse to JSON for public + * Only show necessary data to public + */ + async toPublicJSON() { + return { + id: this.id, + name: this.name, + }; + } + + /** + * Return a object that ready to parse to JSON + */ async toJSON() { let notificationIDList = {}; let list = await R.find("monitor_notification", " monitor_id = ? ", [ this.id, - ]) + ]); for (let bean of list) { notificationIDList[bean.notification_id] = true; } + const tags = await R.getAll("SELECT mt.*, tag.name, tag.color FROM monitor_tag mt JOIN tag ON mt.tag_id = tag.id WHERE mt.monitor_id = ?", [this.id]); + return { id: this.id, name: this.name, @@ -43,6 +60,7 @@ class Monitor extends BeanModel { active: this.active, type: this.type, interval: this.interval, + retryInterval: this.retryInterval, keyword: this.keyword, ignoreTls: this.getIgnoreTls(), upsideDown: this.isUpsideDown(), @@ -52,6 +70,7 @@ class Monitor extends BeanModel { dns_resolve_server: this.dns_resolve_server, dns_last_result: this.dns_last_result, notificationIDList, + tags: tags, }; } @@ -60,7 +79,7 @@ class Monitor extends BeanModel { * @returns {boolean} */ getIgnoreTls() { - return Boolean(this.ignoreTls) + return Boolean(this.ignoreTls); } /** @@ -90,12 +109,12 @@ class Monitor extends BeanModel { if (! previousBeat) { previousBeat = await R.findOne("heartbeat", " monitor_id = ? ORDER BY time DESC", [ this.id, - ]) + ]); } const isFirstBeat = !previousBeat; - let bean = R.dispense("heartbeat") + let bean = R.dispense("heartbeat"); bean.monitor_id = this.id; bean.time = R.isoDateTime(dayjs.utc()); bean.status = DOWN; @@ -131,7 +150,7 @@ class Monitor extends BeanModel { return checkStatusCode(status, this.getAcceptedStatuscodes()); }, }); - bean.msg = `${res.status} - ${res.statusText}` + bean.msg = `${res.status} - ${res.statusText}`; bean.ping = dayjs().valueOf() - startTime; // Check certificate if https is used @@ -141,12 +160,12 @@ class Monitor extends BeanModel { tlsInfo = await this.updateTlsInfo(checkCertificate(res)); } catch (e) { if (e.message !== "No TLS certificate in response") { - console.error(e.message) + console.error(e.message); } } } - debug("Cert Info Query Time: " + (dayjs().valueOf() - certInfoStartTime) + "ms") + debug("Cert Info Query Time: " + (dayjs().valueOf() - certInfoStartTime) + "ms"); if (this.type === "http") { bean.status = UP; @@ -156,26 +175,26 @@ class Monitor extends BeanModel { // Convert to string for object/array if (typeof data !== "string") { - data = JSON.stringify(data) + data = JSON.stringify(data); } if (data.includes(this.keyword)) { - bean.msg += ", keyword is found" + bean.msg += ", keyword is found"; bean.status = UP; } else { - throw new Error(bean.msg + ", but keyword is not found") + throw new Error(bean.msg + ", but keyword is not found"); } } } else if (this.type === "port") { bean.ping = await tcping(this.hostname, this.port); - bean.msg = "" + bean.msg = ""; bean.status = UP; } else if (this.type === "ping") { bean.ping = await ping(this.hostname); - bean.msg = "" + bean.msg = ""; bean.status = UP; } else if (this.type === "dns") { let startTime = dayjs().valueOf(); @@ -195,7 +214,7 @@ class Monitor extends BeanModel { dnsRes.forEach(record => { dnsMessage += `Hostname: ${record.exchange} - Priority: ${record.priority} | `; }); - dnsMessage = dnsMessage.slice(0, -2) + dnsMessage = dnsMessage.slice(0, -2); } else if (this.dns_resolve_type == "NS") { dnsMessage += "Servers: "; dnsMessage += dnsRes.join(" | "); @@ -205,7 +224,7 @@ class Monitor extends BeanModel { dnsRes.forEach(record => { dnsMessage += `Name: ${record.name} | Port: ${record.port} | Priority: ${record.priority} | Weight: ${record.weight} | `; }); - dnsMessage = dnsMessage.slice(0, -2) + dnsMessage = dnsMessage.slice(0, -2); } if (this.dnsLastResult !== dnsMessage) { @@ -268,20 +287,20 @@ class Monitor extends BeanModel { if (!isFirstBeat || bean.status === DOWN) { let notificationList = await R.getAll("SELECT notification.* FROM notification, monitor_notification WHERE monitor_id = ? AND monitor_notification.notification_id = notification.id ", [ this.id, - ]) + ]); let text; if (bean.status === UP) { - text = "✅ Up" + text = "✅ Up"; } else { - text = "🔴 Down" + text = "🔴 Down"; } let msg = `[${this.name}] [${text}] ${bean.msg}`; for (let notification of notificationList) { try { - await Notification.send(JSON.parse(notification.config), msg, await this.toJSON(), bean.toJSON()) + await Notification.send(JSON.parse(notification.config), msg, await this.toJSON(), bean.toJSON()); } catch (e) { console.error("Cannot send notification to " + notification.name); console.log(e); @@ -293,16 +312,21 @@ class Monitor extends BeanModel { bean.important = false; } + let beatInterval = this.interval; + if (bean.status === UP) { - console.info(`Monitor #${this.id} '${this.name}': Successful Response: ${bean.ping} ms | Interval: ${this.interval} seconds | Type: ${this.type}`) + console.info(`Monitor #${this.id} '${this.name}': Successful Response: ${bean.ping} ms | Interval: ${beatInterval} seconds | Type: ${this.type}`); } else if (bean.status === PENDING) { - console.warn(`Monitor #${this.id} '${this.name}': Pending: ${bean.msg} | Max retries: ${this.maxretries} | Type: ${this.type}`) + if (this.retryInterval !== this.interval) { + beatInterval = this.retryInterval; + } + console.warn(`Monitor #${this.id} '${this.name}': Pending: ${bean.msg} | Max retries: ${this.maxretries} | Retry: ${retries} | Retry Interval: ${beatInterval} seconds | Type: ${this.type}`); } else { - console.warn(`Monitor #${this.id} '${this.name}': Failing: ${bean.msg} | Type: ${this.type}`) + console.warn(`Monitor #${this.id} '${this.name}': Failing: ${bean.msg} | Interval: ${beatInterval} seconds | Type: ${this.type}`); } io.to(this.user_id).emit("heartbeat", bean.toJSON()); - Monitor.sendStats(io, this.id, this.user_id) + Monitor.sendStats(io, this.id, this.user_id); await R.store(bean); prometheus.update(bean, tlsInfo); @@ -310,10 +334,10 @@ class Monitor extends BeanModel { previousBeat = bean; if (! this.isStop) { - this.heartbeatInterval = setTimeout(beat, this.interval * 1000); + this.heartbeatInterval = setTimeout(beat, beatInterval * 1000); } - } + }; beat(); } @@ -406,7 +430,7 @@ class Monitor extends BeanModel { * https://www.uptrends.com/support/kb/reporting/calculation-of-uptime-and-downtime * @param duration : int Hours */ - static async sendUptime(duration, io, monitorID, userID) { + static async calcUptime(duration, monitorID) { const timeLogger = new TimeLogger(); const startTime = R.isoDateTime(dayjs.utc().subtract(duration, "hour")); @@ -459,12 +483,21 @@ class Monitor extends BeanModel { } else { // Handle new monitor with only one beat, because the beat's duration = 0 let status = parseInt(await R.getCell("SELECT `status` FROM heartbeat WHERE monitor_id = ?", [ monitorID ])); - console.log("here???" + status); + if (status === UP) { uptime = 1; } } + return uptime; + } + + /** + * Send Uptime + * @param duration : int Hours + */ + static async sendUptime(duration, io, monitorID, userID) { + const uptime = await this.calcUptime(duration, monitorID); io.to(userID).emit("uptime", monitorID, duration, uptime); } } diff --git a/server/model/tag.js b/server/model/tag.js new file mode 100644 index 0000000..748280a --- /dev/null +++ b/server/model/tag.js @@ -0,0 +1,13 @@ +const { BeanModel } = require("redbean-node/dist/bean-model"); + +class Tag extends BeanModel { + toJSON() { + return { + id: this._id, + name: this._name, + color: this._color, + }; + } +} + +module.exports = Tag; diff --git a/server/modules/apicache/apicache.js b/server/modules/apicache/apicache.js new file mode 100644 index 0000000..22d1fed --- /dev/null +++ b/server/modules/apicache/apicache.js @@ -0,0 +1,749 @@ +let url = require("url"); +let MemoryCache = require("./memory-cache"); + +let t = { + ms: 1, + second: 1000, + minute: 60000, + hour: 3600000, + day: 3600000 * 24, + week: 3600000 * 24 * 7, + month: 3600000 * 24 * 30, +}; + +let instances = []; + +let matches = function (a) { + return function (b) { + return a === b; + }; +}; + +let doesntMatch = function (a) { + return function (b) { + return !matches(a)(b); + }; +}; + +let logDuration = function (d, prefix) { + let str = d > 1000 ? (d / 1000).toFixed(2) + "sec" : d + "ms"; + return "\x1b[33m- " + (prefix ? prefix + " " : "") + str + "\x1b[0m"; +}; + +function getSafeHeaders(res) { + return res.getHeaders ? res.getHeaders() : res._headers; +} + +function ApiCache() { + let memCache = new MemoryCache(); + + let globalOptions = { + debug: false, + defaultDuration: 3600000, + enabled: true, + appendKey: [], + jsonp: false, + redisClient: false, + headerBlacklist: [], + statusCodes: { + include: [], + exclude: [], + }, + events: { + expire: undefined, + }, + headers: { + // 'cache-control': 'no-cache' // example of header overwrite + }, + trackPerformance: false, + respectCacheControl: false, + }; + + let middlewareOptions = []; + let instance = this; + let index = null; + let timers = {}; + let performanceArray = []; // for tracking cache hit rate + + instances.push(this); + this.id = instances.length; + + function debug(a, b, c, d) { + let arr = ["\x1b[36m[apicache]\x1b[0m", a, b, c, d].filter(function (arg) { + return arg !== undefined; + }); + let debugEnv = process.env.DEBUG && process.env.DEBUG.split(",").indexOf("apicache") !== -1; + + return (globalOptions.debug || debugEnv) && console.log.apply(null, arr); + } + + function shouldCacheResponse(request, response, toggle) { + let opt = globalOptions; + let codes = opt.statusCodes; + + if (!response) { + return false; + } + + if (toggle && !toggle(request, response)) { + return false; + } + + if (codes.exclude && codes.exclude.length && codes.exclude.indexOf(response.statusCode) !== -1) { + return false; + } + if (codes.include && codes.include.length && codes.include.indexOf(response.statusCode) === -1) { + return false; + } + + return true; + } + + function addIndexEntries(key, req) { + let groupName = req.apicacheGroup; + + if (groupName) { + debug("group detected \"" + groupName + "\""); + let group = (index.groups[groupName] = index.groups[groupName] || []); + group.unshift(key); + } + + index.all.unshift(key); + } + + function filterBlacklistedHeaders(headers) { + return Object.keys(headers) + .filter(function (key) { + return globalOptions.headerBlacklist.indexOf(key) === -1; + }) + .reduce(function (acc, header) { + acc[header] = headers[header]; + return acc; + }, {}); + } + + function createCacheObject(status, headers, data, encoding) { + return { + status: status, + headers: filterBlacklistedHeaders(headers), + data: data, + encoding: encoding, + timestamp: new Date().getTime() / 1000, // seconds since epoch. This is used to properly decrement max-age headers in cached responses. + }; + } + + function cacheResponse(key, value, duration) { + let redis = globalOptions.redisClient; + let expireCallback = globalOptions.events.expire; + + if (redis && redis.connected) { + try { + redis.hset(key, "response", JSON.stringify(value)); + redis.hset(key, "duration", duration); + redis.expire(key, duration / 1000, expireCallback || function () {}); + } catch (err) { + debug("[apicache] error in redis.hset()"); + } + } else { + memCache.add(key, value, duration, expireCallback); + } + + // add automatic cache clearing from duration, includes max limit on setTimeout + timers[key] = setTimeout(function () { + instance.clear(key, true); + }, Math.min(duration, 2147483647)); + } + + function accumulateContent(res, content) { + if (content) { + if (typeof content == "string") { + res._apicache.content = (res._apicache.content || "") + content; + } else if (Buffer.isBuffer(content)) { + let oldContent = res._apicache.content; + + if (typeof oldContent === "string") { + oldContent = !Buffer.from ? new Buffer(oldContent) : Buffer.from(oldContent); + } + + if (!oldContent) { + oldContent = !Buffer.alloc ? new Buffer(0) : Buffer.alloc(0); + } + + res._apicache.content = Buffer.concat( + [oldContent, content], + oldContent.length + content.length + ); + } else { + res._apicache.content = content; + } + } + } + + function makeResponseCacheable(req, res, next, key, duration, strDuration, toggle) { + // monkeypatch res.end to create cache object + res._apicache = { + write: res.write, + writeHead: res.writeHead, + end: res.end, + cacheable: true, + content: undefined, + }; + + // append header overwrites if applicable + Object.keys(globalOptions.headers).forEach(function (name) { + res.setHeader(name, globalOptions.headers[name]); + }); + + res.writeHead = function () { + // add cache control headers + if (!globalOptions.headers["cache-control"]) { + if (shouldCacheResponse(req, res, toggle)) { + res.setHeader("cache-control", "max-age=" + (duration / 1000).toFixed(0)); + } else { + res.setHeader("cache-control", "no-cache, no-store, must-revalidate"); + } + } + + res._apicache.headers = Object.assign({}, getSafeHeaders(res)); + return res._apicache.writeHead.apply(this, arguments); + }; + + // patch res.write + res.write = function (content) { + accumulateContent(res, content); + return res._apicache.write.apply(this, arguments); + }; + + // patch res.end + res.end = function (content, encoding) { + if (shouldCacheResponse(req, res, toggle)) { + accumulateContent(res, content); + + if (res._apicache.cacheable && res._apicache.content) { + addIndexEntries(key, req); + let headers = res._apicache.headers || getSafeHeaders(res); + let cacheObject = createCacheObject( + res.statusCode, + headers, + res._apicache.content, + encoding + ); + cacheResponse(key, cacheObject, duration); + + // display log entry + let elapsed = new Date() - req.apicacheTimer; + debug("adding cache entry for \"" + key + "\" @ " + strDuration, logDuration(elapsed)); + debug("_apicache.headers: ", res._apicache.headers); + debug("res.getHeaders(): ", getSafeHeaders(res)); + debug("cacheObject: ", cacheObject); + } + } + + return res._apicache.end.apply(this, arguments); + }; + + next(); + } + + function sendCachedResponse(request, response, cacheObject, toggle, next, duration) { + if (toggle && !toggle(request, response)) { + return next(); + } + + let headers = getSafeHeaders(response); + + // Modified by @louislam, removed Cache-control, since I don't need client side cache! + // Original Source: https://github.com/kwhitley/apicache/blob/0d5686cc21fad353c6dddee646288c2fca3e4f50/src/apicache.js#L254 + Object.assign(headers, filterBlacklistedHeaders(cacheObject.headers || {})); + + // only embed apicache headers when not in production environment + if (process.env.NODE_ENV !== "production") { + Object.assign(headers, { + "apicache-store": globalOptions.redisClient ? "redis" : "memory", + "apicache-version": "1.6.2-modified", + }); + } + + // unstringify buffers + let data = cacheObject.data; + if (data && data.type === "Buffer") { + data = + typeof data.data === "number" ? new Buffer.alloc(data.data) : new Buffer.from(data.data); + } + + // test Etag against If-None-Match for 304 + let cachedEtag = cacheObject.headers.etag; + let requestEtag = request.headers["if-none-match"]; + + if (requestEtag && cachedEtag === requestEtag) { + response.writeHead(304, headers); + return response.end(); + } + + response.writeHead(cacheObject.status || 200, headers); + + return response.end(data, cacheObject.encoding); + } + + function syncOptions() { + for (let i in middlewareOptions) { + Object.assign(middlewareOptions[i].options, globalOptions, middlewareOptions[i].localOptions); + } + } + + this.clear = function (target, isAutomatic) { + let group = index.groups[target]; + let redis = globalOptions.redisClient; + + if (group) { + debug("clearing group \"" + target + "\""); + + group.forEach(function (key) { + debug("clearing cached entry for \"" + key + "\""); + clearTimeout(timers[key]); + delete timers[key]; + if (!globalOptions.redisClient) { + memCache.delete(key); + } else { + try { + redis.del(key); + } catch (err) { + console.log("[apicache] error in redis.del(\"" + key + "\")"); + } + } + index.all = index.all.filter(doesntMatch(key)); + }); + + delete index.groups[target]; + } else if (target) { + debug("clearing " + (isAutomatic ? "expired" : "cached") + " entry for \"" + target + "\""); + clearTimeout(timers[target]); + delete timers[target]; + // clear actual cached entry + if (!redis) { + memCache.delete(target); + } else { + try { + redis.del(target); + } catch (err) { + console.log("[apicache] error in redis.del(\"" + target + "\")"); + } + } + + // remove from global index + index.all = index.all.filter(doesntMatch(target)); + + // remove target from each group that it may exist in + Object.keys(index.groups).forEach(function (groupName) { + index.groups[groupName] = index.groups[groupName].filter(doesntMatch(target)); + + // delete group if now empty + if (!index.groups[groupName].length) { + delete index.groups[groupName]; + } + }); + } else { + debug("clearing entire index"); + + if (!redis) { + memCache.clear(); + } else { + // clear redis keys one by one from internal index to prevent clearing non-apicache entries + index.all.forEach(function (key) { + clearTimeout(timers[key]); + delete timers[key]; + try { + redis.del(key); + } catch (err) { + console.log("[apicache] error in redis.del(\"" + key + "\")"); + } + }); + } + this.resetIndex(); + } + + return this.getIndex(); + }; + + function parseDuration(duration, defaultDuration) { + if (typeof duration === "number") { + return duration; + } + + if (typeof duration === "string") { + let split = duration.match(/^([\d\.,]+)\s?(\w+)$/); + + if (split.length === 3) { + let len = parseFloat(split[1]); + let unit = split[2].replace(/s$/i, "").toLowerCase(); + if (unit === "m") { + unit = "ms"; + } + + return (len || 1) * (t[unit] || 0); + } + } + + return defaultDuration; + } + + this.getDuration = function (duration) { + return parseDuration(duration, globalOptions.defaultDuration); + }; + + /** + * Return cache performance statistics (hit rate). Suitable for putting into a route: + * + * app.get('/api/cache/performance', (req, res) => { + * res.json(apicache.getPerformance()) + * }) + * + */ + this.getPerformance = function () { + return performanceArray.map(function (p) { + return p.report(); + }); + }; + + this.getIndex = function (group) { + if (group) { + return index.groups[group]; + } else { + return index; + } + }; + + this.middleware = function cache(strDuration, middlewareToggle, localOptions) { + let duration = instance.getDuration(strDuration); + let opt = {}; + + middlewareOptions.push({ + options: opt, + }); + + let options = function (localOptions) { + if (localOptions) { + middlewareOptions.find(function (middleware) { + return middleware.options === opt; + }).localOptions = localOptions; + } + + syncOptions(); + + return opt; + }; + + options(localOptions); + + /** + * A Function for non tracking performance + */ + function NOOPCachePerformance() { + this.report = this.hit = this.miss = function () {}; // noop; + } + + /** + * A function for tracking and reporting hit rate. These statistics are returned by the getPerformance() call above. + */ + function CachePerformance() { + /** + * Tracks the hit rate for the last 100 requests. + * If there have been fewer than 100 requests, the hit rate just considers the requests that have happened. + */ + this.hitsLast100 = new Uint8Array(100 / 4); // each hit is 2 bits + + /** + * Tracks the hit rate for the last 1000 requests. + * If there have been fewer than 1000 requests, the hit rate just considers the requests that have happened. + */ + this.hitsLast1000 = new Uint8Array(1000 / 4); // each hit is 2 bits + + /** + * Tracks the hit rate for the last 10000 requests. + * If there have been fewer than 10000 requests, the hit rate just considers the requests that have happened. + */ + this.hitsLast10000 = new Uint8Array(10000 / 4); // each hit is 2 bits + + /** + * Tracks the hit rate for the last 100000 requests. + * If there have been fewer than 100000 requests, the hit rate just considers the requests that have happened. + */ + this.hitsLast100000 = new Uint8Array(100000 / 4); // each hit is 2 bits + + /** + * The number of calls that have passed through the middleware since the server started. + */ + this.callCount = 0; + + /** + * The total number of hits since the server started + */ + this.hitCount = 0; + + /** + * The key from the last cache hit. This is useful in identifying which route these statistics apply to. + */ + this.lastCacheHit = null; + + /** + * The key from the last cache miss. This is useful in identifying which route these statistics apply to. + */ + this.lastCacheMiss = null; + + /** + * Return performance statistics + */ + this.report = function () { + return { + lastCacheHit: this.lastCacheHit, + lastCacheMiss: this.lastCacheMiss, + callCount: this.callCount, + hitCount: this.hitCount, + missCount: this.callCount - this.hitCount, + hitRate: this.callCount == 0 ? null : this.hitCount / this.callCount, + hitRateLast100: this.hitRate(this.hitsLast100), + hitRateLast1000: this.hitRate(this.hitsLast1000), + hitRateLast10000: this.hitRate(this.hitsLast10000), + hitRateLast100000: this.hitRate(this.hitsLast100000), + }; + }; + + /** + * Computes a cache hit rate from an array of hits and misses. + * @param {Uint8Array} array An array representing hits and misses. + * @returns a number between 0 and 1, or null if the array has no hits or misses + */ + this.hitRate = function (array) { + let hits = 0; + let misses = 0; + for (let i = 0; i < array.length; i++) { + let n8 = array[i]; + for (let j = 0; j < 4; j++) { + switch (n8 & 3) { + case 1: + hits++; + break; + case 2: + misses++; + break; + } + n8 >>= 2; + } + } + let total = hits + misses; + if (total == 0) { + return null; + } + return hits / total; + }; + + /** + * Record a hit or miss in the given array. It will be recorded at a position determined + * by the current value of the callCount variable. + * @param {Uint8Array} array An array representing hits and misses. + * @param {boolean} hit true for a hit, false for a miss + * Each element in the array is 8 bits, and encodes 4 hit/miss records. + * Each hit or miss is encoded as to bits as follows: + * 00 means no hit or miss has been recorded in these bits + * 01 encodes a hit + * 10 encodes a miss + */ + this.recordHitInArray = function (array, hit) { + let arrayIndex = ~~(this.callCount / 4) % array.length; + let bitOffset = (this.callCount % 4) * 2; // 2 bits per record, 4 records per uint8 array element + let clearMask = ~(3 << bitOffset); + let record = (hit ? 1 : 2) << bitOffset; + array[arrayIndex] = (array[arrayIndex] & clearMask) | record; + }; + + /** + * Records the hit or miss in the tracking arrays and increments the call count. + * @param {boolean} hit true records a hit, false records a miss + */ + this.recordHit = function (hit) { + this.recordHitInArray(this.hitsLast100, hit); + this.recordHitInArray(this.hitsLast1000, hit); + this.recordHitInArray(this.hitsLast10000, hit); + this.recordHitInArray(this.hitsLast100000, hit); + if (hit) { + this.hitCount++; + } + this.callCount++; + }; + + /** + * Records a hit event, setting lastCacheMiss to the given key + * @param {string} key The key that had the cache hit + */ + this.hit = function (key) { + this.recordHit(true); + this.lastCacheHit = key; + }; + + /** + * Records a miss event, setting lastCacheMiss to the given key + * @param {string} key The key that had the cache miss + */ + this.miss = function (key) { + this.recordHit(false); + this.lastCacheMiss = key; + }; + } + + let perf = globalOptions.trackPerformance ? new CachePerformance() : new NOOPCachePerformance(); + + performanceArray.push(perf); + + let cache = function (req, res, next) { + function bypass() { + debug("bypass detected, skipping cache."); + return next(); + } + + // initial bypass chances + if (!opt.enabled) { + return bypass(); + } + if ( + req.headers["x-apicache-bypass"] || + req.headers["x-apicache-force-fetch"] || + (opt.respectCacheControl && req.headers["cache-control"] == "no-cache") + ) { + return bypass(); + } + + // REMOVED IN 0.11.1 TO CORRECT MIDDLEWARE TOGGLE EXECUTE ORDER + // if (typeof middlewareToggle === 'function') { + // if (!middlewareToggle(req, res)) return bypass() + // } else if (middlewareToggle !== undefined && !middlewareToggle) { + // return bypass() + // } + + // embed timer + req.apicacheTimer = new Date(); + + // In Express 4.x the url is ambigious based on where a router is mounted. originalUrl will give the full Url + let key = req.originalUrl || req.url; + + // Remove querystring from key if jsonp option is enabled + if (opt.jsonp) { + key = url.parse(key).pathname; + } + + // add appendKey (either custom function or response path) + if (typeof opt.appendKey === "function") { + key += "$$appendKey=" + opt.appendKey(req, res); + } else if (opt.appendKey.length > 0) { + let appendKey = req; + + for (let i = 0; i < opt.appendKey.length; i++) { + appendKey = appendKey[opt.appendKey[i]]; + } + key += "$$appendKey=" + appendKey; + } + + // attempt cache hit + let redis = opt.redisClient; + let cached = !redis ? memCache.getValue(key) : null; + + // send if cache hit from memory-cache + if (cached) { + let elapsed = new Date() - req.apicacheTimer; + debug("sending cached (memory-cache) version of", key, logDuration(elapsed)); + + perf.hit(key); + return sendCachedResponse(req, res, cached, middlewareToggle, next, duration); + } + + // send if cache hit from redis + if (redis && redis.connected) { + try { + redis.hgetall(key, function (err, obj) { + if (!err && obj && obj.response) { + let elapsed = new Date() - req.apicacheTimer; + debug("sending cached (redis) version of", key, logDuration(elapsed)); + + perf.hit(key); + return sendCachedResponse( + req, + res, + JSON.parse(obj.response), + middlewareToggle, + next, + duration + ); + } else { + perf.miss(key); + return makeResponseCacheable( + req, + res, + next, + key, + duration, + strDuration, + middlewareToggle + ); + } + }); + } catch (err) { + // bypass redis on error + perf.miss(key); + return makeResponseCacheable(req, res, next, key, duration, strDuration, middlewareToggle); + } + } else { + perf.miss(key); + return makeResponseCacheable(req, res, next, key, duration, strDuration, middlewareToggle); + } + }; + + cache.options = options; + + return cache; + }; + + this.options = function (options) { + if (options) { + Object.assign(globalOptions, options); + syncOptions(); + + if ("defaultDuration" in options) { + // Convert the default duration to a number in milliseconds (if needed) + globalOptions.defaultDuration = parseDuration(globalOptions.defaultDuration, 3600000); + } + + if (globalOptions.trackPerformance) { + debug("WARNING: using trackPerformance flag can cause high memory usage!"); + } + + return this; + } else { + return globalOptions; + } + }; + + this.resetIndex = function () { + index = { + all: [], + groups: {}, + }; + }; + + this.newInstance = function (config) { + let instance = new ApiCache(); + + if (config) { + instance.options(config); + } + + return instance; + }; + + this.clone = function () { + return this.newInstance(this.options()); + }; + + // initialize index + this.resetIndex(); +} + +module.exports = new ApiCache(); diff --git a/server/modules/apicache/index.js b/server/modules/apicache/index.js new file mode 100644 index 0000000..b8bb9b3 --- /dev/null +++ b/server/modules/apicache/index.js @@ -0,0 +1,14 @@ +const apicache = require("./apicache"); + +apicache.options({ + headerBlacklist: [ + "cache-control" + ], + headers: { + // Disable client side cache, only server side cache. + // BUG! Not working for the second request + "cache-control": "no-cache", + }, +}); + +module.exports = apicache; diff --git a/server/modules/apicache/memory-cache.js b/server/modules/apicache/memory-cache.js new file mode 100644 index 0000000..ad831e2 --- /dev/null +++ b/server/modules/apicache/memory-cache.js @@ -0,0 +1,59 @@ +function MemoryCache() { + this.cache = {}; + this.size = 0; +} + +MemoryCache.prototype.add = function (key, value, time, timeoutCallback) { + let old = this.cache[key]; + let instance = this; + + let entry = { + value: value, + expire: time + Date.now(), + timeout: setTimeout(function () { + instance.delete(key); + return timeoutCallback && typeof timeoutCallback === "function" && timeoutCallback(value, key); + }, time) + }; + + this.cache[key] = entry; + this.size = Object.keys(this.cache).length; + + return entry; +}; + +MemoryCache.prototype.delete = function (key) { + let entry = this.cache[key]; + + if (entry) { + clearTimeout(entry.timeout); + } + + delete this.cache[key]; + + this.size = Object.keys(this.cache).length; + + return null; +}; + +MemoryCache.prototype.get = function (key) { + let entry = this.cache[key]; + + return entry; +}; + +MemoryCache.prototype.getValue = function (key) { + let entry = this.get(key); + + return entry && entry.value; +}; + +MemoryCache.prototype.clear = function () { + Object.keys(this.cache).forEach(function (key) { + this.delete(key); + }, this); + + return true; +}; + +module.exports = MemoryCache; diff --git a/server/notification-providers/discord.js b/server/notification-providers/discord.js index d6ee0af..971c26e 100644 --- a/server/notification-providers/discord.js +++ b/server/notification-providers/discord.js @@ -62,6 +62,11 @@ class Discord extends NotificationProvider { ], }], } + + if (notification.discordPrefixMessage) { + discorddowndata.content = notification.discordPrefixMessage; + } + await axios.post(notification.discordWebhookUrl, discorddowndata) return okMsg; @@ -92,6 +97,11 @@ class Discord extends NotificationProvider { ], }], } + + if (notification.discordPrefixMessage) { + discordupdata.content = notification.discordPrefixMessage; + } + await axios.post(notification.discordWebhookUrl, discordupdata) return okMsg; } diff --git a/server/notification-providers/teams.js b/server/notification-providers/teams.js new file mode 100644 index 0000000..72409ff --- /dev/null +++ b/server/notification-providers/teams.js @@ -0,0 +1,124 @@ +const NotificationProvider = require("./notification-provider"); +const axios = require("axios"); +const { DOWN, UP } = require("../../src/util"); + +class Teams extends NotificationProvider { + name = "teams"; + + _statusMessageFactory = (status, monitorName) => { + if (status === DOWN) { + return `🔴 Application [${monitorName}] went down`; + } else if (status === UP) { + return `✅ Application [${monitorName}] is back online`; + } + return "Notification"; + }; + + _getThemeColor = (status) => { + if (status === DOWN) { + return "ff0000"; + } + if (status === UP) { + return "00e804"; + } + return "008cff"; + }; + + _notificationPayloadFactory = ({ + status, + monitorMessage, + monitorName, + monitorUrl, + }) => { + const notificationMessage = this._statusMessageFactory( + status, + monitorName + ); + + const facts = []; + + if (monitorName) { + facts.push({ + name: "Monitor", + value: monitorName, + }); + } + + if (monitorUrl) { + facts.push({ + name: "URL", + value: monitorUrl, + }); + } + + return { + "@context": "https://schema.org/extensions", + "@type": "MessageCard", + themeColor: this._getThemeColor(status), + summary: notificationMessage, + sections: [ + { + activityImage: + "https://raw.githubusercontent.com/louislam/uptime-kuma/master/public/icon.png", + activityTitle: "**Uptime Kuma**", + }, + { + activityTitle: notificationMessage, + }, + { + activityTitle: "**Description**", + text: monitorMessage, + facts, + }, + ], + }; + }; + + _sendNotification = async (webhookUrl, payload) => { + await axios.post(webhookUrl, payload); + }; + + _handleGeneralNotification = (webhookUrl, msg) => { + const payload = this._notificationPayloadFactory({ + monitorMessage: msg + }); + + return this._sendNotification(webhookUrl, payload); + }; + + async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { + let okMsg = "Sent Successfully. "; + + try { + if (heartbeatJSON == null) { + await this._handleGeneralNotification(notification.webhookUrl, msg); + return okMsg; + } + + let url; + + if (monitorJSON["type"] === "port") { + url = monitorJSON["hostname"]; + if (monitorJSON["port"]) { + url += ":" + monitorJSON["port"]; + } + } else { + url = monitorJSON["url"]; + } + + const payload = this._notificationPayloadFactory({ + monitorMessage: heartbeatJSON.msg, + monitorName: monitorJSON.name, + monitorUrl: url, + status: heartbeatJSON.status, + }); + + await this._sendNotification(notification.webhookUrl, payload); + return okMsg; + } catch (error) { + this.throwGeneralAxiosError(error); + } + } +} + +module.exports = Teams; diff --git a/server/notification.js b/server/notification.js index 83dabc5..1344724 100644 --- a/server/notification.js +++ b/server/notification.js @@ -13,6 +13,7 @@ const RocketChat = require("./notification-providers/rocket-chat"); const Signal = require("./notification-providers/signal"); const Slack = require("./notification-providers/slack"); const SMTP = require("./notification-providers/smtp"); +const Teams = require("./notification-providers/teams"); const Telegram = require("./notification-providers/telegram"); const Webhook = require("./notification-providers/webhook"); @@ -28,6 +29,7 @@ class Notification { const list = [ new Apprise(), new Discord(), + new Teams(), new Gotify(), new Line(), new LunaSea(), diff --git a/server/routers/api-router.js b/server/routers/api-router.js new file mode 100644 index 0000000..b56efcb --- /dev/null +++ b/server/routers/api-router.js @@ -0,0 +1,151 @@ +let express = require("express"); +const { allowDevAllOrigin, getSettings, setting } = require("../util-server"); +const { R } = require("redbean-node"); +const server = require("../server"); +const apicache = require("../modules/apicache"); +const Monitor = require("../model/monitor"); +let router = express.Router(); + +let cache = apicache.middleware; + +router.get("/api/entry-page", async (_, response) => { + allowDevAllOrigin(response); + response.json(server.entryPage); +}); + +// Status Page Config +router.get("/api/status-page/config", async (_request, response) => { + allowDevAllOrigin(response); + + let config = await getSettings("statusPage"); + + if (! config.statusPageTheme) { + config.statusPageTheme = "light"; + } + + if (! config.statusPagePublished) { + config.statusPagePublished = true; + } + + if (! config.title) { + config.title = "Uptime Kuma"; + } + + response.json(config); +}); + +// Status Page - Get the current Incident +// Can fetch only if published +router.get("/api/status-page/incident", async (_, response) => { + allowDevAllOrigin(response); + + try { + await checkPublished(); + + let incident = await R.findOne("incident", " pin = 1 AND active = 1"); + + if (incident) { + incident = incident.toPublicJSON(); + } + + response.json({ + ok: true, + incident, + }); + + } catch (error) { + send403(response, error.message); + } +}); + +// Status Page - Monitor List +// Can fetch only if published +router.get("/api/status-page/monitor-list", cache("5 minutes"), async (_request, response) => { + allowDevAllOrigin(response); + + try { + await checkPublished(); + const publicGroupList = []; + let list = await R.find("group", " public = 1 ORDER BY weight "); + + for (let groupBean of list) { + publicGroupList.push(await groupBean.toPublicJSON()); + } + + response.json(publicGroupList); + + } catch (error) { + send403(response, error.message); + } +}); + +// Status Page Polling Data +// Can fetch only if published +router.get("/api/status-page/heartbeat", cache("5 minutes"), async (_request, response) => { + allowDevAllOrigin(response); + + try { + await checkPublished(); + + let heartbeatList = {}; + let uptimeList = {}; + + let monitorIDList = await R.getCol(` + SELECT monitor_group.monitor_id FROM monitor_group, \`group\` + WHERE monitor_group.group_id = \`group\`.id + AND public = 1 + `); + + for (let monitorID of monitorIDList) { + let list = await R.getAll(` + SELECT * FROM heartbeat + WHERE monitor_id = ? + ORDER BY time DESC + LIMIT 50 + `, [ + monitorID, + ]); + + list = R.convertToBeans("heartbeat", list); + heartbeatList[monitorID] = list.reverse().map(row => row.toPublicJSON()); + + const type = 24; + uptimeList[`${monitorID}_${type}`] = await Monitor.calcUptime(type, monitorID); + } + + response.json({ + heartbeatList, + uptimeList + }); + + } catch (error) { + send403(response, error.message); + } +}); + +async function checkPublished() { + if (! await isPublished()) { + throw new Error("The status page is not published"); + } +} + +/** + * Default is published + * @returns {Promise} + */ +async function isPublished() { + const value = await setting("statusPagePublished"); + if (value === null) { + return true; + } + return value; +} + +function send403(res, msg = "") { + res.status(403).json({ + "status": "fail", + "msg": msg, + }); +} + +module.exports = router; diff --git a/server/server.js b/server/server.js index a0b9a2f..f5a8b16 100644 --- a/server/server.js +++ b/server/server.js @@ -1,14 +1,19 @@ console.log("Welcome to Uptime Kuma"); + +if (! process.env.NODE_ENV) { + process.env.NODE_ENV = "production"; +} + console.log("Node Env: " + process.env.NODE_ENV); const { sleep, debug, TimeLogger, getRandomInt } = require("../src/util"); -console.log("Importing Node libraries") +console.log("Importing Node libraries"); const fs = require("fs"); const http = require("http"); const https = require("https"); -console.log("Importing 3rd-party libraries") +console.log("Importing 3rd-party libraries"); debug("Importing express"); const express = require("express"); debug("Importing socket.io"); @@ -21,6 +26,8 @@ debug("Importing http-graceful-shutdown"); const gracefulShutdown = require("http-graceful-shutdown"); debug("Importing prometheus-api-metrics"); const prometheusAPIMetrics = require("prometheus-api-metrics"); +debug("Importing compare-versions"); +const compareVersions = require("compare-versions"); debug("Importing 2FA Modules"); const notp = require("notp"); @@ -30,7 +37,7 @@ console.log("Importing this project modules"); debug("Importing Monitor"); const Monitor = require("./model/monitor"); debug("Importing Settings"); -const { getSettings, setSettings, setting, initJWTSecret, genSecret } = require("./util-server"); +const { getSettings, setSettings, setting, initJWTSecret, genSecret, allowDevAllOrigin, checkLogin } = require("./util-server"); debug("Importing Notification"); const { Notification } = require("./notification"); @@ -64,14 +71,6 @@ if (demoMode) { console.log("==== Demo Mode ===="); } -// Data Directory (must be end with "/") -Database.dataDir = process.env.DATA_DIR || args["data-dir"] || "./data/"; -Database.path = Database.dataDir + "kuma.db"; -if (! fs.existsSync(Database.dataDir)) { - fs.mkdirSync(Database.dataDir, { recursive: true }); -} -console.log(`Data Dir: ${Database.dataDir}`); - console.log("Creating express and socket.io instance") const app = express(); @@ -93,6 +92,7 @@ module.exports.io = io; // Must be after io instantiation const { sendNotificationList, sendHeartbeatList, sendImportantHeartbeatList } = require("./client"); +const { statusPageSocketHandler } = require("./socket-handlers/status-page-socket-handler"); app.use(express.json()); @@ -126,12 +126,19 @@ let needSetup = false; */ let indexHTML = fs.readFileSync("./dist/index.html").toString(); +exports.entryPage = "dashboard"; + (async () => { + Database.init(args); await initDatabase(); - console.log("Adding route") + exports.entryPage = await setting("entryPage"); + console.log("Adding route"); + + // *************************** // Normal Router here + // *************************** // Robots.txt app.get("/robots.txt", async (_request, response) => { @@ -151,24 +158,39 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); app.use("/", express.static("dist")); - // Universal Route Handler, must be at the end + // ./data/upload + app.use("/upload", express.static(Database.uploadDir)); + + app.get("/.well-known/change-password", async (_, response) => { + response.redirect("https://github.com/louislam/uptime-kuma/wiki/Reset-Password-via-CLI"); + }); + + // API Router + const apiRouter = require("./routers/api-router"); + app.use(apiRouter); + + // Universal Route Handler, must be at the end of all express route. app.get("*", async (_request, response) => { - response.send(indexHTML); + if (_request.originalUrl.startsWith("/upload/")) { + response.status(404).send("File not found."); + } else { + response.send(indexHTML); + } }); - console.log("Adding socket handler") + console.log("Adding socket handler"); io.on("connection", async (socket) => { socket.emit("info", { version: checkVersion.version, latestVersion: checkVersion.latestVersion, - }) + }); totalClient++; if (needSetup) { - console.log("Redirect to setup page") - socket.emit("setup") + console.log("Redirect to setup page"); + socket.emit("setup"); } socket.on("disconnect", () => { @@ -176,7 +198,7 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); }); // *************************** - // Public API + // Public Socket API // *************************** socket.on("loginByToken", async (token, callback) => { @@ -184,44 +206,44 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); try { let decoded = jwt.verify(token, jwtSecret); - console.log("Username from JWT: " + decoded.username) + console.log("Username from JWT: " + decoded.username); let user = await R.findOne("user", " username = ? AND active = 1 ", [ decoded.username, - ]) + ]); if (user) { - debug("afterLogin") + debug("afterLogin"); - afterLogin(socket, user) + afterLogin(socket, user); - debug("afterLogin ok") + debug("afterLogin ok"); callback({ ok: true, - }) + }); } else { callback({ ok: false, msg: "The user is inactive or deleted.", - }) + }); } } catch (error) { callback({ ok: false, msg: "Invalid token.", - }) + }); } }); socket.on("login", async (data, callback) => { - console.log("Login") + console.log("Login"); - let user = await login(data.username, data.password) + let user = await login(data.username, data.password); if (user) { - afterLogin(socket, user) + afterLogin(socket, user); if (user.twofaStatus == 0) { callback({ @@ -229,13 +251,13 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); token: jwt.sign({ username: data.username, }, jwtSecret), - }) + }); } if (user.twofaStatus == 1 && !data.token) { callback({ tokenRequired: true, - }) + }); } if (data.token) { @@ -247,39 +269,39 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); token: jwt.sign({ username: data.username, }, jwtSecret), - }) + }); } else { callback({ ok: false, msg: "Invalid Token!", - }) + }); } } } else { callback({ ok: false, msg: "Incorrect username or password.", - }) + }); } }); socket.on("logout", async (callback) => { - socket.leave(socket.userID) + socket.leave(socket.userID); socket.userID = null; callback(); }); socket.on("prepare2FA", async (callback) => { try { - checkLogin(socket) + checkLogin(socket); let user = await R.findOne("user", " id = ? AND active = 1 ", [ socket.userID, - ]) + ]); if (user.twofa_status == 0) { - let newSecret = await genSecret() + let newSecret = await genSecret(); let encodedSecret = base32.encode(newSecret); let uri = `otpauth://totp/Uptime%20Kuma:${user.username}?secret=${encodedSecret}`; @@ -291,24 +313,24 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); callback({ ok: true, uri: uri, - }) + }); } else { callback({ ok: false, msg: "2FA is already enabled.", - }) + }); } } catch (error) { callback({ ok: false, msg: "Error while trying to prepare 2FA.", - }) + }); } }); socket.on("save2FA", async (callback) => { try { - checkLogin(socket) + checkLogin(socket); await R.exec("UPDATE `user` SET twofa_status = 1 WHERE id = ? ", [ socket.userID, @@ -317,18 +339,18 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); callback({ ok: true, msg: "2FA Enabled.", - }) + }); } catch (error) { callback({ ok: false, msg: "Error while trying to change 2FA.", - }) + }); } }); socket.on("disable2FA", async (callback) => { try { - checkLogin(socket) + checkLogin(socket); await R.exec("UPDATE `user` SET twofa_status = 0 WHERE id = ? ", [ socket.userID, @@ -337,19 +359,19 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); callback({ ok: true, msg: "2FA Disabled.", - }) + }); } catch (error) { callback({ ok: false, msg: "Error while trying to change 2FA.", - }) + }); } }); socket.on("verifyToken", async (token, callback) => { let user = await R.findOne("user", " id = ? AND active = 1 ", [ socket.userID, - ]) + ]); let verify = notp.totp.verify(token, user.twofa_secret); @@ -357,40 +379,40 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); callback({ ok: true, valid: true, - }) + }); } else { callback({ ok: false, msg: "Invalid Token.", valid: false, - }) + }); } }); socket.on("twoFAStatus", async (callback) => { - checkLogin(socket) + checkLogin(socket); try { let user = await R.findOne("user", " id = ? AND active = 1 ", [ socket.userID, - ]) + ]); if (user.twofa_status == 1) { callback({ ok: true, status: true, - }) + }); } else { callback({ ok: true, status: false, - }) + }); } } catch (error) { callback({ ok: false, msg: "Error while trying to get 2FA status.", - }) + }); } }); @@ -401,13 +423,13 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); socket.on("setup", async (username, password, callback) => { try { if ((await R.count("user")) !== 0) { - throw new Error("Uptime Kuma has been setup. If you want to setup again, please delete the database.") + throw new Error("Uptime Kuma has been setup. If you want to setup again, please delete the database."); } - let user = R.dispense("user") + let user = R.dispense("user"); user.username = username; - user.password = passwordHash.generate(password) - await R.store(user) + user.password = passwordHash.generate(password); + await R.store(user); needSetup = false; @@ -431,8 +453,8 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); // Add a new monitor socket.on("add", async (monitor, callback) => { try { - checkLogin(socket) - let bean = R.dispense("monitor") + checkLogin(socket); + let bean = R.dispense("monitor"); let notificationIDList = monitor.notificationIDList; delete monitor.notificationIDList; @@ -440,11 +462,11 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); monitor.accepted_statuscodes_json = JSON.stringify(monitor.accepted_statuscodes); delete monitor.accepted_statuscodes; - bean.import(monitor) - bean.user_id = socket.userID - await R.store(bean) + bean.import(monitor); + bean.user_id = socket.userID; + await R.store(bean); - await updateMonitorNotification(bean.id, notificationIDList) + await updateMonitorNotification(bean.id, notificationIDList); await startMonitor(socket.userID, bean.id); await sendMonitorList(socket); @@ -466,18 +488,19 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); // Edit a monitor socket.on("editMonitor", async (monitor, callback) => { try { - checkLogin(socket) + checkLogin(socket); - let bean = await R.findOne("monitor", " id = ? ", [ monitor.id ]) + let bean = await R.findOne("monitor", " id = ? ", [ monitor.id ]); if (bean.user_id !== socket.userID) { - throw new Error("Permission denied.") + throw new Error("Permission denied."); } - bean.name = monitor.name - bean.type = monitor.type - bean.url = monitor.url - bean.interval = monitor.interval + bean.name = monitor.name; + bean.type = monitor.type; + bean.url = monitor.url; + bean.interval = monitor.interval; + bean.retryInterval = monitor.retryInterval; bean.hostname = monitor.hostname; bean.maxretries = monitor.maxretries; bean.port = monitor.port; @@ -489,12 +512,12 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); bean.dns_resolve_type = monitor.dns_resolve_type; bean.dns_resolve_server = monitor.dns_resolve_server; - await R.store(bean) + await R.store(bean); - await updateMonitorNotification(bean.id, monitor.notificationIDList) + await updateMonitorNotification(bean.id, monitor.notificationIDList); if (bean.active) { - await restartMonitor(socket.userID, bean.id) + await restartMonitor(socket.userID, bean.id); } await sendMonitorList(socket); @@ -506,7 +529,23 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); }); } catch (e) { - console.error(e) + console.error(e); + callback({ + ok: false, + msg: e.message, + }); + } + }); + + socket.on("getMonitorList", async (callback) => { + try { + checkLogin(socket); + await sendMonitorList(socket); + callback({ + ok: true, + }); + } catch (e) { + console.error(e); callback({ ok: false, msg: e.message, @@ -516,14 +555,14 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); socket.on("getMonitor", async (monitorID, callback) => { try { - checkLogin(socket) + checkLogin(socket); - console.log(`Get Monitor: ${monitorID} User ID: ${socket.userID}`) + console.log(`Get Monitor: ${monitorID} User ID: ${socket.userID}`); let bean = await R.findOne("monitor", " id = ? AND user_id = ? ", [ monitorID, socket.userID, - ]) + ]); callback({ ok: true, @@ -541,7 +580,7 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); // Start or Resume the monitor socket.on("resumeMonitor", async (monitorID, callback) => { try { - checkLogin(socket) + checkLogin(socket); await startMonitor(socket.userID, monitorID); await sendMonitorList(socket); @@ -560,8 +599,8 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); socket.on("pauseMonitor", async (monitorID, callback) => { try { - checkLogin(socket) - await pauseMonitor(socket.userID, monitorID) + checkLogin(socket); + await pauseMonitor(socket.userID, monitorID); await sendMonitorList(socket); callback({ @@ -579,13 +618,13 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); socket.on("deleteMonitor", async (monitorID, callback) => { try { - checkLogin(socket) + checkLogin(socket); - console.log(`Delete Monitor: ${monitorID} User ID: ${socket.userID}`) + console.log(`Delete Monitor: ${monitorID} User ID: ${socket.userID}`); if (monitorID in monitorList) { monitorList[monitorID].stop(); - delete monitorList[monitorID] + delete monitorList[monitorID]; } await R.exec("DELETE FROM monitor WHERE id = ? AND user_id = ? ", [ @@ -608,17 +647,171 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); } }); + socket.on("getTags", async (callback) => { + try { + checkLogin(socket); + + const list = await R.findAll("tag"); + + callback({ + ok: true, + tags: list.map(bean => bean.toJSON()), + }); + + } catch (e) { + callback({ + ok: false, + msg: e.message, + }); + } + }); + + socket.on("addTag", async (tag, callback) => { + try { + checkLogin(socket); + + let bean = R.dispense("tag"); + bean.name = tag.name; + bean.color = tag.color; + await R.store(bean); + + callback({ + ok: true, + tag: await bean.toJSON(), + }); + + } catch (e) { + callback({ + ok: false, + msg: e.message, + }); + } + }); + + socket.on("editTag", async (tag, callback) => { + try { + checkLogin(socket); + + let bean = await R.findOne("monitor", " id = ? ", [ tag.id ]); + bean.name = tag.name; + bean.color = tag.color; + await R.store(bean); + + callback({ + ok: true, + tag: await bean.toJSON(), + }); + + } catch (e) { + callback({ + ok: false, + msg: e.message, + }); + } + }); + + socket.on("deleteTag", async (tagID, callback) => { + try { + checkLogin(socket); + + await R.exec("DELETE FROM tag WHERE id = ? ", [ tagID ]); + + callback({ + ok: true, + msg: "Deleted Successfully.", + }); + + } catch (e) { + callback({ + ok: false, + msg: e.message, + }); + } + }); + + socket.on("addMonitorTag", async (tagID, monitorID, value, callback) => { + try { + checkLogin(socket); + + await R.exec("INSERT INTO monitor_tag (tag_id, monitor_id, value) VALUES (?, ?, ?)", [ + tagID, + monitorID, + value, + ]); + + callback({ + ok: true, + msg: "Added Successfully.", + }); + + } catch (e) { + callback({ + ok: false, + msg: e.message, + }); + } + }); + + socket.on("editMonitorTag", async (tagID, monitorID, value, callback) => { + try { + checkLogin(socket); + + await R.exec("UPDATE monitor_tag SET value = ? WHERE tag_id = ? AND monitor_id = ?", [ + value, + tagID, + monitorID, + ]); + + callback({ + ok: true, + msg: "Edited Successfully.", + }); + + } catch (e) { + callback({ + ok: false, + msg: e.message, + }); + } + }); + + socket.on("deleteMonitorTag", async (tagID, monitorID, value, callback) => { + try { + checkLogin(socket); + + await R.exec("DELETE FROM monitor_tag WHERE tag_id = ? AND monitor_id = ? AND value = ?", [ + tagID, + monitorID, + value, + ]); + + // Cleanup unused Tags + await R.exec("delete from tag where ( select count(*) from monitor_tag mt where tag.id = mt.tag_id ) = 0"); + + callback({ + ok: true, + msg: "Deleted Successfully.", + }); + + } catch (e) { + callback({ + ok: false, + msg: e.message, + }); + } + }); + socket.on("changePassword", async (password, callback) => { try { - checkLogin(socket) + checkLogin(socket); if (! password.currentPassword) { - throw new Error("Invalid new password") + throw new Error("Invalid new password"); } let user = await R.findOne("user", " id = ? AND active = 1 ", [ socket.userID, - ]) + ]); if (user && passwordHash.verify(password.currentPassword, user.password)) { @@ -627,9 +820,9 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); callback({ ok: true, msg: "Password has been updated successfully.", - }) + }); } else { - throw new Error("Incorrect current password") + throw new Error("Incorrect current password"); } } catch (e) { @@ -642,7 +835,7 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); socket.on("getSettings", async (callback) => { try { - checkLogin(socket) + checkLogin(socket); callback({ ok: true, @@ -659,9 +852,10 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); socket.on("setSettings", async (data, callback) => { try { - checkLogin(socket) + checkLogin(socket); - await setSettings("general", data) + await setSettings("general", data); + exports.entryPage = data.entryPage; callback({ ok: true, @@ -679,10 +873,10 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); // Add or Edit socket.on("addNotification", async (notification, notificationID, callback) => { try { - checkLogin(socket) + checkLogin(socket); - let notificationBean = await Notification.save(notification, notificationID, socket.userID) - await sendNotificationList(socket) + let notificationBean = await Notification.save(notification, notificationID, socket.userID); + await sendNotificationList(socket); callback({ ok: true, @@ -700,10 +894,10 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); socket.on("deleteNotification", async (notificationID, callback) => { try { - checkLogin(socket) + checkLogin(socket); - await Notification.delete(notificationID, socket.userID) - await sendNotificationList(socket) + await Notification.delete(notificationID, socket.userID); + await sendNotificationList(socket); callback({ ok: true, @@ -720,9 +914,9 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); socket.on("testNotification", async (notification, callback) => { try { - checkLogin(socket) + checkLogin(socket); - let msg = await Notification.send(notification, notification.name + " Testing") + let msg = await Notification.send(notification, notification.name + " Testing"); callback({ ok: true, @@ -730,7 +924,7 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); }); } catch (e) { - console.error(e) + console.error(e); callback({ ok: false, @@ -741,73 +935,164 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); socket.on("checkApprise", async (callback) => { try { - checkLogin(socket) + checkLogin(socket); callback(Notification.checkApprise()); } catch (e) { callback(false); } }); - socket.on("uploadBackup", async (uploadedJSON, callback) => { + socket.on("uploadBackup", async (uploadedJSON, importHandle, callback) => { try { - checkLogin(socket) + checkLogin(socket); let backupData = JSON.parse(uploadedJSON); - console.log(`Importing Backup, User ID: ${socket.userID}, Version: ${backupData.version}`) + console.log(`Importing Backup, User ID: ${socket.userID}, Version: ${backupData.version}`); + + let notificationListData = backupData.notificationList; + let monitorListData = backupData.monitorList; - let notificationList = backupData.notificationList; - let monitorList = backupData.monitorList; + let version17x = compareVersions.compare(backupData.version, "1.7.0", ">="); - if (notificationList.length >= 1) { - for (let i = 0; i < notificationList.length; i++) { - let notification = JSON.parse(notificationList[i].config); - await Notification.save(notification, null, socket.userID) + // If the import option is "overwrite" it'll clear most of the tables, except "settings" and "user" + if (importHandle == "overwrite") { + // Stops every monitor first, so it doesn't execute any heartbeat while importing + for (let id in monitorList) { + let monitor = monitorList[id]; + await monitor.stop(); } + await R.exec("DELETE FROM heartbeat"); + await R.exec("DELETE FROM monitor_notification"); + await R.exec("DELETE FROM monitor_tls_info"); + await R.exec("DELETE FROM notification"); + await R.exec("DELETE FROM monitor_tag"); + await R.exec("DELETE FROM tag"); + await R.exec("DELETE FROM monitor"); } - if (monitorList.length >= 1) { - for (let i = 0; i < monitorList.length; i++) { - let monitor = { - name: monitorList[i].name, - type: monitorList[i].type, - url: monitorList[i].url, - interval: monitorList[i].interval, - hostname: monitorList[i].hostname, - maxretries: monitorList[i].maxretries, - port: monitorList[i].port, - keyword: monitorList[i].keyword, - ignoreTls: monitorList[i].ignoreTls, - upsideDown: monitorList[i].upsideDown, - maxredirects: monitorList[i].maxredirects, - accepted_statuscodes: monitorList[i].accepted_statuscodes, - dns_resolve_type: monitorList[i].dns_resolve_type, - dns_resolve_server: monitorList[i].dns_resolve_server, - notificationIDList: {}, - } + // Only starts importing if the backup file contains at least one notification + if (notificationListData.length >= 1) { + // Get every existing notification name and puts them in one simple string + let notificationNameList = await R.getAll("SELECT name FROM notification"); + let notificationNameListString = JSON.stringify(notificationNameList); - let bean = R.dispense("monitor") + for (let i = 0; i < notificationListData.length; i++) { + // Only starts importing the notification if the import option is "overwrite", "keep" or "skip" but the notification doesn't exists + if ((importHandle == "skip" && notificationNameListString.includes(notificationListData[i].name) == false) || importHandle == "keep" || importHandle == "overwrite") { - let notificationIDList = monitor.notificationIDList; - delete monitor.notificationIDList; + let notification = JSON.parse(notificationListData[i].config); + await Notification.save(notification, null, socket.userID); - monitor.accepted_statuscodes_json = JSON.stringify(monitor.accepted_statuscodes); - delete monitor.accepted_statuscodes; - - bean.import(monitor) - bean.user_id = socket.userID - await R.store(bean) + } + } + } - await updateMonitorNotification(bean.id, notificationIDList) + // Only starts importing if the backup file contains at least one monitor + if (monitorListData.length >= 1) { + // Get every existing monitor name and puts them in one simple string + let monitorNameList = await R.getAll("SELECT name FROM monitor"); + let monitorNameListString = JSON.stringify(monitorNameList); + + for (let i = 0; i < monitorListData.length; i++) { + // Only starts importing the monitor if the import option is "overwrite", "keep" or "skip" but the notification doesn't exists + if ((importHandle == "skip" && monitorNameListString.includes(monitorListData[i].name) == false) || importHandle == "keep" || importHandle == "overwrite") { + + // Define in here every new variable for monitors which where implemented after the first version of the Import/Export function (1.6.0) + // --- Start --- + + // Define default values + let retryInterval = 0; + + /* + Only replace the default value with the backup file data for the specific version, where it appears the first time + More information about that where "let version" will be defined + */ + if (version17x) { + retryInterval = monitorListData[i].retryInterval; + } + + // --- End --- + + let monitor = { + // Define the new variable from earlier here + name: monitorListData[i].name, + type: monitorListData[i].type, + url: monitorListData[i].url, + interval: monitorListData[i].interval, + retryInterval: retryInterval, + hostname: monitorListData[i].hostname, + maxretries: monitorListData[i].maxretries, + port: monitorListData[i].port, + keyword: monitorListData[i].keyword, + ignoreTls: monitorListData[i].ignoreTls, + upsideDown: monitorListData[i].upsideDown, + maxredirects: monitorListData[i].maxredirects, + accepted_statuscodes: monitorListData[i].accepted_statuscodes, + dns_resolve_type: monitorListData[i].dns_resolve_type, + dns_resolve_server: monitorListData[i].dns_resolve_server, + notificationIDList: {}, + }; + + let bean = R.dispense("monitor"); + + let notificationIDList = monitor.notificationIDList; + delete monitor.notificationIDList; + + monitor.accepted_statuscodes_json = JSON.stringify(monitor.accepted_statuscodes); + delete monitor.accepted_statuscodes; + + bean.import(monitor); + bean.user_id = socket.userID; + await R.store(bean); + + // Only for backup files with the version 1.7.0 or higher, since there was the tag feature implemented + if (version17x) { + // Only import if the specific monitor has tags assigned + for (const oldTag of monitorListData[i].tags) { + + // Check if tag already exists and get data -> + let tag = await R.findOne("tag", " name = ?", [ + oldTag.name, + ]); + + let tagId; + if (! tag) { + // -> If it doesn't exist, create new tag from backup file + let beanTag = R.dispense("tag"); + beanTag.name = oldTag.name; + beanTag.color = oldTag.color; + await R.store(beanTag); + + tagId = beanTag.id; + } else { + // -> If it already exist, set tagId to value from database + tagId = tag.id; + } + + // Assign the new created tag to the monitor + await R.exec("INSERT INTO monitor_tag (tag_id, monitor_id, value) VALUES (?, ?, ?)", [ + tagId, + bean.id, + oldTag.value, + ]); + + } + } + + await updateMonitorNotification(bean.id, notificationIDList); + + // If monitor was active start it immediately, otherwise pause it + if (monitorListData[i].active == 1) { + await startMonitor(socket.userID, bean.id); + } else { + await pauseMonitor(socket.userID, bean.id); + } - if (monitorList[i].active == 1) { - await startMonitor(socket.userID, bean.id); - } else { - await pauseMonitor(socket.userID, bean.id); } } - await sendNotificationList(socket) + await sendNotificationList(socket); await sendMonitorList(socket); } @@ -826,9 +1111,9 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); socket.on("clearEvents", async (monitorID, callback) => { try { - checkLogin(socket) + checkLogin(socket); - console.log(`Clear Events Monitor: ${monitorID} User ID: ${socket.userID}`) + console.log(`Clear Events Monitor: ${monitorID} User ID: ${socket.userID}`); await R.exec("UPDATE heartbeat SET msg = ?, important = ? WHERE monitor_id = ? ", [ "", @@ -852,9 +1137,9 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); socket.on("clearHeartbeats", async (monitorID, callback) => { try { - checkLogin(socket) + checkLogin(socket); - console.log(`Clear Heartbeats Monitor: ${monitorID} User ID: ${socket.userID}`) + console.log(`Clear Heartbeats Monitor: ${monitorID} User ID: ${socket.userID}`); await R.exec("DELETE FROM heartbeat WHERE monitor_id = ?", [ monitorID @@ -876,9 +1161,9 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); socket.on("clearStatistics", async (callback) => { try { - checkLogin(socket) + checkLogin(socket); - console.log(`Clear Statistics User ID: ${socket.userID}`) + console.log(`Clear Statistics User ID: ${socket.userID}`); await R.exec("DELETE FROM heartbeat"); @@ -894,24 +1179,27 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); } }); - debug("added all socket handlers") + // Status Page Socket Handler for admin only + statusPageSocketHandler(socket); + + debug("added all socket handlers"); // *************************** // Better do anything after added all socket handlers here // *************************** - debug("check auto login") + debug("check auto login"); if (await setting("disableAuth")) { - console.log("Disabled Auth: auto login to admin") - afterLogin(socket, await R.findOne("user")) - socket.emit("autoLogin") + console.log("Disabled Auth: auto login to admin"); + afterLogin(socket, await R.findOne("user")); + socket.emit("autoLogin"); } else { - debug("need auth") + debug("need auth"); } }); - console.log("Init the server") + console.log("Init the server"); server.once("error", async (err) => { console.error("Cannot listen: " + err.message); @@ -933,14 +1221,14 @@ let indexHTML = fs.readFileSync("./dist/index.html").toString(); async function updateMonitorNotification(monitorID, notificationIDList) { await R.exec("DELETE FROM monitor_notification WHERE monitor_id = ? ", [ monitorID, - ]) + ]); for (let notificationID in notificationIDList) { if (notificationIDList[notificationID]) { let relation = R.dispense("monitor_notification"); relation.monitor_id = monitorID; relation.notification_id = notificationID; - await R.store(relation) + await R.store(relation); } } } @@ -949,7 +1237,7 @@ async function checkOwner(userID, monitorID) { let row = await R.getRow("SELECT id FROM monitor WHERE id = ? AND user_id = ? ", [ monitorID, userID, - ]) + ]); if (! row) { throw new Error("You do not own this monitor."); @@ -958,16 +1246,16 @@ async function checkOwner(userID, monitorID) { async function sendMonitorList(socket) { let list = await getMonitorJSONList(socket.userID); - io.to(socket.userID).emit("monitorList", list) + io.to(socket.userID).emit("monitorList", list); return list; } async function afterLogin(socket, user) { socket.userID = user.id; - socket.join(user.id) + socket.join(user.id); - let monitorList = await sendMonitorList(socket) - sendNotificationList(socket) + let monitorList = await sendMonitorList(socket); + sendNotificationList(socket); await sleep(500); @@ -980,7 +1268,7 @@ async function afterLogin(socket, user) { } for (let monitorID in monitorList) { - await Monitor.sendStats(io, monitorID, user.id) + await Monitor.sendStats(io, monitorID, user.id); } } @@ -989,7 +1277,7 @@ async function getMonitorJSONList(userID) { let monitorList = await R.find("monitor", " user_id = ? ORDER BY weight DESC, name", [ userID, - ]) + ]); for (let monitor of monitorList) { result[monitor.id] = await monitor.toJSON(); @@ -998,24 +1286,18 @@ async function getMonitorJSONList(userID) { return result; } -function checkLogin(socket) { - if (! socket.userID) { - throw new Error("You are not logged in."); - } -} - async function initDatabase() { if (! fs.existsSync(Database.path)) { - console.log("Copying Database") + console.log("Copying Database"); fs.copyFileSync(Database.templatePath, Database.path); } - console.log("Connecting to Database") + console.log("Connecting to Database"); await Database.connect(); - console.log("Connected") + console.log("Connected"); // Patch the database - await Database.patch() + await Database.patch(); let jwtSecretBean = await R.findOne("setting", " `key` = ? ", [ "jwtSecret", @@ -1031,7 +1313,7 @@ async function initDatabase() { // If there is no record in user table, it is a new Uptime Kuma instance, need to setup if ((await R.count("user")) === 0) { - console.log("No user, need setup") + console.log("No user, need setup"); needSetup = true; } @@ -1039,9 +1321,9 @@ async function initDatabase() { } async function startMonitor(userID, monitorID) { - await checkOwner(userID, monitorID) + await checkOwner(userID, monitorID); - console.log(`Resume Monitor: ${monitorID} User ID: ${userID}`) + console.log(`Resume Monitor: ${monitorID} User ID: ${userID}`); await R.exec("UPDATE monitor SET active = 1 WHERE id = ? AND user_id = ? ", [ monitorID, @@ -1050,24 +1332,24 @@ async function startMonitor(userID, monitorID) { let monitor = await R.findOne("monitor", " id = ? ", [ monitorID, - ]) + ]); if (monitor.id in monitorList) { monitorList[monitor.id].stop(); } monitorList[monitor.id] = monitor; - monitor.start(io) + monitor.start(io); } async function restartMonitor(userID, monitorID) { - return await startMonitor(userID, monitorID) + return await startMonitor(userID, monitorID); } async function pauseMonitor(userID, monitorID) { - await checkOwner(userID, monitorID) + await checkOwner(userID, monitorID); - console.log(`Pause Monitor: ${monitorID} User ID: ${userID}`) + console.log(`Pause Monitor: ${monitorID} User ID: ${userID}`); await R.exec("UPDATE monitor SET active = 0 WHERE id = ? AND user_id = ? ", [ monitorID, @@ -1083,7 +1365,7 @@ async function pauseMonitor(userID, monitorID) { * Resume active monitors */ async function startMonitors() { - let list = await R.find("monitor", " active = 1 ") + let list = await R.find("monitor", " active = 1 "); for (let monitor of list) { monitorList[monitor.id] = monitor; @@ -1100,10 +1382,10 @@ async function shutdownFunction(signal) { console.log("Shutdown requested"); console.log("Called signal: " + signal); - console.log("Stopping all monitors") + console.log("Stopping all monitors"); for (let id in monitorList) { - let monitor = monitorList[id] - monitor.stop() + let monitor = monitorList[id]; + monitor.stop(); } await sleep(2000); await Database.close(); diff --git a/server/socket-handlers/status-page-socket-handler.js b/server/socket-handlers/status-page-socket-handler.js new file mode 100644 index 0000000..5826277 --- /dev/null +++ b/server/socket-handlers/status-page-socket-handler.js @@ -0,0 +1,161 @@ +const { R } = require("redbean-node"); +const { checkLogin, setSettings } = require("../util-server"); +const dayjs = require("dayjs"); +const { debug } = require("../../src/util"); +const ImageDataURI = require("../image-data-uri"); +const Database = require("../database"); +const apicache = require("../modules/apicache"); + +module.exports.statusPageSocketHandler = (socket) => { + + // Post or edit incident + socket.on("postIncident", async (incident, callback) => { + try { + checkLogin(socket); + + await R.exec("UPDATE incident SET pin = 0 "); + + let incidentBean; + + if (incident.id) { + incidentBean = await R.findOne("incident", " id = ?", [ + incident.id + ]); + } + + if (incidentBean == null) { + incidentBean = R.dispense("incident"); + } + + incidentBean.title = incident.title; + incidentBean.content = incident.content; + incidentBean.style = incident.style; + incidentBean.pin = true; + + if (incident.id) { + incidentBean.lastUpdatedDate = R.isoDateTime(dayjs.utc()); + } else { + incidentBean.createdDate = R.isoDateTime(dayjs.utc()); + } + + await R.store(incidentBean); + + callback({ + ok: true, + incident: incidentBean.toPublicJSON(), + }); + } catch (error) { + callback({ + ok: false, + msg: error.message, + }); + } + }); + + socket.on("unpinIncident", async (callback) => { + try { + checkLogin(socket); + + await R.exec("UPDATE incident SET pin = 0 WHERE pin = 1"); + + callback({ + ok: true, + }); + } catch (error) { + callback({ + ok: false, + msg: error.message, + }); + } + }); + + // Save Status Page + // imgDataUrl Only Accept PNG! + socket.on("saveStatusPage", async (config, imgDataUrl, publicGroupList, callback) => { + + try { + checkLogin(socket); + + apicache.clear(); + + const header = "data:image/png;base64,"; + + // Check logo format + // If is image data url, convert to png file + // Else assume it is a url, nothing to do + if (imgDataUrl.startsWith("data:")) { + if (! imgDataUrl.startsWith(header)) { + throw new Error("Only allowed PNG logo."); + } + + // Convert to file + await ImageDataURI.outputFile(imgDataUrl, Database.uploadDir + "logo.png"); + config.logo = "/upload/logo.png?t=" + Date.now(); + + } else { + config.icon = imgDataUrl; + } + + // Save Config + await setSettings("statusPage", config); + + // Save Public Group List + const groupIDList = []; + let groupOrder = 1; + + for (let group of publicGroupList) { + let groupBean; + if (group.id) { + groupBean = await R.findOne("group", " id = ? AND public = 1 ", [ + group.id + ]); + } else { + groupBean = R.dispense("group"); + } + + groupBean.name = group.name; + groupBean.public = true; + groupBean.weight = groupOrder++; + + await R.store(groupBean); + + await R.exec("DELETE FROM monitor_group WHERE group_id = ? ", [ + groupBean.id + ]); + + let monitorOrder = 1; + console.log(group.monitorList); + + for (let monitor of group.monitorList) { + let relationBean = R.dispense("monitor_group"); + relationBean.weight = monitorOrder++; + relationBean.group_id = groupBean.id; + relationBean.monitor_id = monitor.id; + await R.store(relationBean); + } + + groupIDList.push(groupBean.id); + group.id = groupBean.id; + } + + // Delete groups that not in the list + debug("Delete groups that not in the list"); + const slots = groupIDList.map(() => "?").join(","); + await R.exec(`DELETE FROM \`group\` WHERE id NOT IN (${slots})`, groupIDList); + + callback({ + ok: true, + publicGroupList, + }); + + } catch (error) { + console.log(error); + + callback({ + ok: false, + msg: error.message, + }); + } + }); + +}; diff --git a/server/util-server.js b/server/util-server.js index 079bd82..4d2b6cb 100644 --- a/server/util-server.js +++ b/server/util-server.js @@ -23,7 +23,7 @@ exports.initJWTSecret = async () => { jwtSecretBean.value = passwordHash.generate(dayjs() + ""); await R.store(jwtSecretBean); return jwtSecretBean; -} +}; exports.tcping = function (hostname, port) { return new Promise((resolve, reject) => { @@ -44,7 +44,7 @@ exports.tcping = function (hostname, port) { resolve(Math.round(data.max)); }); }); -} +}; exports.ping = async (hostname) => { try { @@ -57,7 +57,7 @@ exports.ping = async (hostname) => { throw e; } } -} +}; exports.pingAsync = function (hostname, ipv6 = false) { return new Promise((resolve, reject) => { @@ -69,13 +69,13 @@ exports.pingAsync = function (hostname, ipv6 = false) { if (err) { reject(err); } else if (ms === null) { - reject(new Error(stdout)) + reject(new Error(stdout)); } else { - resolve(Math.round(ms)) + resolve(Math.round(ms)); } }); }); -} +}; exports.dnsResolve = function (hostname, resolver_server, rrtype) { const resolver = new Resolver(); @@ -98,8 +98,8 @@ exports.dnsResolve = function (hostname, resolver_server, rrtype) { } }); } - }) -} + }); +}; exports.setting = async function (key) { let value = await R.getCell("SELECT `value` FROM setting WHERE `key` = ? ", [ @@ -108,29 +108,29 @@ exports.setting = async function (key) { try { const v = JSON.parse(value); - debug(`Get Setting: ${key}: ${v}`) + debug(`Get Setting: ${key}: ${v}`); return v; } catch (e) { return value; } -} +}; exports.setSetting = async function (key, value) { let bean = await R.findOne("setting", " `key` = ? ", [ key, - ]) + ]); if (!bean) { - bean = R.dispense("setting") + bean = R.dispense("setting"); bean.key = key; } bean.value = JSON.stringify(value); - await R.store(bean) -} + await R.store(bean); +}; exports.getSettings = async function (type) { let list = await R.getAll("SELECT `key`, `value` FROM setting WHERE `type` = ? ", [ type, - ]) + ]); let result = {}; @@ -143,7 +143,7 @@ exports.getSettings = async function (type) { } return result; -} +}; exports.setSettings = async function (type, data) { let keyList = Object.keys(data); @@ -163,12 +163,12 @@ exports.setSettings = async function (type, data) { if (bean.type === type) { bean.value = JSON.stringify(data[key]); - promiseList.push(R.store(bean)) + promiseList.push(R.store(bean)); } } await Promise.all(promiseList); -} +}; // ssl-checker by @dyaa // param: res - response object from axios @@ -218,7 +218,7 @@ exports.checkCertificate = function (res) { issuer, fingerprint, }; -} +}; // Check if the provided status code is within the accepted ranges // Param: status - the status code to check @@ -247,7 +247,7 @@ exports.checkStatusCode = function (status, accepted_codes) { } return false; -} +}; exports.getTotalClientInRoom = (io, roomName) => { @@ -270,7 +270,7 @@ exports.getTotalClientInRoom = (io, roomName) => { } else { return 0; } -} +}; exports.genSecret = () => { let secret = ""; @@ -280,4 +280,21 @@ exports.genSecret = () => { secret += chars.charAt(Math.floor(Math.random() * charsLength)); } return secret; -} +}; + +exports.allowDevAllOrigin = (res) => { + if (process.env.NODE_ENV === "development") { + exports.allowAllOrigin(res); + } +}; + +exports.allowAllOrigin = (res) => { + res.header("Access-Control-Allow-Origin", "*"); + res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); +}; + +exports.checkLogin = (socket) => { + if (! socket.userID) { + throw new Error("You are not logged in."); + } +}; diff --git a/src/assets/app.scss b/src/assets/app.scss index 5816457..8e96a4a 100644 --- a/src/assets/app.scss +++ b/src/assets/app.scss @@ -144,7 +144,9 @@ h2 { } .shadow-box { - background-color: $dark-bg; + &:not(.alert) { + background-color: $dark-bg; + } } .form-check-input { @@ -255,6 +257,18 @@ h2 { background-color: $dark-bg; } + .monitor-list { + .item { + &:hover { + background-color: $dark-bg2; + } + + &.active { + background-color: $dark-bg2; + } + } + } + @media (max-width: 550px) { .table-shadow-box { tbody { @@ -268,6 +282,16 @@ h2 { } } } + + .alert { + &.bg-info, + &.bg-warning, + &.bg-danger, + &.bg-light { + color: $dark-font-color2; + } + } + } /* @@ -288,3 +312,119 @@ h2 { transform: translateY(50px); opacity: 0; } + +.slide-fade-right-enter-active { + transition: all 0.2s $easing-in; +} + +.slide-fade-right-leave-active { + transition: all 0.2s $easing-in; +} + +.slide-fade-right-enter-from, +.slide-fade-right-leave-to { + transform: translateX(50px); + opacity: 0; +} + +.monitor-list { + &.scrollbar { + min-height: calc(100vh - 240px); + max-height: calc(100vh - 30px); + overflow-y: auto; + position: sticky; + top: 10px; + } + + .item { + display: block; + text-decoration: none; + padding: 13px 15px 10px 15px; + border-radius: 10px; + transition: all ease-in-out 0.15s; + + &.disabled { + opacity: 0.3; + } + + .info { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + + &:hover { + background-color: $highlight-white; + } + + &.active { + background-color: #cdf8f4; + } + } +} + +.alert-success { + color: #122f21; + background-color: $primary; + border-color: $primary; +} + +.alert-info { + color: #055160; + background-color: #cff4fc; + border-color: #cff4fc; +} + +.alert-danger { + color: #842029; + background-color: #f8d7da; + border-color: #f8d7da; +} + +.btn-success { + color: #fff; + background-color: #4caf50; + border-color: #4caf50; +} + +[contenteditable=true] { + transition: all $easing-in 0.2s; + background-color: rgba(239, 239, 239, 0.7); + border-radius: 8px; + + &:focus { + outline: 0 solid #eee; + background-color: rgba(245, 245, 245, 0.9); + } + + &:hover { + background-color: rgba(239, 239, 239, 0.8); + } + + .dark & { + background-color: rgba(239, 239, 239, 0.2); + } + + /* + &::after { + margin-left: 5px; + content: "🖊️"; + font-size: 13px; + color: #eee; + } + */ + +} + +.action { + transition: all $easing-in 0.2s; + + &:hover { + cursor: pointer; + transform: scale(1.2); + } +} + +.vue-image-crop-upload .vicp-wrap { + border-radius: 10px !important; +} diff --git a/src/components/HeartbeatBar.vue b/src/components/HeartbeatBar.vue index fb6086d..4dc2c71 100644 --- a/src/components/HeartbeatBar.vue +++ b/src/components/HeartbeatBar.vue @@ -25,6 +25,10 @@ export default { type: Number, required: true, }, + heartbeatList: { + type: Array, + default: null, + } }, data() { return { @@ -38,8 +42,15 @@ export default { }, computed: { + /** + * If heartbeatList is null, get it from $root.heartbeatList + */ beatList() { - return this.$root.heartbeatList[this.monitorId] + if (this.heartbeatList === null) { + return this.$root.heartbeatList[this.monitorId]; + } else { + return this.heartbeatList; + } }, shortBeatList() { @@ -118,8 +129,10 @@ export default { window.removeEventListener("resize", this.resize); }, beforeMount() { - if (! (this.monitorId in this.$root.heartbeatList)) { - this.$root.heartbeatList[this.monitorId] = []; + if (this.heartbeatList === null) { + if (! (this.monitorId in this.$root.heartbeatList)) { + this.$root.heartbeatList[this.monitorId] = []; + } } }, diff --git a/src/components/MonitorList.vue b/src/components/MonitorList.vue index e721558..fb3fcfb 100644 --- a/src/components/MonitorList.vue +++ b/src/components/MonitorList.vue @@ -1,44 +1,69 @@ @@ -87,57 +126,51 @@ export default { padding-right: 5px !important; } -.list { - &.scrollbar { - min-height: calc(100vh - 240px); - max-height: calc(100vh - 30px); - overflow-y: auto; - position: sticky; - top: 10px; +.list-header { + border-bottom: 1px solid #dee2e6; + border-radius: 10px 10px 0 0; + margin: -10px; + margin-bottom: 10px; + padding: 10px; + display: flex; + justify-content: space-between; + + .dark & { + background-color: #161b22; + border-bottom: 0; } +} - .item { - display: block; - text-decoration: none; - padding: 13px 15px 10px 15px; - border-radius: 10px; - transition: all ease-in-out 0.15s; - - &.disabled { - opacity: 0.3; - } - - .info { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } - - &:hover { - background-color: $highlight-white; - } - - &.active { - background-color: #cdf8f4; - } +@media (max-width: 770px) { + .list-header { + margin: -20px; + margin-bottom: 10px; + padding: 5px; } } -.dark { - .list { - .item { - &:hover { - background-color: $dark-bg2; - } +.search-wrapper { + display: flex; + align-items: center; +} - &.active { - background-color: $dark-bg2; - } - } - } +.search-icon { + padding: 10px; + color: #c0c0c0; +} + +.search-input { + max-width: 15em; } .monitorItem { width: 100%; } + +.tags { + padding-left: 62px; + display: flex; + flex-wrap: wrap; + gap: 0; +} diff --git a/src/components/NotificationDialog.vue b/src/components/NotificationDialog.vue index d689b0c..220ff8d 100644 --- a/src/components/NotificationDialog.vue +++ b/src/components/NotificationDialog.vue @@ -17,6 +17,7 @@ + @@ -80,6 +81,11 @@ + +
+ + +
+
+ +
+
@@ -197,6 +209,7 @@ diff --git a/src/pages/Settings.vue b/src/pages/Settings.vue index 8d5545b..77dfee8 100644 --- a/src/pages/Settings.vue +++ b/src/pages/Settings.vue @@ -83,6 +83,24 @@ +
+ + +
+ + +
+ +
+ + +
+
+
-

{{ $t("Import/Export Backup") }}

+

{{ $t("Export Backup") }}

{{ $t("backupDescription") }}
({{ $t("backupDescription2") }})

-
- - +
+ +

{{ $t("backupDescription3") }}

+ +

{{ $t("Import Backup") }}

+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ {{ $t("importHandleDescription") }} +
+ +
+ +
+ +
+ -
+
{{ importAlert }}
-

{{ $t("backupDescription3") }}

-

{{ $t("Advanced") }}

@@ -181,18 +225,15 @@ + +

Info

+ + {{ $t("Version") }}: {{ $root.info.version }}
+ {{ $t("Check Update On GitHub") }}
- - @@ -203,6 +244,12 @@

Por favor usar con cuidado.

+ + + + + + @@ -275,16 +337,16 @@ diff --git a/src/router.js b/src/router.js new file mode 100644 index 0000000..8739aa6 --- /dev/null +++ b/src/router.js @@ -0,0 +1,85 @@ +import { createRouter, createWebHistory } from "vue-router"; +import EmptyLayout from "./layouts/EmptyLayout.vue"; +import Layout from "./layouts/Layout.vue"; +import Dashboard from "./pages/Dashboard.vue"; +import DashboardHome from "./pages/DashboardHome.vue"; +import Details from "./pages/Details.vue"; +import EditMonitor from "./pages/EditMonitor.vue"; +import List from "./pages/List.vue"; +import Settings from "./pages/Settings.vue"; +import Setup from "./pages/Setup.vue"; +import StatusPage from "./pages/StatusPage.vue"; +import Entry from "./pages/Entry.vue"; + +const routes = [ + { + path: "/", + component: Entry, + }, + { + // If it is "/dashboard", the active link is not working + // If it is "", it overrides the "/" unexpectedly + // Give a random name to solve the problem. + path: "/empty", + component: Layout, + children: [ + { + path: "", + component: Dashboard, + children: [ + { + name: "DashboardHome", + path: "/dashboard", + component: DashboardHome, + children: [ + { + path: "/dashboard/:id", + component: EmptyLayout, + children: [ + { + path: "", + component: Details, + }, + { + path: "/edit/:id", + component: EditMonitor, + }, + ], + }, + { + path: "/add", + component: EditMonitor, + }, + { + path: "/list", + component: List, + }, + ], + }, + { + path: "/settings", + component: Settings, + }, + ], + }, + ], + }, + { + path: "/setup", + component: Setup, + }, + { + path: "/status-page", + component: StatusPage, + }, + { + path: "/status", + component: StatusPage, + }, +]; + +export const router = createRouter({ + linkActiveClass: "active", + history: createWebHistory(), + routes, +}); diff --git a/src/util-frontend.js b/src/util-frontend.js index 07b1914..412ec92 100644 --- a/src/util-frontend.js +++ b/src/util-frontend.js @@ -1,9 +1,10 @@ import dayjs from "dayjs"; import timezone from "dayjs/plugin/timezone"; import utc from "dayjs/plugin/utc"; +import timezones from "timezones-list"; -dayjs.extend(utc) -dayjs.extend(timezone) +dayjs.extend(utc); +dayjs.extend(timezone); function getTimezoneOffset(timeZone) { const now = new Date(); @@ -16,376 +17,21 @@ function getTimezoneOffset(timeZone) { return -offset; } -// From: https://stackoverflow.com/questions/38399465/how-to-get-list-of-all-timezones-in-javascript -// TODO: Move to separate file -const aryIannaTimeZones = [ - "Europe/Andorra", - "Asia/Dubai", - "Asia/Kabul", - "Europe/Tirane", - "Asia/Yerevan", - "Antarctica/Casey", - "Antarctica/Davis", - "Antarctica/Mawson", - "Antarctica/Palmer", - "Antarctica/Rothera", - "Antarctica/Syowa", - "Antarctica/Troll", - "Antarctica/Vostok", - "America/Argentina/Buenos_Aires", - "America/Argentina/Cordoba", - "America/Argentina/Salta", - "America/Argentina/Jujuy", - "America/Argentina/Tucuman", - "America/Argentina/Catamarca", - "America/Argentina/La_Rioja", - "America/Argentina/San_Juan", - "America/Argentina/Mendoza", - "America/Argentina/San_Luis", - "America/Argentina/Rio_Gallegos", - "America/Argentina/Ushuaia", - "Pacific/Pago_Pago", - "Europe/Vienna", - "Australia/Lord_Howe", - "Antarctica/Macquarie", - "Australia/Hobart", - "Australia/Currie", - "Australia/Melbourne", - "Australia/Sydney", - "Australia/Broken_Hill", - "Australia/Brisbane", - "Australia/Lindeman", - "Australia/Adelaide", - "Australia/Darwin", - "Australia/Perth", - "Australia/Eucla", - "Asia/Baku", - "America/Barbados", - "Asia/Dhaka", - "Europe/Brussels", - "Europe/Sofia", - "Atlantic/Bermuda", - "Asia/Brunei", - "America/La_Paz", - "America/Noronha", - "America/Belem", - "America/Fortaleza", - "America/Recife", - "America/Araguaina", - "America/Maceio", - "America/Bahia", - "America/Sao_Paulo", - "America/Campo_Grande", - "America/Cuiaba", - "America/Santarem", - "America/Porto_Velho", - "America/Boa_Vista", - "America/Manaus", - "America/Eirunepe", - "America/Rio_Branco", - "America/Nassau", - "Asia/Thimphu", - "Europe/Minsk", - "America/Belize", - "America/St_Johns", - "America/Halifax", - "America/Glace_Bay", - "America/Moncton", - "America/Goose_Bay", - "America/Blanc-Sablon", - "America/Toronto", - "America/Nipigon", - "America/Thunder_Bay", - "America/Iqaluit", - "America/Pangnirtung", - "America/Atikokan", - "America/Winnipeg", - "America/Rainy_River", - "America/Resolute", - "America/Rankin_Inlet", - "America/Regina", - "America/Swift_Current", - "America/Edmonton", - "America/Cambridge_Bay", - "America/Yellowknife", - "America/Inuvik", - "America/Creston", - "America/Dawson_Creek", - "America/Fort_Nelson", - "America/Vancouver", - "America/Whitehorse", - "America/Dawson", - "Indian/Cocos", - "Europe/Zurich", - "Africa/Abidjan", - "Pacific/Rarotonga", - "America/Santiago", - "America/Punta_Arenas", - "Pacific/Easter", - "Asia/Shanghai", - "Asia/Urumqi", - "America/Bogota", - "America/Costa_Rica", - "America/Havana", - "Atlantic/Cape_Verde", - "America/Curacao", - "Indian/Christmas", - "Asia/Nicosia", - "Asia/Famagusta", - "Europe/Prague", - "Europe/Berlin", - "Europe/Copenhagen", - "America/Santo_Domingo", - "Africa/Algiers", - "America/Guayaquil", - "Pacific/Galapagos", - "Europe/Tallinn", - "Africa/Cairo", - "Africa/El_Aaiun", - "Europe/Madrid", - "Africa/Ceuta", - "Atlantic/Canary", - "Europe/Helsinki", - "Pacific/Fiji", - "Atlantic/Stanley", - "Pacific/Chuuk", - "Pacific/Pohnpei", - "Pacific/Kosrae", - "Atlantic/Faroe", - "Europe/Paris", - "Europe/London", - "Asia/Tbilisi", - "America/Cayenne", - "Africa/Accra", - "Europe/Gibraltar", - "America/Godthab", - "America/Danmarkshavn", - "America/Scoresbysund", - "America/Thule", - "Europe/Athens", - "Atlantic/South_Georgia", - "America/Guatemala", - "Pacific/Guam", - "Africa/Bissau", - "America/Guyana", - "Asia/Hong_Kong", - "America/Tegucigalpa", - "America/Port-au-Prince", - "Europe/Budapest", - "Asia/Jakarta", - "Asia/Pontianak", - "Asia/Makassar", - "Asia/Jayapura", - "Europe/Dublin", - "Asia/Jerusalem", - "Asia/Kolkata", - "Indian/Chagos", - "Asia/Baghdad", - "Asia/Tehran", - "Atlantic/Reykjavik", - "Europe/Rome", - "America/Jamaica", - "Asia/Amman", - "Asia/Tokyo", - "Africa/Nairobi", - "Asia/Bishkek", - "Pacific/Tarawa", - "Pacific/Enderbury", - "Pacific/Kiritimati", - "Asia/Pyongyang", - "Asia/Seoul", - "Asia/Almaty", - "Asia/Qyzylorda", - "Asia/Aqtobe", - "Asia/Aqtau", - "Asia/Atyrau", - "Asia/Oral", - "Asia/Beirut", - "Asia/Colombo", - "Africa/Monrovia", - "Europe/Vilnius", - "Europe/Luxembourg", - "Europe/Riga", - "Africa/Tripoli", - "Africa/Casablanca", - "Europe/Monaco", - "Europe/Chisinau", - "Pacific/Majuro", - "Pacific/Kwajalein", - "Asia/Yangon", - "Asia/Ulaanbaatar", - "Asia/Hovd", - "Asia/Choibalsan", - "Asia/Macau", - "America/Martinique", - "Europe/Malta", - "Indian/Mauritius", - "Indian/Maldives", - "America/Mexico_City", - "America/Cancun", - "America/Merida", - "America/Monterrey", - "America/Matamoros", - "America/Mazatlan", - "America/Chihuahua", - "America/Ojinaga", - "America/Hermosillo", - "America/Tijuana", - "America/Bahia_Banderas", - "Asia/Kuala_Lumpur", - "Asia/Kuching", - "Africa/Maputo", - "Africa/Windhoek", - "Pacific/Noumea", - "Pacific/Norfolk", - "Africa/Lagos", - "America/Managua", - "Europe/Amsterdam", - "Europe/Oslo", - "Asia/Kathmandu", - "Pacific/Nauru", - "Pacific/Niue", - "Pacific/Auckland", - "Pacific/Chatham", - "America/Panama", - "America/Lima", - "Pacific/Tahiti", - "Pacific/Marquesas", - "Pacific/Gambier", - "Pacific/Port_Moresby", - "Pacific/Bougainville", - "Asia/Manila", - "Asia/Karachi", - "Europe/Warsaw", - "America/Miquelon", - "Pacific/Pitcairn", - "America/Puerto_Rico", - "Asia/Gaza", - "Asia/Hebron", - "Europe/Lisbon", - "Atlantic/Madeira", - "Atlantic/Azores", - "Pacific/Palau", - "America/Asuncion", - "Asia/Qatar", - "Indian/Reunion", - "Europe/Bucharest", - "Europe/Belgrade", - "Europe/Kaliningrad", - "Europe/Moscow", - "Europe/Simferopol", - "Europe/Kirov", - "Europe/Astrakhan", - "Europe/Volgograd", - "Europe/Saratov", - "Europe/Ulyanovsk", - "Europe/Samara", - "Asia/Yekaterinburg", - "Asia/Omsk", - "Asia/Novosibirsk", - "Asia/Barnaul", - "Asia/Tomsk", - "Asia/Novokuznetsk", - "Asia/Krasnoyarsk", - "Asia/Irkutsk", - "Asia/Chita", - "Asia/Yakutsk", - "Asia/Khandyga", - "Asia/Vladivostok", - "Asia/Ust-Nera", - "Asia/Magadan", - "Asia/Sakhalin", - "Asia/Srednekolymsk", - "Asia/Kamchatka", - "Asia/Anadyr", - "Asia/Riyadh", - "Pacific/Guadalcanal", - "Indian/Mahe", - "Africa/Khartoum", - "Europe/Stockholm", - "Asia/Singapore", - "America/Paramaribo", - "Africa/Juba", - "Africa/Sao_Tome", - "America/El_Salvador", - "Asia/Damascus", - "America/Grand_Turk", - "Africa/Ndjamena", - "Indian/Kerguelen", - "Asia/Bangkok", - "Asia/Dushanbe", - "Pacific/Fakaofo", - "Asia/Dili", - "Asia/Ashgabat", - "Africa/Tunis", - "Pacific/Tongatapu", - "Europe/Istanbul", - "America/Port_of_Spain", - "Pacific/Funafuti", - "Asia/Taipei", - "Europe/Kiev", - "Europe/Uzhgorod", - "Europe/Zaporozhye", - "Pacific/Wake", - "America/New_York", - "America/Detroit", - "America/Kentucky/Louisville", - "America/Kentucky/Monticello", - "America/Indiana/Indianapolis", - "America/Indiana/Vincennes", - "America/Indiana/Winamac", - "America/Indiana/Marengo", - "America/Indiana/Petersburg", - "America/Indiana/Vevay", - "America/Chicago", - "America/Indiana/Tell_City", - "America/Indiana/Knox", - "America/Menominee", - "America/North_Dakota/Center", - "America/North_Dakota/New_Salem", - "America/North_Dakota/Beulah", - "America/Denver", - "America/Boise", - "America/Phoenix", - "America/Los_Angeles", - "America/Anchorage", - "America/Juneau", - "America/Sitka", - "America/Metlakatla", - "America/Yakutat", - "America/Nome", - "America/Adak", - "Pacific/Honolulu", - "America/Montevideo", - "Asia/Samarkand", - "Asia/Tashkent", - "America/Caracas", - "Asia/Ho_Chi_Minh", - "Pacific/Efate", - "Pacific/Wallis", - "Pacific/Apia", - "Africa/Johannesburg", -]; - export function timezoneList() { - let result = []; - for (let timezone of aryIannaTimeZones) { - + for (let timezone of timezones) { try { - let display = dayjs().tz(timezone).format("Z"); + let display = dayjs().tz(timezone.tzCode).format("Z"); result.push({ - name: `(UTC${display}) ${timezone}`, - value: timezone, - time: getTimezoneOffset(timezone), - }) + name: `(UTC${display}) ${timezone.tzCode}`, + value: timezone.tzCode, + time: getTimezoneOffset(timezone.tzCode), + }); } catch (e) { - console.error(e.message); - console.log("Skip this timezone") + console.log("Skip Timezone: " + timezone.tzCode); } - } result.sort((a, b) => { @@ -398,7 +44,7 @@ export function timezoneList() { } return 0; - }) + }); return result; } diff --git a/src/util.js b/src/util.js index 14c6832..7e60b31 100644 --- a/src/util.js +++ b/src/util.js @@ -1,70 +1,104 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getRandomInt = exports.getRandomArbitrary = exports.TimeLogger = exports.polyfill = exports.debug = exports.ucfirst = exports.sleep = exports.flipStatus = exports.PENDING = exports.UP = exports.DOWN = exports.appName = exports.isDev = void 0; -const _dayjs = require("dayjs"); -const dayjs = _dayjs; -exports.isDev = process.env.NODE_ENV === "development"; -exports.appName = "Uptime Kuma"; -exports.DOWN = 0; -exports.UP = 1; -exports.PENDING = 2; -function flipStatus(s) { - if (s === exports.UP) { - return exports.DOWN; - } - if (s === exports.DOWN) { - return exports.UP; - } - return s; -} -exports.flipStatus = flipStatus; -function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); -} -exports.sleep = sleep; -function ucfirst(str) { - if (!str) { - return str; - } - const firstLetter = str.substr(0, 1); - return firstLetter.toUpperCase() + str.substr(1); -} -exports.ucfirst = ucfirst; -function debug(msg) { - if (exports.isDev) { - console.log(msg); - } -} -exports.debug = debug; -function polyfill() { - if (!String.prototype.replaceAll) { - String.prototype.replaceAll = function (str, newStr) { - if (Object.prototype.toString.call(str).toLowerCase() === "[object regexp]") { - return this.replace(str, newStr); - } - return this.replace(new RegExp(str, "g"), newStr); - }; - } -} -exports.polyfill = polyfill; -class TimeLogger { - constructor() { - this.startTime = dayjs().valueOf(); - } - print(name) { - if (exports.isDev) { - console.log(name + ": " + (dayjs().valueOf() - this.startTime) + "ms"); - } - } -} -exports.TimeLogger = TimeLogger; -function getRandomArbitrary(min, max) { - return Math.random() * (max - min) + min; -} -exports.getRandomArbitrary = getRandomArbitrary; -function getRandomInt(min, max) { - min = Math.ceil(min); - max = Math.floor(max); - return Math.floor(Math.random() * (max - min + 1)) + min; -} -exports.getRandomInt = getRandomInt; +"use strict"; +// Common Util for frontend and backend +// +// DOT NOT MODIFY util.js! +// Need to run "tsc" to compile if there are any changes. +// +// Backend uses the compiled file util.js +// Frontend uses util.ts +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getRandomInt = exports.getRandomArbitrary = exports.TimeLogger = exports.polyfill = exports.debug = exports.ucfirst = exports.sleep = exports.flipStatus = exports.STATUS_PAGE_PARTIAL_DOWN = exports.STATUS_PAGE_ALL_UP = exports.STATUS_PAGE_ALL_DOWN = exports.PENDING = exports.UP = exports.DOWN = exports.appName = exports.isDev = void 0; +const _dayjs = require("dayjs"); +const dayjs = _dayjs; +exports.isDev = process.env.NODE_ENV === "development"; +exports.appName = "Uptime Kuma"; +exports.DOWN = 0; +exports.UP = 1; +exports.PENDING = 2; +exports.STATUS_PAGE_ALL_DOWN = 0; +exports.STATUS_PAGE_ALL_UP = 1; +exports.STATUS_PAGE_PARTIAL_DOWN = 2; +function flipStatus(s) { + if (s === exports.UP) { + return exports.DOWN; + } + if (s === exports.DOWN) { + return exports.UP; + } + return s; +} +exports.flipStatus = flipStatus; +function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); +} +exports.sleep = sleep; +/** + * PHP's ucfirst + * @param str + */ +function ucfirst(str) { + if (!str) { + return str; + } + const firstLetter = str.substr(0, 1); + return firstLetter.toUpperCase() + str.substr(1); +} +exports.ucfirst = ucfirst; +function debug(msg) { + if (exports.isDev) { + console.log(msg); + } +} +exports.debug = debug; +function polyfill() { + /** + * String.prototype.replaceAll() polyfill + * https://gomakethings.com/how-to-replace-a-section-of-a-string-with-another-one-with-vanilla-js/ + * @author Chris Ferdinandi + * @license MIT + */ + if (!String.prototype.replaceAll) { + String.prototype.replaceAll = function (str, newStr) { + // If a regex pattern + if (Object.prototype.toString.call(str).toLowerCase() === "[object regexp]") { + return this.replace(str, newStr); + } + // If a string + return this.replace(new RegExp(str, "g"), newStr); + }; + } +} +exports.polyfill = polyfill; +class TimeLogger { + constructor() { + this.startTime = dayjs().valueOf(); + } + print(name) { + if (exports.isDev) { + console.log(name + ": " + (dayjs().valueOf() - this.startTime) + "ms"); + } + } +} +exports.TimeLogger = TimeLogger; +/** + * Returns a random number between min (inclusive) and max (exclusive) + */ +function getRandomArbitrary(min, max) { + return Math.random() * (max - min) + min; +} +exports.getRandomArbitrary = getRandomArbitrary; +/** + * From: https://stackoverflow.com/questions/1527803/generating-random-whole-numbers-in-javascript-in-a-specific-range + * + * Returns a random integer between min (inclusive) and max (inclusive). + * The value is no lower than min (or the next integer greater than min + * if min isn't an integer) and no greater than max (or the next integer + * lower than max if max isn't an integer). + * Using Math.round() will give you a non-uniform distribution! + */ +function getRandomInt(min, max) { + min = Math.ceil(min); + max = Math.floor(max); + return Math.floor(Math.random() * (max - min + 1)) + min; +} +exports.getRandomInt = getRandomInt; diff --git a/src/util.ts b/src/util.ts index 3b96f7b..4d68ab4 100644 --- a/src/util.ts +++ b/src/util.ts @@ -1,7 +1,10 @@ // Common Util for frontend and backend +// +// DOT NOT MODIFY util.js! +// Need to run "tsc" to compile if there are any changes. +// // Backend uses the compiled file util.js // Frontend uses util.ts -// Need to run "tsc" to compile if there are any changes. import * as _dayjs from "dayjs"; const dayjs = _dayjs; @@ -12,6 +15,11 @@ export const DOWN = 0; export const UP = 1; export const PENDING = 2; +export const STATUS_PAGE_ALL_DOWN = 0; +export const STATUS_PAGE_ALL_UP = 1; +export const STATUS_PAGE_PARTIAL_DOWN = 2; + + export function flipStatus(s: number) { if (s === UP) { return DOWN; @@ -59,7 +67,6 @@ export function polyfill() { */ if (!String.prototype.replaceAll) { String.prototype.replaceAll = function (str: string, newStr: string) { - // If a regex pattern if (Object.prototype.toString.call(str).toLowerCase() === "[object regexp]") { return this.replace(str, newStr); @@ -67,7 +74,6 @@ export function polyfill() { // If a string return this.replace(new RegExp(str, "g"), newStr); - }; } } diff --git a/test/ubuntu-nodejs16.dockerfile b/test/ubuntu-nodejs16.dockerfile new file mode 100644 index 0000000..a2dd2ec --- /dev/null +++ b/test/ubuntu-nodejs16.dockerfile @@ -0,0 +1,10 @@ +FROM ubuntu +WORKDIR /app +RUN apt update && apt --yes install git curl +RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - +RUN apt --yes install nodejs +RUN git clone https://github.com/louislam/uptime-kuma.git . +RUN npm run setup + +# Option 1. Try it +RUN node server/server.js diff --git a/tsconfig.json b/tsconfig.json index 41db8c5..b7637c3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,7 @@ "es2020", "DOM", ], - "removeComments": true, + "removeComments": false, "preserveConstEnums": true, "sourceMap": false, "strict": true