fix: allow wtv-disk scripts run unprivileged

This commit is contained in:
zefie
2022-10-09 14:43:40 -04:00
parent d265a252ec
commit 83ca0d0bac
2 changed files with 2 additions and 1 deletions

View File

@@ -1,7 +1,6 @@
var minisrv_service_file = true; var minisrv_service_file = true;
var diskmap = Object.getCaseInsensitiveKey(request_headers.query, "DiskMap"); var diskmap = Object.getCaseInsensitiveKey(request_headers.query, "DiskMap");
const WTVDownloadList = require("./WTVDownloadList.js");
var wtvdl = new WTVDownloadList(minisrv_config, service_name); var wtvdl = new WTVDownloadList(minisrv_config, service_name);
var force_update = (request_headers.query.force == "true") ? true : false; var force_update = (request_headers.query.force == "true") ? true : false;

View File

@@ -106,6 +106,7 @@ var runScriptInVM = function (script_data, user_contextObj = {}, privileged = fa
var WTVGuide = null; var WTVGuide = null;
if (fs.existsSync(__dirname + "/WTVGuide.js")) WTVGuide = require("./WTVGuide.js"); if (fs.existsSync(__dirname + "/WTVGuide.js")) WTVGuide = require("./WTVGuide.js");
var WTVBGMusic = require("./WTVBGMusic.js"); var WTVBGMusic = require("./WTVBGMusic.js");
var WTVDownloadList = require("./WTVDownloadList.js");
// create global context object // create global context object
var contextObj = { var contextObj = {
@@ -122,6 +123,7 @@ var runScriptInVM = function (script_data, user_contextObj = {}, privileged = fa
"clientShowAlert": clientShowAlert, "clientShowAlert": clientShowAlert,
"WTVClientSessionData": WTVClientSessionData, "WTVClientSessionData": WTVClientSessionData,
"WTVClientCapabilities": WTVClientCapabilities, "WTVClientCapabilities": WTVClientCapabilities,
"WTVDownloadList": WTVDownloadList,
"WTVFlashrom": WTVFlashrom, "WTVFlashrom": WTVFlashrom,
"strftime": require('strftime'), "strftime": require('strftime'),
"CryptoJS": CryptoJS, "CryptoJS": CryptoJS,