Compare commits

..

2 commits
main ... stable

4 changed files with 4 additions and 39 deletions

View file

@ -1,4 +1,4 @@
{ {
"name": "Integration with ModSecurity", "name": "Integration with ModSecurity",
"version": "Nightly-GitMain" "version": "1.0.1"
} }

19
package-lock.json generated
View file

@ -31,7 +31,6 @@
"prettier": "^3.3.3", "prettier": "^3.3.3",
"rimraf": "^5.0.10", "rimraf": "^5.0.10",
"wait-on": "^8.0.1", "wait-on": "^8.0.1",
"yaml": "^2.7.0",
"zip": "^1.2.0" "zip": "^1.2.0"
} }
}, },
@ -5898,18 +5897,6 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/lint-staged/node_modules/yaml": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.1.tgz",
"integrity": "sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==",
"dev": true,
"bin": {
"yaml": "bin.mjs"
},
"engines": {
"node": ">= 14"
}
},
"node_modules/listr2": { "node_modules/listr2": {
"version": "8.2.5", "version": "8.2.5",
"resolved": "https://registry.npmjs.org/listr2/-/listr2-8.2.5.tgz", "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.2.5.tgz",
@ -8034,9 +8021,9 @@
"dev": true "dev": true
}, },
"node_modules/yaml": { "node_modules/yaml": {
"version": "2.7.0", "version": "2.6.1",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.1.tgz",
"integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", "integrity": "sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==",
"dev": true, "dev": true,
"bin": { "bin": {
"yaml": "bin.mjs" "yaml": "bin.mjs"

View file

@ -33,7 +33,6 @@
"prettier": "^3.3.3", "prettier": "^3.3.3",
"rimraf": "^5.0.10", "rimraf": "^5.0.10",
"wait-on": "^8.0.1", "wait-on": "^8.0.1",
"yaml": "^2.7.0",
"zip": "^1.2.0" "zip": "^1.2.0"
}, },
"dependencies": { "dependencies": {

View file

@ -4,7 +4,6 @@ const fs = require("fs");
const https = require("https"); const https = require("https");
const zip = require("zip"); const zip = require("zip");
const zlib = require("zlib"); const zlib = require("zlib");
const YAML = require("yaml");
function downloadSVRJS(version) { function downloadSVRJS(version) {
const normalizedVersion = version.toLowerCase().replace(/[^0-9a-z]+/g, "."); const normalizedVersion = version.toLowerCase().replace(/[^0-9a-z]+/g, ".");
@ -69,26 +68,6 @@ function downloadSVRJS(version) {
fs.unlinkSync(__dirname + "/svrjs/svr.compressed"); fs.unlinkSync(__dirname + "/svrjs/svr.compressed");
fs.writeFileSync(__dirname + "/svrjs/svr.js", script); fs.writeFileSync(__dirname + "/svrjs/svr.js", script);
} }
if (fs.existsSync(__dirname + "/svrjs/svrjs.yaml")) {
console.log("Modifying SVR.JS configuration...");
let svrjsConfig = YAML.parse(fs.readFileSync(__dirname + "/svrjs/svrjs.yaml"));
if (!svrjsConfig) svrjsConfig = {};
if (!svrjsConfig.global) svrjsConfig.global = {};
svrjsConfig.global.enableDirectoryListing = true;
svrjsConfig.global.stackHidden = false;
svrjsConfig.global.exposeServerVersion = true;
svrjsConfig.global.exposeModsInErrorPages = true;
fs.writeFileSync(__dirname + "/svrjs/svrjs.yaml", YAML.stringify(svrjsConfig));
} else if (fs.existsSync(__dirname + "/svrjs/config.json")) {
console.log("Modifying SVR.JS configuration...");
let svrjsConfig = JSON.parse(fs.readFileSync(__dirname + "/svrjs/config.json"));
if (!svrjsConfig) svrjsConfig = {};
svrjsConfig.enableDirectoryListing = true;
svrjsConfig.stackHidden = false;
svrjsConfig.exposeServerVersion = true;
svrjsConfig.exposeModsInErrorPages = true;
fs.writeFileSync(__dirname + "/svrjs/svrjs.yaml", JSON.stringify(svrjsConfig, null, 2));
}
console.log("SVR.JS is installed successfully."); console.log("SVR.JS is installed successfully.");
}); });
} }