diff --git a/zefie_wtvp_minisrv/app.js b/zefie_wtvp_minisrv/app.js index 6412441a..3c2354f9 100644 --- a/zefie_wtvp_minisrv/app.js +++ b/zefie_wtvp_minisrv/app.js @@ -2452,7 +2452,7 @@ Object.keys(minisrv_config.services).forEach(function (k) { const using_tls = (minisrv_config.services[k].pc_services && minisrv_config.services[k].https_cert && minisrv_config.services[k].use_https) ? true : false; console.log(" * Configured Service:", k, "on Port", minisrv_config.services[k].port, "- Service Host:", minisrv_config.services[k].host + ((using_tls) ? " (TLS)" : ""), "- Mode:", (minisrv_config.services[k].pc_services) ? "HTTP" : "WTVP"); - if (minisrv_config.services[k].local_nntp_port) { + if (minisrv_config.services[k].local_nntp_enabled && minisrv_config.services[k].local_nntp_port) { if (!wtvnewsserver) { const WTVNewsServer = require(classPath + "/WTVNewsServer.js"); let local_nntp_using_auth = false; diff --git a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-news/news.js b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-news/news.js index 590db91f..0ca4c14f 100644 --- a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-news/news.js +++ b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-news/news.js @@ -22,7 +22,7 @@ if (service_config.local_nntp_port && wtvnewsserver) { async function throwError(e) { console.log(e); - const errpage = wtvshared.doErrorPage(400, null, e.toString()); + const errpage = wtvshared.doErrorPage(400 + " " + e.toString(), null, e.toString()); sendToClient(socket, errpage[0], errpage[1]); } @@ -48,11 +48,12 @@ async function WebTVListGroup(group) { } wtvnews.listGroup(group, page, limit_per_page).then((response) => { if (response.code === 211) { - const NGCount = response.group.number; + let NGCount = response.group.number; const NGArticles = response.group.articleNumbers; page_start = (limit_per_page * page) + 1; page_end = (page + 1) * limit_per_page; wtvnews.getHeaderObj(NGArticles).then((messages) => { + NGCount = NGArticles.length; messages = wtvnews.sortByResponse(messages); wtvnews.quitUsenet(); headers = `200 OK @@ -193,7 +194,7 @@ Group: ${request_headers.query.group} ` - if (NGCount === 0) { + if (NGCount === 0 || isNaN(NGCount)) { data += `This group has no postings`; } else { data += NGCount + " posting"; @@ -304,11 +305,11 @@ ${(message.headers.FROM.indexOf(' ') > 0) ? message.headers.FROM.split(' ')[0] : } }).catch((e) => { // listGroup error - throwError(e) - });; + throwError("No such group"); + }); }).catch((e) => { // selectGroup error - throwError(e) + throwError("No such group") }); }).catch((e) => { // connect error diff --git a/zefie_wtvp_minisrv/includes/classes/WTVNews.js b/zefie_wtvp_minisrv/includes/classes/WTVNews.js index e5603210..1b436095 100644 --- a/zefie_wtvp_minisrv/includes/classes/WTVNews.js +++ b/zefie_wtvp_minisrv/includes/classes/WTVNews.js @@ -359,6 +359,7 @@ class WTVNews { if (article === "getCaseInsensitiveKey" || isNaN(article)) continue; promises.push(new Promise((resolve, reject) => { this.getHeader(NGArticles[article]).then((data) => { + console.log(data) if (data.article) messages.push(data.article) resolve(); }).catch((e) => { diff --git a/zefie_wtvp_minisrv/includes/config.json b/zefie_wtvp_minisrv/includes/config.json index 1fea4389..1dd1ec76 100644 --- a/zefie_wtvp_minisrv/includes/config.json +++ b/zefie_wtvp_minisrv/includes/config.json @@ -136,6 +136,7 @@ "wtv-news": { // Usenet "port": 1605, + "local_nntp_enabled": true, "local_nntp_port": 5730, // Port for internal NNTP "local_nntp_requires_auth": true, // Needs to be enabled for posting "modules": [