clean up file structure

This commit is contained in:
zefie
2022-11-30 08:44:33 -05:00
parent 89407e7d51
commit 08de059758
2254 changed files with 2399 additions and 1317 deletions

4
.gitignore vendored
View File

@@ -365,9 +365,13 @@ FodyWeavers.xsd
/zefie_wtvp_minisrv/user_config.json
/zefie_wtvp_minisrv/ServiceVault/wtv-home/home.zefie.html
/zefie_wtvp_minisrv/UserServiceVault/*-*/
!/zefie_wtvp_minisrv/UserServiceVault/SharedROMCache/
/zefie_wtvp_minisrv/UserServiceVault/SharedROMCache/*-*/
/zefie_wtvp_minisrv/UserTemplates/*-*/
/zefie_wtvp_minisrv/ServiceLogPost/*.log
/zefie_wtvp_minisrv/SessionStore/*.json
/zefie_wtvp_minisrv/SessionStore/*/
/zefie_wtvp_minisrv/ServiceVault/http_pc/viewergen/viewers/HackTV.zip
/zefie_wtvp_minisrv/postest.js
/zefie_wtvp_minisrv/PageBuilderVault/http_pb/*
!/zefie_wtvp_minisrv/PageBuilderVault/http_pb/clipart

View File

@@ -373,6 +373,3 @@ FodyWeavers.xsd
# minisrv error log file
errors.log
# PageBuilder Vault
PageBuilderVault/http_pb/*
!PageBuilderVault/http_pb/clipart

View File

@@ -1,12 +1,12 @@
'use strict';
var classPath = __dirname + "/includes/";
const path = require('path');
var classPath = __dirname + path.sep + "includes" + path.sep + "classes" + path.sep;
const { WTVShared, clientShowAlert } = require(classPath + "WTVShared.js");
const wtvshared = new WTVShared(); // creates minisrv_config
classPath = wtvshared.getAbsolutePath(classPath, __dirname);
const fs = require('fs');
const tls = require('tls');
const path = require('path');
const zlib = require('zlib');
const http = require('follow-redirects').http
const https = require('follow-redirects').https
@@ -233,8 +233,8 @@ var runScriptInVM = function (script_data, user_contextObj = {}, privileged = fa
"minisrv_version_string": z_title,
"getServiceString": getServiceString,
"sendToClient": sendToClient,
"ServiceDeps": ServiceDeps,
"service_vaults": service_vaults,
"service_deps": service_deps,
"cwd": __dirname, // current working directory
// Our prototype overrides
@@ -358,10 +358,9 @@ async function processPath(socket, service_vault_file_path, request_headers = ne
if (shared_romcache.indexOf(minisrv_config.config.SharedROMCache) != -1) {
var service_path_presplit = shared_romcache.split(path.sep);
service_path_presplit.splice(service_path_presplit.findIndex((element) => element === 'ROMCache'), 1);
var service_path_romcache = service_path_presplit.join(path.sep);
var service_path_romcache = service_vault_dir + path.sep + service_path_presplit.join(path.sep);
var service_vault_file_path_romcache = wtvshared.returnAbsolutePath(wtvshared.makeSafePath(service_path_romcache));
if (fs.existsSync(service_vault_file_path_romcache)) {
service_path = service_path.replace(wtvshared.fixPathSlashes(minisrv_config.config.SharedROMCache), 'ROMCache');
service_vault_file_path = service_vault_file_path_romcache;
usingSharedROMCache = true;
@@ -1916,9 +1915,13 @@ if (minisrv_config.config.SessionStore) {
throw ("ERROR: No Session Storage Directory (SessionStore) defined!");
}
var service_deps = new Array();
if (minisrv_config.config.ServiceDeps) {
var ServiceDeps = wtvshared.returnAbsolutePath(minisrv_config.config.ServiceDeps);
console.log(" * Configured Service Dependencies at", ServiceDeps);
Object.keys(minisrv_config.config.ServiceDeps).forEach(function (k) {
var service_dep = wtvshared.returnAbsolutePath(minisrv_config.config.ServiceDeps[k]);
service_deps.push(service_dep);
console.log(" * Configured Service Dependencies at", service_dep, "with priority", (parseInt(k) + 1));
})
} else {
throw ("ERROR: No Service Dependancies Directory (SessionDeps) defined!");
}

Some files were not shown because too many files have changed in this diff Show More