From 2682c39141a097e305513e90b6977d27d0bedf17 Mon Sep 17 00:00:00 2001 From: zefie Date: Wed, 23 Jul 2025 12:27:54 -0400 Subject: [PATCH] add nunjucks templating engine to app.js and contextObj --- zefie_wtvp_minisrv/app.js | 2 ++ zefie_wtvp_minisrv/package-lock.json | 47 ++++++++++++++++++++++++++++ zefie_wtvp_minisrv/package.json | 1 + 3 files changed, 50 insertions(+) diff --git a/zefie_wtvp_minisrv/app.js b/zefie_wtvp_minisrv/app.js index 4c0d87e6..bad0c402 100644 --- a/zefie_wtvp_minisrv/app.js +++ b/zefie_wtvp_minisrv/app.js @@ -6,6 +6,7 @@ const { WTVShared, clientShowAlert } = require(classPath + "WTVShared.js"); const wtvshared = new WTVShared(); // creates minisrv_config const fs = require('fs'); +const nunjucks = require('nunjucks'); const zlib = require('zlib'); const {serialize, unserialize} = require('php-serialize'); const {spawn} = require('child_process'); @@ -242,6 +243,7 @@ var runScriptInVM = function (script_data, user_contextObj = {}, privileged = fa "http": http, "https": https, "sharp": sharp, + "nunjucks": nunjucks, "URL": URL, "URLSearchParams": URLSearchParams, "wtvshared": wtvshared, diff --git a/zefie_wtvp_minisrv/package-lock.json b/zefie_wtvp_minisrv/package-lock.json index b61b5032..f1ed5b80 100644 --- a/zefie_wtvp_minisrv/package-lock.json +++ b/zefie_wtvp_minisrv/package-lock.json @@ -23,6 +23,7 @@ "mime-types": "^2.1.35", "newsie": "1.2.1", "nntp-server-zefie": "^3.1.0", + "nunjucks": "^3.2.4", "pcap-parser": "^0.2.1", "php-serialize": "^5.0.1", "proxy-agent": "^6.4.0", @@ -621,6 +622,12 @@ "dev": true, "license": "ISC" }, + "node_modules/a-sync-waterfall": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/a-sync-waterfall/-/a-sync-waterfall-1.0.1.tgz", + "integrity": "sha512-RYTOHHdWipFUliRFMCS4X2Yn2X8M87V/OpSqWzKKOGhzqyUxzyVmhHDH9sAvG+ZuQf/TAOFsLCpMw09I1ufUnA==", + "license": "MIT" + }, "node_modules/accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", @@ -731,6 +738,12 @@ "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", "license": "MIT" }, + "node_modules/asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", + "license": "MIT" + }, "node_modules/ast-types": { "version": "0.13.4", "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz", @@ -927,6 +940,15 @@ "simple-swizzle": "^0.2.2" } }, + "node_modules/commander": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", + "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -2349,6 +2371,31 @@ "split2": "^4.1.0" } }, + "node_modules/nunjucks": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/nunjucks/-/nunjucks-3.2.4.tgz", + "integrity": "sha512-26XRV6BhkgK0VOxfbU5cQI+ICFUtMLixv1noZn1tGU38kQH5A5nmmbk/O45xdyBhD1esk47nKrY0mvQpZIhRjQ==", + "license": "BSD-2-Clause", + "dependencies": { + "a-sync-waterfall": "^1.0.0", + "asap": "^2.0.3", + "commander": "^5.1.0" + }, + "bin": { + "nunjucks-precompile": "bin/precompile" + }, + "engines": { + "node": ">= 6.9.0" + }, + "peerDependencies": { + "chokidar": "^3.3.0" + }, + "peerDependenciesMeta": { + "chokidar": { + "optional": true + } + } + }, "node_modules/object-inspect": { "version": "1.13.4", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", diff --git a/zefie_wtvp_minisrv/package.json b/zefie_wtvp_minisrv/package.json index 7ad75bb7..1c0f0426 100644 --- a/zefie_wtvp_minisrv/package.json +++ b/zefie_wtvp_minisrv/package.json @@ -41,6 +41,7 @@ "mime-types": "^2.1.35", "newsie": "1.2.1", "nntp-server-zefie": "^3.1.0", + "nunjucks": "^3.2.4", "pcap-parser": "^0.2.1", "php-serialize": "^5.0.1", "proxy-agent": "^6.4.0",