From 7505494612cde665ae14164dbbc86c976a1eca31 Mon Sep 17 00:00:00 2001 From: zefie Date: Mon, 10 Oct 2022 13:09:18 -0400 Subject: [PATCH] fix last commit --- .../ServiceVault/http_pc/viewergen/index.js | 2 +- .../ServiceVault/wtv-1800/noflash.js | 2 +- .../ServiceVault/wtv-1800/preregister.js | 25 ++++++++++--------- zefie_wtvp_minisrv/app.js | 8 ++++++ 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/zefie_wtvp_minisrv/ServiceVault/http_pc/viewergen/index.js b/zefie_wtvp_minisrv/ServiceVault/http_pc/viewergen/index.js index 5b1a9e77..5d5d2cc7 100644 --- a/zefie_wtvp_minisrv/ServiceVault/http_pc/viewergen/index.js +++ b/zefie_wtvp_minisrv/ServiceVault/http_pc/viewergen/index.js @@ -1,7 +1,7 @@ var minisrv_service_file = true; var viewer = 2 // debug override -var viewergen_resource_dir = __dirname + "/" + minisrv_config.config.ServiceDeps + "/viewergen/"; +var viewergen_resource_dir = ServiceDeps + "/viewergen/"; var viewers = { 0: "WebTVIntel--1.0.exe", diff --git a/zefie_wtvp_minisrv/ServiceVault/wtv-1800/noflash.js b/zefie_wtvp_minisrv/ServiceVault/wtv-1800/noflash.js index 2f80f353..3bbfb5ce 100644 --- a/zefie_wtvp_minisrv/ServiceVault/wtv-1800/noflash.js +++ b/zefie_wtvp_minisrv/ServiceVault/wtv-1800/noflash.js @@ -29,7 +29,7 @@ wtv-client-time-zone: GMT -0000 wtv-client-time-dst-rule: GMT wtv-client-date: `+ strftime("%a, %d %b %Y %H:%M:%S", new Date(new Date().toUTCString())) + ` GMT`; - var file_path = __dirname + "/" + minisrv_config.config.ServiceDeps + "/wtv-1800/tellyscripts/bf0app/bf0app_WTV_18006138199.tok"; + var file_path = ServiceDeps + "/wtv-1800/tellyscripts/bf0app/bf0app_WTV_18006138199.tok"; if (file_path) { request_is_async = true; diff --git a/zefie_wtvp_minisrv/ServiceVault/wtv-1800/preregister.js b/zefie_wtvp_minisrv/ServiceVault/wtv-1800/preregister.js index 969d3f9b..12a01622 100644 --- a/zefie_wtvp_minisrv/ServiceVault/wtv-1800/preregister.js +++ b/zefie_wtvp_minisrv/ServiceVault/wtv-1800/preregister.js @@ -77,22 +77,23 @@ if (session_data.data_store.wtvsec_login) { case "US-WEBSTAR-disk-0MB-16MB-softmodem-CPU5230": prereg_contype = "text/tellyscript"; // if wtv-open-access: true then client expects OpenISP - if (session_data.get("wtv-open-access")) file_path = __dirname + "/" + minisrv_config.config.ServiceDeps + "/wtv-1800/tellyscripts/LC2/LC2_OpenISP_56k.tok"; - else var file_path = __dirname + "/" + minisrv_config.config.ServiceDeps + "/wtv-1800/tellyscripts/LC2/LC2_WTV_18006138199.tok"; + if (session_data.get("wtv-open-access")) file_path = __dirname + "/" + + + "/wtv-1800/tellyscripts/LC2/LC2_OpenISP_56k.tok"; + else var file_path = ServiceDeps+ "/wtv-1800/tellyscripts/LC2/LC2_WTV_18006138199.tok"; break; case "US-DTV-disk-0MB-32MB-softmodem-CPU5230": if (wtvshared.isMiniBrowser(session_data)) { prereg_contype = "text/tellyscript"; - if (session_data.get("wtv-open-access")) file_path = __dirname + "/" + minisrv_config.config.ServiceDeps + "/wtv-1800/tellyscripts/LC2/LC2_OpenISP_56k.tok"; - else file_path = __dirname + "/" + minisrv_config.config.ServiceDeps + "/wtv-1800/tellyscripts/LC2/LC2_WTV_18006138199.tok"; + if (session_data.get("wtv-open-access")) file_path = ServiceDeps+ "/wtv-1800/tellyscripts/LC2/LC2_OpenISP_56k.tok"; + else file_path = ServiceDeps+ "/wtv-1800/tellyscripts/LC2/LC2_WTV_18006138199.tok"; } else { prereg_contype = "text/dialscript"; if (session_data.get("wtv-lan") == "true") { - file_path = __dirname + "/" + minisrv_config.config.ServiceDeps + "/wtv-1800/tellyscripts/UTV/utv_hsd.tok"; + file_path = ServiceDeps+ "/wtv-1800/tellyscripts/UTV/utv_hsd.tok"; } else { // todo OpenISP telly - file_path = __dirname + "/" + minisrv_config.config.ServiceDeps + "/wtv-1800/tellyscripts/UTV/utv_normal.tok"; + file_path = ServiceDeps+ "/wtv-1800/tellyscripts/UTV/utv_normal.tok"; } } break; @@ -100,8 +101,8 @@ if (session_data.data_store.wtvsec_login) { case "bf0app": prereg_contype = "text/tellyscript"; // if wtv-open-access: true then client expects OpenISP - if (session_data.get("wtv-open-access")) file_path = __dirname + "/" + minisrv_config.config.ServiceDeps + "/wtv-1800/tellyscripts/bf0app/bf0app_OISP.tok"; - else file_path = __dirname + "/" + minisrv_config.config.ServiceDeps + "/wtv-1800/tellyscripts/bf0app/bf0app_WTV_18006138199.tok"; + if (session_data.get("wtv-open-access")) file_path = ServiceDeps+ "/wtv-1800/tellyscripts/bf0app/bf0app_OISP.tok"; + else file_path = ServiceDeps+ "/wtv-1800/tellyscripts/bf0app/bf0app_WTV_18006138199.tok"; break; // the following are not yet zefie generated and may have an unknown username/password attached @@ -109,8 +110,8 @@ if (session_data.data_store.wtvsec_login) { case "JP-Fiji": prereg_contype = "text/tellyscript"; // if wtv-open-access: true then client expects OpenISP - if (session_data.get("wtv-open-access")) var file_path = __dirname + "/" + minisrv_config.config.ServiceDeps + "/wtv-1800/tellyscripts/FIJI/dc_production_normal.tok"; - else var file_path = __dirname + "/" + minisrv_config.config.ServiceDeps + "/wtv-1800/tellyscripts/FIJI/dc_production_normal.tok"; + if (session_data.get("wtv-open-access")) var file_path = ServiceDeps+ "/wtv-1800/tellyscripts/FIJI/dc_production_normal.tok"; + else var file_path = ServiceDeps+ "/wtv-1800/tellyscripts/FIJI/dc_production_normal.tok"; break; default: @@ -120,7 +121,7 @@ if (session_data.data_store.wtvsec_login) { if (socket.ssid.substr(0, 8) == "MSTVSIMU") { prereg_contype = "text/dialscript"; - var file_path = __dirname + "/" + minisrv_config.config.ServiceDeps + "/wtv-1800/tellyscripts/UTV/utv_hsd.tok"; + var file_path = ServiceDeps+ "/wtv-1800/tellyscripts/UTV/utv_hsd.tok"; } } @@ -129,7 +130,7 @@ if (session_data.data_store.wtvsec_login) { // assume old classic in flash mode, override user setting and send tellyscript // because it is required to proceed in flash mode prereg_contype = "text/tellyscript"; - var file_path = __dirname + "/" + minisrv_config.config.ServiceDeps + "/wtv-1800/tellyscripts/bf0app/bf0app_WTV_18006138199.tok"; + var file_path = ServiceDeps+ "/wtv-1800/tellyscripts/bf0app/bf0app_WTV_18006138199.tok"; var bf0app_update = true; session_data.set("bf0app_update", bf0app_update); } diff --git a/zefie_wtvp_minisrv/app.js b/zefie_wtvp_minisrv/app.js index 22e042e4..07442920 100644 --- a/zefie_wtvp_minisrv/app.js +++ b/zefie_wtvp_minisrv/app.js @@ -141,6 +141,7 @@ var runScriptInVM = function (script_data, user_contextObj = {}, privileged = fa "minisrv_version_string": z_title, "getServiceString": getServiceString, "sendToClient": sendToClient, + "ServiceDeps": ServiceDeps, "service_vaults": service_vaults, "cwd": __dirname, // current working directory @@ -1817,6 +1818,13 @@ if (minisrv_config.config.SessionStore) { throw ("ERROR: No Session Storage Directory (SessionStore) defined!"); } +if (minisrv_config.config.ServiceDeps) { + var ServiceDeps = wtvshared.returnAbsolutePath(minisrv_config.config.ServiceDeps); + console.log(" * Configured Service Dependancies at", ServiceDeps); +} else { + throw ("ERROR: No Service Dependancies Directory (SessionDeps) defined!"); +} + var service_ip = minisrv_config.config.service_ip; Object.keys(minisrv_config.services).forEach(function (k) { if (minisrv_config.services[k].disabled) return;