diff --git a/CREDITS.md b/CREDITS.md index 050b430..be34b47 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -4,48 +4,53 @@ This file shows all npm packages used in DockStatAPI (also Dev packages) ### License: (MIT AND CC-BY-3.0) -| Name | Repository | Publisher | -| ----------------- | -------------------------------------------- | -------------------- | +| Name | Repository | Publisher | +|------|-------------|-----------| | spdx-ranges@2.1.1 | https://github.com/kemitchell/spdx-ranges.js | The Linux Foundation | + ### License: Apache-2.0 -| Name | Repository | Publisher | -| ------------------------------------ | ------------------------------------------------------------- | --------------------- | -| @balena/dockerignore@1.0.2 | https://github.com/balena-io-modules/dockerignore | N/A | -| @eslint/config-array@0.19.1 | https://github.com/eslint/rewrite | Nicholas C. Zakas | -| @eslint/core@0.9.1 | https://github.com/eslint/rewrite | Nicholas C. Zakas | -| @eslint/object-schema@2.1.5 | https://github.com/eslint/rewrite | Nicholas C. Zakas | -| @eslint/plugin-kit@0.2.4 | https://github.com/eslint/rewrite | Nicholas C. Zakas | -| @humanfs/core@0.19.1 | https://github.com/humanwhocodes/humanfs | Nicholas C. Zakas | -| @humanfs/node@0.16.6 | https://github.com/humanwhocodes/humanfs | Nicholas C. Zakas | -| @humanwhocodes/module-importer@1.0.1 | https://github.com/humanwhocodes/module-importer | Nicholas C. Zaks | -| @humanwhocodes/retry@0.3.1 | https://github.com/humanwhocodes/retry | Nicholas C. Zaks | -| @humanwhocodes/retry@0.4.1 | https://github.com/humanwhocodes/retry | Nicholas C. Zaks | -| @playwright/test@1.49.1 | https://github.com/microsoft/playwright | Microsoft Corporation | -| @scarf/scarf@1.4.0 | https://github.com/scarf-sh/scarf-js | Scarf Systems | -| detect-libc@2.0.3 | https://github.com/lovell/detect-libc | Lovell Fuller | -| docker-modem@5.0.3 | https://github.com/apocas/docker-modem | Pedro Dias | -| dockerode@4.0.2 | https://github.com/apocas/dockerode | Pedro Dias | -| doctrine@3.0.0 | https://github.com/eslint/doctrine | N/A | -| eslint-visitor-keys@3.4.3 | https://github.com/eslint/eslint-visitor-keys | Toru Nagashima | -| eslint-visitor-keys@4.2.0 | https://github.com/eslint/js | Toru Nagashima | -| playwright-core@1.49.1 | https://github.com/microsoft/playwright | Microsoft Corporation | -| playwright@1.49.1 | https://github.com/microsoft/playwright | Microsoft Corporation | -| spdx-correct@3.2.0 | https://github.com/jslicense/spdx-correct.js | N/A | -| swagger-ui-dist@5.18.2 | https://github.com/swagger-api/swagger-ui | N/A | -| tunnel-agent@0.6.0 | https://github.com/mikeal/tunnel-agent | Mikeal Rogers | -| typescript@5.7.2 | https://github.com/microsoft/TypeScript | Microsoft Corp. | -| validate-npm-package-license@3.0.4 | https://github.com/kemitchell/validate-npm-package-license.js | Kyle E. Mitchell | +| Name | Repository | Publisher | +|------|-------------|-----------| +| @balena/dockerignore@1.0.2 | https://github.com/balena-io-modules/dockerignore | N/A | +| @eslint/config-array@0.19.1 | https://github.com/eslint/rewrite | Nicholas C. Zakas | +| @eslint/core@0.9.1 | https://github.com/eslint/rewrite | Nicholas C. Zakas | +| @eslint/object-schema@2.1.5 | https://github.com/eslint/rewrite | Nicholas C. Zakas | +| @eslint/plugin-kit@0.2.4 | https://github.com/eslint/rewrite | Nicholas C. Zakas | +| @humanfs/core@0.19.1 | https://github.com/humanwhocodes/humanfs | Nicholas C. Zakas | +| @humanfs/node@0.16.6 | https://github.com/humanwhocodes/humanfs | Nicholas C. Zakas | +| @humanwhocodes/module-importer@1.0.1 | https://github.com/humanwhocodes/module-importer | Nicholas C. Zaks | +| @humanwhocodes/retry@0.3.1 | https://github.com/humanwhocodes/retry | Nicholas C. Zaks | +| @humanwhocodes/retry@0.4.1 | https://github.com/humanwhocodes/retry | Nicholas C. Zaks | +| @playwright/test@1.49.1 | https://github.com/microsoft/playwright | Microsoft Corporation | +| @scarf/scarf@1.4.0 | https://github.com/scarf-sh/scarf-js | Scarf Systems | +| detect-libc@2.0.3 | https://github.com/lovell/detect-libc | Lovell Fuller | +| docker-modem@5.0.3 | https://github.com/apocas/docker-modem | Pedro Dias | +| dockerode@4.0.2 | https://github.com/apocas/dockerode | Pedro Dias | +| doctrine@3.0.0 | https://github.com/eslint/doctrine | N/A | +| eslint-visitor-keys@3.4.3 | https://github.com/eslint/eslint-visitor-keys | Toru Nagashima | +| eslint-visitor-keys@4.2.0 | https://github.com/eslint/js | Toru Nagashima | +| playwright-core@1.49.1 | https://github.com/microsoft/playwright | Microsoft Corporation | +| playwright@1.49.1 | https://github.com/microsoft/playwright | Microsoft Corporation | +| spdx-correct@3.2.0 | https://github.com/jslicense/spdx-correct.js | N/A | +| swagger-ui-dist@5.18.2 | https://github.com/swagger-api/swagger-ui | N/A | +| tunnel-agent@0.6.0 | https://github.com/mikeal/tunnel-agent | Mikeal Rogers | +| typescript@5.7.2 | https://github.com/microsoft/TypeScript | Microsoft Corp. | +| validate-npm-package-license@3.0.4 | https://github.com/kemitchell/validate-npm-package-license.js | Kyle E. Mitchell | + ### License: CC-BY-3.0 -| Name | Repository | Publisher | -| --------------------- | -------------------------------------------------- | -------------------- | +| Name | Repository | Publisher | +|------|-------------|-----------| | spdx-exceptions@2.5.0 | https://github.com/kemitchell/spdx-exceptions.json | The Linux Foundation | + ### License: Python-2.0 -| Name | Repository | Publisher | -| -------------- | ---------------------------------- | --------- | -| argparse@2.0.1 | https://github.com/nodeca/argparse | N/A | +| Name | Repository | Publisher | +|------|-------------|-----------| +| argparse@2.0.1 | https://github.com/nodeca/argparse | N/A | + + diff --git a/package-lock.json b/package-lock.json index 9776ee4..ba55c01 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,6 @@ "express-rate-limit": "^7.4.1", "https": "^1.0.0", "ipaddr.js": "^2.2.0", - "node-fetch": "^3.3.2", "nodemailer": "^6.9.16", "sqlite3": "^5.1.7", "swagger-jsdoc": "^6.2.8", @@ -33,7 +32,6 @@ "@types/express": "^5.0.0", "@types/express-handlebars": "^5.3.1", "@types/node": "^22.9.0", - "@types/node-fetch": "^2.6.12", "@types/nodemailer": "^6.4.17", "@types/supports-color": "^8.1.3", "@types/swagger-jsdoc": "^6.0.4", @@ -1152,17 +1150,6 @@ "undici-types": "~6.20.0" } }, - "node_modules/@types/node-fetch": { - "version": "2.6.12", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.12.tgz", - "integrity": "sha512-8nneRWKCg3rMtF69nLQJnOYUcbafYeFSjqkw3jCRLsqkWFlHaoQrr5mXmofFGOx3DKn7UfmBMyov8ySvLRVldA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*", - "form-data": "^4.0.0" - } - }, "node_modules/@types/nodemailer": { "version": "6.4.17", "resolved": "https://registry.npmjs.org/@types/nodemailer/-/nodemailer-6.4.17.tgz", @@ -1715,13 +1702,6 @@ "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", "license": "MIT" }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true, - "license": "MIT" - }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -2136,19 +2116,6 @@ "text-hex": "1.0.x" } }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "license": "MIT", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/commander": { "version": "12.1.0", "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", @@ -2256,15 +2223,6 @@ "node": ">= 8" } }, - "node_modules/data-uri-to-buffer": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", - "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", - "license": "MIT", - "engines": { - "node": ">= 12" - } - }, "node_modules/debug": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", @@ -2324,16 +2282,6 @@ "dev": true, "license": "MIT" }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/delegates": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", @@ -3070,29 +3018,6 @@ "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==", "license": "MIT" }, - "node_modules/fetch-blob": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", - "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "paypal", - "url": "https://paypal.me/jimmywarting" - } - ], - "license": "MIT", - "dependencies": { - "node-domexception": "^1.0.0", - "web-streams-polyfill": "^3.0.3" - }, - "engines": { - "node": "^12.20 || >= 14.13" - } - }, "node_modules/file-entry-cache": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", @@ -3202,33 +3127,6 @@ "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==", "license": "MIT" }, - "node_modules/form-data": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", - "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", - "dev": true, - "license": "MIT", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/formdata-polyfill": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", - "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", - "license": "MIT", - "dependencies": { - "fetch-blob": "^3.1.2" - }, - "engines": { - "node": ">=12.20.0" - } - }, "node_modules/forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -4667,43 +4565,6 @@ "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==", "license": "MIT" }, - "node_modules/node-domexception": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", - "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "github", - "url": "https://paypal.me/jimmywarting" - } - ], - "license": "MIT", - "engines": { - "node": ">=10.5.0" - } - }, - "node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", - "license": "MIT", - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" - } - }, "node_modules/node-gyp": { "version": "8.4.1", "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz", @@ -7056,15 +6917,6 @@ "node": "^18||>=20" } }, - "node_modules/web-streams-polyfill": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", - "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", diff --git a/package.json b/package.json index 8190b94..9acd952 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,6 @@ "express-rate-limit": "^7.4.1", "https": "^1.0.0", "ipaddr.js": "^2.2.0", - "node-fetch": "^3.3.2", "nodemailer": "^6.9.16", "sqlite3": "^5.1.7", "swagger-jsdoc": "^6.2.8", @@ -52,7 +51,6 @@ "@types/express": "^5.0.0", "@types/express-handlebars": "^5.3.1", "@types/node": "^22.9.0", - "@types/node-fetch": "^2.6.12", "@types/nodemailer": "^6.4.17", "@types/supports-color": "^8.1.3", "@types/swagger-jsdoc": "^6.0.4", diff --git a/src/misc/dependencyGraphs/mermaid-all.txt b/src/misc/dependencyGraphs/mermaid-all.txt index 995f295..d2bae0c 100644 --- a/src/misc/dependencyGraphs/mermaid-all.txt +++ b/src/misc/dependencyGraphs/mermaid-all.txt @@ -3,123 +3,143 @@ flowchart LR 0["server.ts"] subgraph 1["config"] 2["hostsystem.ts"] -B["db.ts"] -1G["swaggerConfig.ts"] +4["variables.ts"] +C["initFiles.ts"] +F["db.ts"] +1L["swaggerConfig.ts"] end 3["os"] -subgraph 4["controllers"] -5["highAvailability.ts"] -9["proxy.ts"] -A["scheduler.ts"] -C["fetchData.ts"] -R["frontendConfiguration.ts"] +subgraph 5["data"] +6["variables.json"] end -6["util"] -7["init.ts"] -8["process"] -subgraph D["utils"] -E["containerService.ts"] -F["dockerClient.ts"] -U["connectionChecker.ts"] -W["extractHostData.ts"] -X["writeOfflineLog.ts"] -subgraph 12["notifications"] -13["_notify.ts"] -14["discord.ts"] -16["_template.ts"] -17["email.ts"] -18["pushbullet.ts"] -19["pushover.ts"] -1A["slack.ts"] -1B["telegram.ts"] -1C["whatsapp.ts"] +subgraph 7["controllers"] +8["highAvailability.ts"] +D["proxy.ts"] +E["scheduler.ts"] +G["fetchData.ts"] +W["frontendConfiguration.ts"] end -1F["swaggerDocs.ts"] +9["util"] +A["init.ts"] +B["process"] +subgraph H["utils"] +I["containerService.ts"] +J["dockerClient.ts"] +M["rateLimitFS.ts"] +Z["connectionChecker.ts"] +11["extractHostData.ts"] +12["writeOfflineLog.ts"] +subgraph 17["notifications"] +18["_notify.ts"] +19["discord.ts"] +1B["_template.ts"] +1C["email.ts"] +1D["pushbullet.ts"] +1E["pushover.ts"] +1F["slack.ts"] +1G["telegram.ts"] +1H["whatsapp.ts"] end -subgraph G["middleware"] -H["authMiddleware.ts"] -I["checkLock.ts"] -J["rateLimiter.ts"] +1K["swaggerDocs.ts"] end -subgraph K["routes"] -subgraph L["auth"] -M["routes.ts"] +subgraph K["middleware"] +L["authMiddleware.ts"] +N["checkLock.ts"] +O["rateLimiter.ts"] end -subgraph N["data"] -O["routes.ts"] +subgraph P["routes"] +subgraph Q["auth"] +R["routes.ts"] end -subgraph P["frontendController"] -Q["routes.ts"] -end -subgraph S["getter"] +subgraph S["data"] T["routes.ts"] end -subgraph Y["highavailability"] -Z["routes.ts"] +subgraph U["frontendController"] +V["routes.ts"] +end +subgraph X["getter"] +Y["routes.ts"] +end +subgraph 13["highavailability"] +14["routes.ts"] end -subgraph 10["notifications"] -11["routes.ts"] +subgraph 15["notifications"] +16["routes.ts"] end -subgraph 1D["setter"] -1E["routes.ts"] +subgraph 1I["setter"] +1J["routes.ts"] end end -V["net"] -15["https"] +10["net"] +1A["https"] 0-->2 -0-->5 -0-->7 +0-->8 +0-->A +2-->4 2-->3 -5-->6 -7-->9 -7-->A -7-->H -7-->I -7-->J -7-->M -7-->O -7-->Q -7-->T -7-->Z -7-->11 -7-->1E -7-->1F -7-->8 -A-->B +4-->6 +8-->4 +8-->9 A-->C -C-->B -C-->E +A-->D +A-->E +A-->L +A-->N +A-->O +A-->R +A-->T +A-->V +A-->Y +A-->14 +A-->16 +A-->1J +A-->1K +A-->B +D-->4 E-->F -O-->B -Q-->R -T-->A -T-->U -T-->E +E-->G +G-->F +G-->I +I-->J +L-->M +N-->M T-->F -T-->W -T-->X -U-->V -Z-->5 -11-->13 -13-->14 -13-->17 -13-->18 -13-->19 -13-->1A -13-->1B -13-->1C -14-->16 -14-->15 -17-->16 -18-->16 -18-->15 -19-->16 -19-->15 -1A-->16 -1A-->15 -1B-->16 -1B-->15 -1C-->16 -1C-->15 -1E-->A -1F-->1G +V-->W +Y-->E +Y-->Z +Y-->I +Y-->J +Y-->11 +Y-->12 +Z-->10 +14-->8 +16-->18 +18-->19 +18-->1C +18-->1D +18-->1E +18-->1F +18-->1G +18-->1H +19-->4 +19-->1B +19-->1A +1C-->4 +1C-->1B +1D-->4 +1D-->1B +1D-->1A +1E-->4 +1E-->1B +1E-->1A +1F-->4 +1F-->1B +1F-->1A +1G-->4 +1G-->1B +1G-->1A +1H-->4 +1H-->1B +1H-->1A +1J-->E +1K-->1L diff --git a/src/utils/removeUnusedDeps.sh b/src/utils/removeUnusedDeps.sh index df72f4b..5e806df 100755 --- a/src/utils/removeUnusedDeps.sh +++ b/src/utils/removeUnusedDeps.sh @@ -2,35 +2,35 @@ echo "Creating unused dependency list" -TMP="$(npx depcheck --ignores @types/node-fetch,uglify-js,@types/supports-color,ipaddr.js,dependency-cruiser,tsx,@types/bcrypt,@types/express,@types/express-handlebars,@types/node,ts-node --quiet --oneline | tail -n 1 | tr -d '\n')" +TMP="$(npx depcheck --ignores https,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,license-checker,uglify-js,@types/supports-color,ipaddr.js,dependency-cruiser,tsx,@types/bcrypt,@types/express,@types/express-handlebars,@types/node,ts-node --quiet --oneline | tail -n 1 | tr -d '\n')" -lines=$(echo "$TMP" | tr -s ' ' '\n' | wc -l) +lines=$(echo -n "$TMP" | tr -s ' ' '\n' | wc -l) if ((lines == 0)); then echo "No unused dependencies." else echo - echo "Removing these unused dependencies:" + echo "Removing these unused dependencies ($lines):" for entry in $TMP; do echo "$entry" done echo -fi -read -n 1 -p "Delete unused dependencies? (y/n) " input -echo + read -n 1 -p "Delete unused dependencies? (y/n) " input + echo -case $input in - Y|y) - COMMAND=$(echo "npm remove $TMP") - $COMMAND - exit 0 - ;; - *) - echo "Aborting" - exit 1 - ;; -esac + case $input in + Y|y) + COMMAND=$(echo "npm remove $TMP") + $COMMAND + exit 0 + ;; + *) + echo "Aborting" + exit 1 + ;; + esac +fi -exit 2 +exit 0