diff --git a/zefie_wtvp_minisrv/app.js b/zefie_wtvp_minisrv/app.js index 70aa4ac2..7c0ddcfb 100644 --- a/zefie_wtvp_minisrv/app.js +++ b/zefie_wtvp_minisrv/app.js @@ -28,11 +28,13 @@ const WTVClientSessionData = require(classPath + "/WTVClientSessionData.js"); const WTVMime = require(classPath + "/WTVMime.js"); const WTVFlashrom = require(classPath + "/WTVFlashrom.js"); const WTVFTP = require(classPath + "/WTVFTP.js"); +const WTVPNM = require(classPath + "/WTVPNM.js"); const vm = require('vm'); const debug = require('debug')('app'); const express = require('express'); let wtvnewsserver = null; +const protocolServers = []; const minisrv_config = wtvshared.getMiniSrvConfig(); // snatches minisrv_config const wtvmime = new WTVMime(minisrv_config); @@ -2534,8 +2536,34 @@ process.on('uncaughtException', function (err) { ports.sort(); pc_ports.sort(); +Object.keys(minisrv_config.services).forEach((service_name) => { + if (typeof (minisrv_config.services[service_name]) === 'function') return; + const service = minisrv_config.services[service_name]; + if (!service || service.disabled || !service.port) return; + if (service.protocol_handler === 'pnm') { + try { + const pnmServer = new WTVPNM(minisrv_config, service_name); + pnmServer.listen(service.port, minisrv_config.config.bind_ip); + protocolServers.push(pnmServer); + console.log(" * Configured Protocol Handler:", service.protocol_handler, "for", service_name, "on Port", service.port); + } catch (e) { + throw ("Could not bind PNM protocol handler to port " + service.port + " on " + minisrv_config.config.bind_ip + ": " + e.toString()); + } + } +}); + +const protocolHandledPorts = new Set(); +Object.keys(minisrv_config.services).forEach((service_name) => { + if (typeof (minisrv_config.services[service_name]) === 'function') return; + const service = minisrv_config.services[service_name]; + if (!service || service.disabled || !service.port) return; + if (service.protocol_handler === 'pnm') { + protocolHandledPorts.add(parseInt(service.port)); + } +}); + // de-duplicate ports in case user configured multiple services on same port -const bind_ports = [...new Set(ports)] +const bind_ports = [...new Set(ports)].filter((port) => !protocolHandledPorts.has(parseInt(port))); if (!minisrv_config.config.bind_ip) minisrv_config.config.bind_ip = "0.0.0.0"; bind_ports.every(function (v) { try { diff --git a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-disk/content/Downloads.tmpl.js b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-disk/content/Downloads.tmpl.js index 3218af12..2a1db2e2 100644 --- a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-disk/content/Downloads.tmpl.js +++ b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-disk/content/Downloads.tmpl.js @@ -17,7 +17,6 @@ Welcome to Download-O-Rama. Download any of our fine file sets.
Click the ! to force download a specific file set.

Demos

-

Firmware

-