incomplete NNTP usenet support
This commit is contained in:
@@ -47,7 +47,8 @@ minisrv v${minisrv_config.version}${(minisrv_config.config.git_commit) ? ' git-'
|
|||||||
<li><a href="client:relog">client:relog (direct)</a></li>
|
<li><a href="client:relog">client:relog (direct)</a></li>
|
||||||
<li><a href="wtv-flashrom:/willie" selected>Ultra Willies</a> ~ <a href="wtv-tricks:/tricks">Tricks</a></li>
|
<li><a href="wtv-flashrom:/willie" selected>Ultra Willies</a> ~ <a href="wtv-tricks:/tricks">Tricks</a></li>
|
||||||
<li><a href="wtv-setup:/setup">Setup (Including BG Music)</a></li>
|
<li><a href="wtv-setup:/setup">Setup (Including BG Music)</a></li>
|
||||||
<li><a href="${ssid_sessions[socket.ssid].mailstore.checkMailIntroSeen() ? 'wtv-mail:/listmail' : 'wtv-mail:/DiplomaMail'}">Mail (not ready)</a>
|
<li><a href="${ssid_sessions[socket.ssid].mailstore.checkMailIntroSeen() ? 'wtv-mail:/listmail' : 'wtv-mail:/DiplomaMail'}">Mail (beta)</a>
|
||||||
|
<li><a href="wtv-news:/lobby">Usenet (not ready)</a>
|
||||||
`;
|
`;
|
||||||
if (ssid_sessions[socket.ssid].hasCap("client-can-do-chat")) {
|
if (ssid_sessions[socket.ssid].hasCap("client-can-do-chat")) {
|
||||||
data += "<li><a href=\"wtv-chat:/home\">IRC Chat Test</a></li>\n"
|
data += "<li><a href=\"wtv-chat:/home\">IRC Chat Test</a></li>\n"
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ if (!intro_seen && !request_headers.query.intro_seen) {
|
|||||||
'noback': true,
|
'noback': true,
|
||||||
}).getURL();
|
}).getURL();
|
||||||
|
|
||||||
headers = "300 OK\nwtv-visit: " + clientErrorMsg;
|
headers = "200 OK\nwtv-visit: " + clientErrorMsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request_headers.query.clear == "true") {
|
if (request_headers.query.clear == "true") {
|
||||||
@@ -28,8 +28,16 @@ wtv-expire: wtv-mail:/sendmail
|
|||||||
Location: wtv-mail:/sendmail`;
|
Location: wtv-mail:/sendmail`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var newsgroup = null;
|
||||||
|
if (request_headers.query.discuss) {
|
||||||
|
newsgroup = request_headers.query.group || request_headers.query.message_to || null;
|
||||||
|
var to_addr = newsgroup;
|
||||||
|
var pageTitle = "Post to " + newsgroup;
|
||||||
|
} else {
|
||||||
var to_addr = request_headers.query.message_to || null;
|
var to_addr = request_headers.query.message_to || null;
|
||||||
|
var pageTitle = "Write an e-mail message"
|
||||||
|
}
|
||||||
|
|
||||||
var msg_subject = request_headers.query.message_subject || null;
|
var msg_subject = request_headers.query.message_subject || null;
|
||||||
var msg_body = request_headers.query.message_body || null;
|
var msg_body = request_headers.query.message_body || null;
|
||||||
var to_name = request_headers.query.whatever_webtv_sends_this_as || null;
|
var to_name = request_headers.query.whatever_webtv_sends_this_as || null;
|
||||||
@@ -47,6 +55,7 @@ Location: wtv-mail:/sendmail`;
|
|||||||
if (mail_draft_data.no_signature) no_signature = mail_draft_data.no_signature;
|
if (mail_draft_data.no_signature) no_signature = mail_draft_data.no_signature;
|
||||||
if (mail_draft_data.msg_url) msg_url = mail_draft_data.msg_url;
|
if (mail_draft_data.msg_url) msg_url = mail_draft_data.msg_url;
|
||||||
if (mail_draft_data.msg_url_title) msg_url_title = mail_draft_data.msg_url_title;
|
if (mail_draft_data.msg_url_title) msg_url_title = mail_draft_data.msg_url_title;
|
||||||
|
if (mail_draft.data.newsgroup) newsgroup = mail_draft_data.newsgroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request_headers.query.togglesign == "true") no_signature = false;
|
if (request_headers.query.togglesign == "true") no_signature = false;
|
||||||
@@ -71,7 +80,7 @@ Content-Type: audio/wav`;
|
|||||||
|
|
||||||
var username = ssid_sessions[socket.ssid].getSessionData("subscriber_username");
|
var username = ssid_sessions[socket.ssid].getSessionData("subscriber_username");
|
||||||
var userdisplayname = wtvshared.htmlEntitize(ssid_sessions[socket.ssid].getSessionData("subscriber_name"));
|
var userdisplayname = wtvshared.htmlEntitize(ssid_sessions[socket.ssid].getSessionData("subscriber_name"));
|
||||||
var address = username + "@" + minisrv_config.config.service_name
|
var address = username + "@" + minisrv_config.config.domain_name
|
||||||
var notImplementedAlert = new clientShowAlert({
|
var notImplementedAlert = new clientShowAlert({
|
||||||
'image': minisrv_config.config.service_logo,
|
'image': minisrv_config.config.service_logo,
|
||||||
'message': "This feature is not available.",
|
'message': "This feature is not available.",
|
||||||
@@ -102,7 +111,66 @@ Content-Type: audio/wav`;
|
|||||||
attachments.push({ 'Content-Type': 'audio/wav', data: new message_voicemail_data });
|
attachments.push({ 'Content-Type': 'audio/wav', data: new message_voicemail_data });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (newsgroup !== null) {
|
||||||
|
var request_is_async = true;
|
||||||
|
if (msg_body === null) {
|
||||||
|
doClientError("Please type a message to send to the group.");
|
||||||
|
sendToClient(socket, headers, '');
|
||||||
|
} else {
|
||||||
|
const Client = require('newsie').default
|
||||||
|
const client = new Client({
|
||||||
|
host: minisrv_config.services[request_headers.query['discuss-prefix'] || "wtv-news"].upstream_address,
|
||||||
|
port: minisrv_config.services[request_headers.query['discuss-prefix'] || "wtv-news"].upstream_port
|
||||||
|
})
|
||||||
|
|
||||||
|
client.connect()
|
||||||
|
.then(response => {
|
||||||
|
return client.post()
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
if (response.code == 340) {
|
||||||
|
var articleData = {};
|
||||||
|
articleData.headers = {
|
||||||
|
'Relay-Version': "version zefie_wtvp_minisrv " + minisrv_config.version + "; site " + minisrv_config.config.domain_name,
|
||||||
|
'Posting-Version': "version zefie_wtvp_minisrv " + minisrv_config.version + "; site " + minisrv_config.config.domain_name,
|
||||||
|
'Path': "@" + minisrv_config.config.domain_name,
|
||||||
|
'From': from_addr,
|
||||||
|
'Newsgroups': newsgroup,
|
||||||
|
'Subject': msg_subject || "(No subject)",
|
||||||
|
'Message-ID': "<"+ssid_sessions[socket.ssid].generatePassword(16) + "@" + minisrv_config.config.domain_name+">",
|
||||||
|
'Date': strftime('%A, %d-%b-%y %k:%M:%S %z', new Date())
|
||||||
|
}
|
||||||
|
if (msg_body) {
|
||||||
|
articleData.body = msg_body.split("\n");
|
||||||
|
} else {
|
||||||
|
articleData.body = [];
|
||||||
|
}
|
||||||
|
return response.send(articleData);
|
||||||
|
} else {
|
||||||
|
clientErrorMsg("Could not send post. Server returned error " + response.code);
|
||||||
|
sendToClient(socket, headers, '');
|
||||||
|
return client.quit();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
if (response.code !== 240) {
|
||||||
|
clientErrorMsg("Could not send post. Server returned error " + response.code);
|
||||||
|
sendToClient(socket, headers, '');
|
||||||
|
} else {
|
||||||
|
headers = `300 OK
|
||||||
|
wtv-expire: wtv-news:/news?group=${newsgroup}
|
||||||
|
wtv-expire: wtv-mail:/sendmail
|
||||||
|
Location: wtv-news:/news?group=${newsgroup}`;
|
||||||
|
sendToClient(socket, headers, '');
|
||||||
|
return client.quit()
|
||||||
|
}
|
||||||
|
}).catch(e => {
|
||||||
|
console.log('usenet upstream uncaught error', e);
|
||||||
|
clientErrorMsg("Could not send post. Server returned unknown error");
|
||||||
|
sendToClient(socket, headers, '');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
var messagereturn = ssid_sessions[socket.ssid].mailstore.sendMessageToAddr(from_addr, to_addr, msg_body, msg_subject, userdisplayname, to_name, signature, attachments, msg_url, msg_url_title);
|
var messagereturn = ssid_sessions[socket.ssid].mailstore.sendMessageToAddr(from_addr, to_addr, msg_body, msg_subject, userdisplayname, to_name, signature, attachments, msg_url, msg_url_title);
|
||||||
if (messagereturn !== true) {
|
if (messagereturn !== true) {
|
||||||
var errpage = wtvshared.doErrorPage(400, messagereturn);
|
var errpage = wtvshared.doErrorPage(400, messagereturn);
|
||||||
@@ -116,6 +184,7 @@ wtv-expire: wtv-mail:/listmail
|
|||||||
wtv-expire: wtv-mail:/sendmail
|
wtv-expire: wtv-mail:/sendmail
|
||||||
Location: wtv-mail:/listmail`;
|
Location: wtv-mail:/listmail`;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else if (request_headers.query.saveoff) {
|
} else if (request_headers.query.saveoff) {
|
||||||
var mail_draft_data = {
|
var mail_draft_data = {
|
||||||
@@ -124,7 +193,8 @@ Location: wtv-mail:/listmail`;
|
|||||||
msg_body: msg_body,
|
msg_body: msg_body,
|
||||||
no_signature: no_signature,
|
no_signature: no_signature,
|
||||||
msg_url: msg_url,
|
msg_url: msg_url,
|
||||||
msg_url_title: msg_url_title
|
msg_url_title: msg_url_title,
|
||||||
|
newsgroup: newsgroup
|
||||||
}
|
}
|
||||||
ssid_sessions[socket.ssid].setSessionData("mail_draft", mail_draft_data);
|
ssid_sessions[socket.ssid].setSessionData("mail_draft", mail_draft_data);
|
||||||
headers = `200 OK
|
headers = `200 OK
|
||||||
@@ -195,7 +265,7 @@ location = "client:submitform?name=sendform&submitname=gabbing&submitvalue=true"
|
|||||||
location.reload(); }
|
location.reload(); }
|
||||||
</script>
|
</script>
|
||||||
<title>
|
<title>
|
||||||
Write an e-mail message
|
${pageTitle}
|
||||||
</title>
|
</title>
|
||||||
</head>
|
</head>
|
||||||
<body bgcolor="#171726" text="${message_colors.text}" link="${message_colors.link}" vlink="${message_colors.vlink}" vspace=0 hspace=0>
|
<body bgcolor="#171726" text="${message_colors.text}" link="${message_colors.link}" vlink="${message_colors.vlink}" vspace=0 hspace=0>
|
||||||
@@ -203,6 +273,7 @@ Write an e-mail message
|
|||||||
<input type=hidden name="wtv-saved-message-id" value="writemessage-outbox">
|
<input type=hidden name="wtv-saved-message-id" value="writemessage-outbox">
|
||||||
<input type=hidden name="message_reply_all_cc" value="">
|
<input type=hidden name="message_reply_all_cc" value="">
|
||||||
<input type=hidden name="saveoff" value="true" autosubmit="onleave">
|
<input type=hidden name="saveoff" value="true" autosubmit="onleave">
|
||||||
|
<input type=hidden name="discuss" value="${request_headers.query.discuss ? true : false}">
|
||||||
<sidebar width=109>
|
<sidebar width=109>
|
||||||
<table cellspacing=0 cellpadding=0>
|
<table cellspacing=0 cellpadding=0>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -230,18 +301,22 @@ Write an e-mail message
|
|||||||
<td height=1>
|
<td height=1>
|
||||||
<tr>
|
<tr>
|
||||||
<td><shadow><font sizerange=medium color=#E6CD4A>Mail list</font></shadow>
|
<td><shadow><font sizerange=medium color=#E6CD4A>Mail list</font></shadow>
|
||||||
</table>
|
</table>`;
|
||||||
|
if (!newsgroup) {
|
||||||
|
data += `
|
||||||
<td width=5>
|
<td width=5>
|
||||||
<tr> <td bgcolor=#4A525A height=2 width=104 colspan=3>
|
<tr> <td bgcolor=#4A525A height=2 width=104 colspan=3>
|
||||||
<tr>
|
<tr>
|
||||||
<td width=10 height=26>
|
<td width=10 height=26>
|
||||||
<td width=89 valgn=middle>
|
<td width=89 valgn=middle>;
|
||||||
<table cellspacing=0 cellpadding=0 href="client:openaddresspanel" id=addressbook>
|
<table cellspacing=0 cellpadding=0 href="client:openaddresspanel" id=addressbook>
|
||||||
<tr>
|
<tr>
|
||||||
<td height=1>
|
<td height=1>
|
||||||
<tr>
|
<tr>
|
||||||
<td><shadow><font sizerange=medium color=#E6CD4A>Address</font></shadow>
|
<td><shadow><font sizerange=medium color=#E6CD4A>Address</font></shadow>;
|
||||||
</table>
|
</table>`;
|
||||||
|
}
|
||||||
|
data += `
|
||||||
<td width=5>
|
<td width=5>
|
||||||
<tr> <td bgcolor=#4A525A height=2 width=104 colspan=3>
|
<tr> <td bgcolor=#4A525A height=2 width=104 colspan=3>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -288,7 +363,7 @@ Write an e-mail message
|
|||||||
<table cellspacing=0 cellpadding=0 border=0>
|
<table cellspacing=0 cellpadding=0 border=0>
|
||||||
<tr>
|
<tr>
|
||||||
<td width=451 colspan=2 align=center bgcolor=#5B6C81>
|
<td width=451 colspan=2 align=center bgcolor=#5B6C81>
|
||||||
<spacer type=vertical size=13>
|
<spacer type=vertical size=4>
|
||||||
<tr>
|
<tr>
|
||||||
<td height=8 bgcolor=#171726 colspan=2>
|
<td height=8 bgcolor=#171726 colspan=2>
|
||||||
<img src="wtv-mail:/content/images/CornerTop.gif" width=8 height=8>
|
<img src="wtv-mail:/content/images/CornerTop.gif" width=8 height=8>
|
||||||
@@ -314,7 +389,7 @@ Write an e-mail message
|
|||||||
<spacer type=horizontal size=13>
|
<spacer type=horizontal size=13>
|
||||||
<td width=370 maxlines=1>
|
<td width=370 maxlines=1>
|
||||||
<font sizerange=medium color=#D6D6D6><blackface>
|
<font sizerange=medium color=#D6D6D6><blackface>
|
||||||
Write an e-mail message
|
${pageTitle}
|
||||||
</blackface></font>
|
</blackface></font>
|
||||||
<!--
|
<!--
|
||||||
<td width=21>
|
<td width=21>
|
||||||
@@ -358,8 +433,13 @@ ${address}
|
|||||||
<td height=13 valign=middle colspan=2>
|
<td height=13 valign=middle colspan=2>
|
||||||
<img src="wtv-mail:/content/images/sendmail_panel_dots.gif" width=385 height=2>
|
<img src="wtv-mail:/content/images/sendmail_panel_dots.gif" width=385 height=2>
|
||||||
<tr>
|
<tr>
|
||||||
<td width=80 valign=top align=right>
|
<td width=80 valign=top align=right>`;
|
||||||
<a href="client:openaddresspanel">To:</a>
|
if (!request_headers.query.discuss) {
|
||||||
|
data += '<a href="client:openaddresspanel">To:</a>';
|
||||||
|
} else {
|
||||||
|
data += 'To:';
|
||||||
|
}
|
||||||
|
data += `
|
||||||
<td width=305 valign=top>
|
<td width=305 valign=top>
|
||||||
<textarea
|
<textarea
|
||||||
bgcolor="${message_colors.bgcolor}"
|
bgcolor="${message_colors.bgcolor}"
|
||||||
@@ -377,7 +457,9 @@ growable
|
|||||||
autoactivate
|
autoactivate
|
||||||
addresses
|
addresses
|
||||||
autoascii
|
autoascii
|
||||||
nohighlight
|
nohighlight`;
|
||||||
|
if (newsgroup) { data += "\nreadonly" }
|
||||||
|
data += `
|
||||||
>${(to_addr) ? to_addr : ''}</textarea>
|
>${(to_addr) ? to_addr : ''}</textarea>
|
||||||
<tr>
|
<tr>
|
||||||
<td height=13 valign=middle colspan=2>
|
<td height=13 valign=middle colspan=2>
|
||||||
|
|||||||
157
zefie_wtvp_minisrv/ServiceVault/wtv-news/lobby.js
Normal file
157
zefie_wtvp_minisrv/ServiceVault/wtv-news/lobby.js
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
var minisrv_service_file = true;
|
||||||
|
|
||||||
|
headers = `200 OK
|
||||||
|
Connection: Keep-Alive
|
||||||
|
Content-Type: text/html`
|
||||||
|
|
||||||
|
data = `<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<DISPLAY fontsize=medium>
|
||||||
|
<TITLE>Featured discussion groups</TITLE>
|
||||||
|
</HEAD>
|
||||||
|
<sidebar width=114 height=420 align=left>
|
||||||
|
<table cellspacing=0 cellpadding=0 bgcolor=3d2f3a>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 width=104 absheight=4>
|
||||||
|
<td rowspan=100 width=10 height=420 valign=top align=left bgcolor=191919>
|
||||||
|
<img src="wtv-mail:/ROMCache/Shadow.gif" width=6 height=420>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=6>
|
||||||
|
<td abswidth=93 absheight=76>
|
||||||
|
<table href="wtv-home:/home" absheight=76 cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td align=right>
|
||||||
|
<img src="wtv-home:/ROMCache/WebTVLogoJewel.gif" width=87 height=67>
|
||||||
|
</table>
|
||||||
|
<td abswidth=5>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=middle align=center bgcolor=231d22>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=1 valign=top align=left <img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=top align=left bgcolor=5b4b58>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=6 >
|
||||||
|
<td abswidth=93 absheight=26 >
|
||||||
|
<table href="wtv-news:news?category=1"
|
||||||
|
cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=5>
|
||||||
|
<td abswidth=90 valign=middle align=left>
|
||||||
|
<table bgcolor=3d2f3a cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td absheight=1>
|
||||||
|
<tr>
|
||||||
|
<td maxlines=1>
|
||||||
|
<shadow><font sizerange=medium color="E7CE4A">All groups</font></shadow></table>
|
||||||
|
</table>
|
||||||
|
<td abswidth=5>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=middle align=center bgcolor=231d22>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=1 valign=top align=left <img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=top align=left bgcolor=5b4b58>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=6 >
|
||||||
|
<td abswidth=93 absheight=26 >
|
||||||
|
<table href="wtv-guide:/help?topic=Discuss&subtopic=Index&appName=Discuss"
|
||||||
|
cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=5>
|
||||||
|
<td abswidth=90 valign=middle align=left>
|
||||||
|
<table bgcolor=3d2f3a cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td absheight=1>
|
||||||
|
<tr>
|
||||||
|
<td maxlines=1>
|
||||||
|
<shadow><font sizerange=medium color="E7CE4A">Help</font></shadow></table>
|
||||||
|
</table>
|
||||||
|
<td abswidth=5>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=middle align=center bgcolor=231d22>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=1 valign=top align=left <img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=top align=left bgcolor=5b4b58>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 height=237 valign=bottom align=right >
|
||||||
|
<img src="wtv-forum:/images/BannerDiscuss.gif" width=50 height=165> <tr><td colspan=3 absheight=36>
|
||||||
|
</table>
|
||||||
|
</sidebar>
|
||||||
|
<body
|
||||||
|
bgcolor="191919" text="42BD52" link="189CD6"
|
||||||
|
vlink="189CD6"
|
||||||
|
hspace=0
|
||||||
|
vspace=0>
|
||||||
|
<table cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=10>
|
||||||
|
<td colspan=3>
|
||||||
|
<table cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td valign=center absheight=80>
|
||||||
|
<font size="+2" color="E7CE4A"><blackface><shadow>
|
||||||
|
Featured discussions
|
||||||
|
</table>
|
||||||
|
<td abswidth=20>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<td WIDTH=198 HEIGHT=200 VALIGN=top ALIGN=left>
|
||||||
|
<a href="wtv-news:/news?group=webtv.users"><b>WebTV</b></a><br>
|
||||||
|
A moderated discussion with WebTV customers<br>
|
||||||
|
<IMG SRC="wtv-home:/ROMCache/Spacer.gif" WIDTH=1 HEIGHT=18><BR>
|
||||||
|
<a href="wtv-news:/news?group=alt.discuss.webtv.hacking"><b>Hacking</b></a><br>
|
||||||
|
Not grandma friendly<br>
|
||||||
|
<IMG SRC="wtv-home:/ROMCache/Spacer.gif" WIDTH=1 HEIGHT=18><BR>
|
||||||
|
<a href="wtv-news:/news?group=rec.autos.4x4"><b>4x4s</b></a><br>
|
||||||
|
The on and off-road four wheel drive vehicle<br>
|
||||||
|
<IMG SRC="wtv-home:/ROMCache/Spacer.gif" WIDTH=1 HEIGHT=18><BR>
|
||||||
|
<td WIDTH=20>
|
||||||
|
<td WIDTH=198 HEIGHT=220 VALIGN=top ALIGN=left>
|
||||||
|
<a href="wtv-news:/news?group=webtv.plus"><b>WebTV Plus</b></a><br>
|
||||||
|
bf0 is for bitches and BPS is boring<br>
|
||||||
|
<IMG SRC="wtv-home:/ROMCache/Spacer.gif" WIDTH=1 HEIGHT=18><BR>
|
||||||
|
<a href="wtv-news:/news?group=alt.discuss.midis"><b>MIDIs</b></a><br>
|
||||||
|
The best music format<br>
|
||||||
|
<IMG SRC="wtv-home:/ROMCache/Spacer.gif" WIDTH=1 HEIGHT=18><BR>
|
||||||
|
<a href="wtv-news:/news?group=alt.discuss.html"><b>HTML</b></a><br>
|
||||||
|
Every timeline starts with HTML<br>
|
||||||
|
<IMG SRC="wtv-home:/ROMCache/Spacer.gif" WIDTH=1 HEIGHT=18><BR>
|
||||||
|
</table>
|
||||||
|
<TABLE width=446 cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td rowspan=3 width=10 height=1>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=10 height=1>
|
||||||
|
<td height=2 width=436 bgcolor="2B2B2B">
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=436 height=1>
|
||||||
|
<tr>
|
||||||
|
<td height=1>
|
||||||
|
<tr>
|
||||||
|
<td height=2 bgcolor="0D0D0D">
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
</TABLE>
|
||||||
|
<table cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td rowspan=2 abswidth=10>
|
||||||
|
<td absheight=10>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=416 valign=top align=left>
|
||||||
|
Type a discussion topic<br>
|
||||||
|
<img src="/ROMCache/Spacer.gif" width=1 height=4>
|
||||||
|
<form action="wtv-news:search">
|
||||||
|
<input name="search" bgcolor=#202020 cursor=#cc9933 text="E7CE4A" font=proportional value="" SIZE=28 MAXLENGTH=100>
|
||||||
|
|
||||||
|
<font color=E7CE4A><shadow>
|
||||||
|
<input type=submit borderimage="file://ROM/Borders/ButtonBorder2.bif" value="Look for" usestyle>
|
||||||
|
</shadow></font>
|
||||||
|
</form>
|
||||||
|
</table>
|
||||||
|
</BODY>
|
||||||
|
</HTML>`;
|
||||||
625
zefie_wtvp_minisrv/ServiceVault/wtv-news/news.js
Normal file
625
zefie_wtvp_minisrv/ServiceVault/wtv-news/news.js
Normal file
@@ -0,0 +1,625 @@
|
|||||||
|
var minisrv_service_file = true;
|
||||||
|
|
||||||
|
async function clientConnect(client) {
|
||||||
|
response = await client.connect()
|
||||||
|
if (response.code == 200) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function listGroup(client, group) {
|
||||||
|
try {
|
||||||
|
return await client.listGroup(group)
|
||||||
|
} catch (e) {
|
||||||
|
console.log("WTVNews Error -", "Command: listGroup", e);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function selectGroup(client, group) {
|
||||||
|
try {
|
||||||
|
response = await client.group(request_headers.query.group)
|
||||||
|
if (response.code == 211) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
} catch (e) {
|
||||||
|
console.log("WTVNews Error -", "Command: grop", e);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getArticle(client, articleID) {
|
||||||
|
try {
|
||||||
|
return await client.article(articleID)
|
||||||
|
} catch (e) {
|
||||||
|
console.log("WTVNews Error -", "Command: article", e);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getHeader(client, articleID) {
|
||||||
|
try {
|
||||||
|
return await client.head(articleID)
|
||||||
|
} catch (e) {
|
||||||
|
console.log("WTVNews Error -", "Command: head -", "Article ID: "+articleID, e);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function quitUsenet(client) {
|
||||||
|
response = await client.quit()
|
||||||
|
if (response.code == 205) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getHeaderObj(client, NGArticles) {
|
||||||
|
var messages = [];
|
||||||
|
for (var article in NGArticles) {
|
||||||
|
if (article == "getCaseInsensitiveKey") continue;
|
||||||
|
try {
|
||||||
|
var data = await getHeader(client, NGArticles[article]);
|
||||||
|
if (data.article) messages.push(data.article)
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e, article);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return messages;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async function WebTVListGroup(client, group) {
|
||||||
|
var connected = await clientConnect(client)
|
||||||
|
if (connected) {
|
||||||
|
response = await selectGroup(client, group);
|
||||||
|
if (response) {
|
||||||
|
response = await listGroup(client, group);
|
||||||
|
if (response.code == 211) {
|
||||||
|
NGCount = response.group.number;
|
||||||
|
NGArticles = response.group.articleNumbers;
|
||||||
|
messages = await getHeaderObj(client, NGArticles);
|
||||||
|
quitUsenet(client);
|
||||||
|
headers = `200 OK
|
||||||
|
Connection: Keep-Alive
|
||||||
|
Content-Type: text/html
|
||||||
|
wtv-expire: wtv-news:/news?group=${request_headers.query.group}`
|
||||||
|
data = `<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<script language=javascript>
|
||||||
|
if (top.frames.length > 1)
|
||||||
|
top.location="news:${request_headers.query.group}";
|
||||||
|
</script>
|
||||||
|
<TITLE>${request_headers.query.group}</TITLE>
|
||||||
|
</HEAD>
|
||||||
|
<sidebar width=114 height=420 align=left>
|
||||||
|
<table cellspacing=0 cellpadding=0 bgcolor=3d2f3a>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 width=104 absheight=4>
|
||||||
|
<td rowspan=100 width=10 height=420 valign=top align=left bgcolor=191919>
|
||||||
|
<img src="wtv-mail:/ROMCache/Shadow.gif" width=6 height=420>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=6>
|
||||||
|
<td abswidth=93 absheight=76>
|
||||||
|
<table href="wtv-home:/home" absheight=76 cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td align=right>
|
||||||
|
<img src="wtv-home:/ROMCache/WebTVLogoJewel.gif" width=87 height=67>
|
||||||
|
</table>
|
||||||
|
<td abswidth=5>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=middle align=center bgcolor=231d22>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=1 valign=top align=left <img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=top align=left bgcolor=5b4b58>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=6 >
|
||||||
|
<td abswidth=93 absheight=26 >
|
||||||
|
<table href="wtv-mail:/sendmail?discuss=true&group=${request_headers.query.group}&discuss-prefix=wtv-news"
|
||||||
|
cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=5>
|
||||||
|
<td abswidth=90 valign=middle align=left>
|
||||||
|
<table bgcolor=3d2f3a cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td absheight=1>
|
||||||
|
<tr>
|
||||||
|
<td maxlines=1>
|
||||||
|
<shadow><font sizerange=medium color="E7CE4A">Post</font></shadow></table>
|
||||||
|
</table>
|
||||||
|
<td abswidth=5>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=middle align=center bgcolor=231d22>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=1 valign=top align=left <img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=top align=left bgcolor=5b4b58>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=6 >
|
||||||
|
<td abswidth=93 absheight=26 >
|
||||||
|
<table href="wtv-guide:/help?topic=Discuss&subtopic=Index&appName=Discuss"
|
||||||
|
cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=5>
|
||||||
|
<td abswidth=90 valign=middle align=left>
|
||||||
|
<table bgcolor=3d2f3a cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td absheight=1>
|
||||||
|
<tr>
|
||||||
|
<td maxlines=1>
|
||||||
|
<shadow><font sizerange=medium color="E7CE4A">Help</font></shadow></table>
|
||||||
|
</table>
|
||||||
|
<td abswidth=5>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=middle align=center bgcolor=231d22>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=1 valign=top align=left <img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=top align=left bgcolor=5b4b58>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 height=237 valign=bottom align=right >
|
||||||
|
<img src="wtv-forum:/images/BannerDiscuss.gif" width=50 height=165> <tr><td colspan=3 absheight=36>
|
||||||
|
</table>
|
||||||
|
</sidebar>
|
||||||
|
<body
|
||||||
|
bgcolor="191919" text="42BD52" link="1bb0f1"
|
||||||
|
vlink="826f7e"
|
||||||
|
hspace=0
|
||||||
|
vspace=0
|
||||||
|
logo="wtv-forum:/images/news_logo.gif">
|
||||||
|
|
||||||
|
<table cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td rowspan=100 width=10 height=384 valign=top align=left>
|
||||||
|
<td height=16 width=416 valign=top align=left>
|
||||||
|
<td rowspan=100 width=20 height=384 valign=top align=left>
|
||||||
|
<tr>
|
||||||
|
<td height=31 valign=top>
|
||||||
|
<font size="+1" color="E7CE4A">
|
||||||
|
<blackface>
|
||||||
|
<shadow>
|
||||||
|
Group: ${request_headers.query.group}
|
||||||
|
</shadow>
|
||||||
|
</blackface>
|
||||||
|
</font>
|
||||||
|
</table>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=10 height=6>
|
||||||
|
<td width=180 valign=bottom align=right>
|
||||||
|
<table cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td width=10 height=1 valign=top align=left>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=10 height=1>
|
||||||
|
<td height=33 width=256 valign=bottom>
|
||||||
|
<font size=4>
|
||||||
|
`
|
||||||
|
if (NGCount == 0) {
|
||||||
|
data += `This group has no postings`;
|
||||||
|
} else {
|
||||||
|
data += NGCount + " posting";
|
||||||
|
if (NGCount != 1)
|
||||||
|
data += "s"
|
||||||
|
}
|
||||||
|
data += `
|
||||||
|
</font>
|
||||||
|
<br>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=0 height=8>
|
||||||
|
<TABLE width=446 cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td rowspan=4 width=10 height=1>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=10 height=1>
|
||||||
|
<td height=2 width=436 bgcolor="2B2B2B">
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=436 height=1>
|
||||||
|
<tr>
|
||||||
|
<td height=1>
|
||||||
|
<tr>
|
||||||
|
<td height=2 bgcolor="0D0D0D">
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td height=6>
|
||||||
|
</TABLE>`
|
||||||
|
if (NGCount > 0) {
|
||||||
|
|
||||||
|
Object.keys(messages).forEach(function (k) {
|
||||||
|
var message = messages[k]
|
||||||
|
var message_date = message.headers.DATE;
|
||||||
|
data += `
|
||||||
|
<table cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=10>
|
||||||
|
<td abswidth=426 height=42 valign=bottom>
|
||||||
|
<table cellspacing=0 cellpadding=0 href="wtv-news:/news?group=${request_headers.query.group}&article=${message.articleNumber}" id="${message.messageId}" nocolor selected>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=426 maxlines=1>
|
||||||
|
<font color=1bb0f1>${(message.headers.SUBJECT) ? message.headers.SUBJECT : "(No Subject)"}
|
||||||
|
<tr>
|
||||||
|
<td maxlines=1>
|
||||||
|
<font size="-1" color=544f53><b>
|
||||||
|
${message.headers.FROM}, ${message.headers.DATE}
|
||||||
|
</b>
|
||||||
|
</table>
|
||||||
|
<td abswidth=10>
|
||||||
|
</table>`;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
data += `
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=6><br>
|
||||||
|
<TABLE width=446 cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td rowspan=4 width=10 height=1>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=10 height=1>
|
||||||
|
<td height=2 width=436 bgcolor="2B2B2B">
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=436 height=1>
|
||||||
|
<tr>
|
||||||
|
<td height=1>
|
||||||
|
<tr>
|
||||||
|
<td height=2 bgcolor="0D0D0D">
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td height=6>
|
||||||
|
</TABLE>
|
||||||
|
<table cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td width=10 height=1 valign=top align=left>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=10 height=1>
|
||||||
|
<td height=33 width=256 valign=bottom>
|
||||||
|
</BODY>
|
||||||
|
</HTML>`;
|
||||||
|
sendToClient(socket, headers, data);
|
||||||
|
} else {
|
||||||
|
var errpage = wtvshared.doErrorPage("400", "No such group.");
|
||||||
|
sendToClient(socket, errpage[0], errpage[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async function WebTVShowMessage(client, group, article) {
|
||||||
|
var connected = await clientConnect(client)
|
||||||
|
if (connected) {
|
||||||
|
response = await selectGroup(client, group);
|
||||||
|
if (response) {
|
||||||
|
response = await getArticle(client, article);
|
||||||
|
console.log(response);
|
||||||
|
if (response.code == 220) {
|
||||||
|
headers = `200 OK
|
||||||
|
Content-type: text/html`;
|
||||||
|
|
||||||
|
var message_colors = ssid_sessions[socket.ssid].mailstore.defaultColors;
|
||||||
|
|
||||||
|
data = `<head>
|
||||||
|
<sendpanel
|
||||||
|
action="wtv-mail:/sendmail?message_forward_id=1&mailbox_name=inbox"
|
||||||
|
message="Forward this post to someone else."
|
||||||
|
label="Forward">
|
||||||
|
<title>
|
||||||
|
${(response.article.headers.SUBJECT) ? wtvshared.htmlEntitize(response.article.headers.SUBJECT) : '(No subject)'}
|
||||||
|
</title>
|
||||||
|
</head>
|
||||||
|
<print blackandwhite>
|
||||||
|
<sidebar width=114 height=420 align=left>
|
||||||
|
<table cellspacing=0 cellpadding=0 bgcolor=3d2f3a>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 width=104 absheight=4>
|
||||||
|
<td rowspan=100 width=10 height=420 valign=top align=left bgcolor=${message_colors.bgcolor}>
|
||||||
|
<img src="wtv-mail:/ROMCache/Shadow.gif" width=6 height=420>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=6>
|
||||||
|
<td abswidth=93 absheight=76>
|
||||||
|
<table href="wtv-home:/home" absheight=76 cellspacing=0 cellpadding=0 width=100%>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=6>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1>
|
||||||
|
<td align=center>
|
||||||
|
<img src="wtv-mail:/ROMCache/WebTVLogoJewel.gif" width=87 height=67>
|
||||||
|
</table>
|
||||||
|
<td abswidth=5>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=middle align=center bgcolor=202434>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=1 valign=top align=left>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=top align=left bgcolor=5b4b58>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=6>
|
||||||
|
<td abswidth=93 absheight=26>
|
||||||
|
<table selected href="wtv-news:/news?group=${group}"
|
||||||
|
cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=5>
|
||||||
|
<td abswidth=90 valign=middle align=left>
|
||||||
|
<table bgcolor=3d2f3a cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td absheight=1>
|
||||||
|
<tr>
|
||||||
|
<td maxlines=1><shadow><font sizerange=medium color="E7CE4A">Group</font></shadow>
|
||||||
|
</table>
|
||||||
|
</table>
|
||||||
|
<td abswidth=5>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=middle align=center bgcolor=202434>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=1 valign=top align=left>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=top align=left bgcolor=5b4b58>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=6 >
|
||||||
|
<td abswidth=93 absheight=26 >
|
||||||
|
<table bgcolor=3d2f3a cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=5>
|
||||||
|
<td abswidth=88 valign=middle align=left >
|
||||||
|
<table cellspacing=0 cellpadding=0><tr><td><shadow><font color=5b4b58 sizerange=medium>Previous</font></shadow></table>
|
||||||
|
</table>
|
||||||
|
<td abswidth=5>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=middle align=center bgcolor=202434>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=1 valign=top align=left >
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=top align=left bgcolor=5b4b58>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=6 >
|
||||||
|
<td abswidth=93 absheight=26 >
|
||||||
|
<table bgcolor=3d2f3a cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=5>
|
||||||
|
<td abswidth=88 valign=middle align=left >
|
||||||
|
<table cellspacing=0 cellpadding=0><tr><td><shadow><font color=5b4b58 sizerange=medium>Next</font></shadow></table>
|
||||||
|
</table>
|
||||||
|
<td abswidth=5>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=middle align=center bgcolor=202434>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=1 valign=top align=left>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=top align=left bgcolor=5b4b58>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=6>
|
||||||
|
<td abswidth=93 absheight=26>
|
||||||
|
<table
|
||||||
|
xnocancel
|
||||||
|
cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=5>
|
||||||
|
<td abswidth=90 valign=middle align=left>
|
||||||
|
<table bgcolor=3d2f3a cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td absheight=1>
|
||||||
|
<tr>
|
||||||
|
<td maxlines=1><shadow><font color=5b4b58 sizerange=medium>Next New</font></shadow>
|
||||||
|
</table>
|
||||||
|
</table>
|
||||||
|
<td abswidth=5>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=middle align=center bgcolor=202434>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=1 valign=top align=left>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=top align=left bgcolor=5b4b58>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=6>
|
||||||
|
<td abswidth=93 absheight=26>
|
||||||
|
<table
|
||||||
|
cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=5>
|
||||||
|
<td abswidth=90 valign=middle align=left>
|
||||||
|
<table bgcolor=3d2f3a cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td absheight=1>
|
||||||
|
<tr>
|
||||||
|
<td maxlines=1><shadow><font sizerange=medium color="5b4b58">Mail to</font></shadow>
|
||||||
|
</table>
|
||||||
|
</table>
|
||||||
|
<td abswidth=5>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=middle align=center bgcolor=202434>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=1 valign=top align=left>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=top align=left bgcolor=5b4b58>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=6>
|
||||||
|
<td abswidth=93 absheight=26>
|
||||||
|
<table href="wtv-mail:/sendmail?discuss=true&message_subject=${("Re: " + response.article.headers.SUBJECT)}&group=${response.article.headers.NEWSGROUPS}"
|
||||||
|
cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=5>
|
||||||
|
<td abswidth=90 valign=middle align=left>
|
||||||
|
<table bgcolor=3d2f3a cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td absheight=1>
|
||||||
|
<tr>
|
||||||
|
<td maxlines=1><shadow><font sizerange=medium color="E7CE4A">Respond</font></shadow>
|
||||||
|
</table>
|
||||||
|
</table>
|
||||||
|
<td abswidth=5>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=middle align=center bgcolor=202434>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=1 valign=top align=left>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=top align=left bgcolor=5b4b58>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=6>
|
||||||
|
<td abswidth=93 absheight=26>
|
||||||
|
<table href="wtv-guide:/helpindex?title=Index_Mail&topic=2&subtopic=1"
|
||||||
|
cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=5>
|
||||||
|
<td abswidth=90 valign=middle align=left>
|
||||||
|
<table bgcolor=3d2f3a cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td absheight=1>
|
||||||
|
<tr>
|
||||||
|
<td maxlines=1><shadow><font sizerange=medium color="E7CE4A">Help</font></shadow>
|
||||||
|
</table>
|
||||||
|
</table>
|
||||||
|
<td abswidth=5>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=middle align=center bgcolor=202434>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=1 valign=top align=left>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=top align=left bgcolor=5b4b58>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 height=81 valign=bottom align=right>
|
||||||
|
<tr><td colspan=3 absheight=36>
|
||||||
|
</table>
|
||||||
|
</sidebar>
|
||||||
|
<body bgcolor=${message_colors.bgcolor}
|
||||||
|
text=${message_colors.text}
|
||||||
|
link=${message_colors.link}
|
||||||
|
vlink=${message_colors.vlink}
|
||||||
|
vspace=0
|
||||||
|
hspace=0>
|
||||||
|
<table cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=10 rowspan=99>
|
||||||
|
<td height=16>
|
||||||
|
<td rowspan=99>
|
||||||
|
<td>
|
||||||
|
<td abswidth=20 rowspan=99>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 height=39 valign=top>
|
||||||
|
<font color="E7CE4A" size=+1><blackface><shadow>
|
||||||
|
Post
|
||||||
|
<tr>
|
||||||
|
<td valign=top>
|
||||||
|
Group:
|
||||||
|
<td>
|
||||||
|
${wtvshared.htmlEntitize(response.article.headers.NEWSGROUPS)}
|
||||||
|
<tr>
|
||||||
|
<td valign=top>
|
||||||
|
Date: <td>
|
||||||
|
${console.log(Date.parse(response.article.headers.DATE))}
|
||||||
|
${strftime("%a, %b %e, %Y, %I:%M%P", new Date(Date.parse(response.article.headers.DATE) / 1000))}
|
||||||
|
<font size=-1> </font>
|
||||||
|
<tr>
|
||||||
|
<td valign=top>
|
||||||
|
From:
|
||||||
|
<td>`;
|
||||||
|
// if (message.from_name != message.from_addr) {
|
||||||
|
// data += `<a href="client:showalert?sound=none&message=Would%20you%20like%20to%20add%20%3Cblackface%3E${wtvshared.htmlEntitize(message.from_name)}%3C%2Fblackface%3E%20to%20your%20address%20list%3F&buttonlabel2=No&buttonaction2=client:donothing&buttonlabel1=Yes&buttonaction1=wtv-mail:/addressbook%3Faction%3Deditfromheader%26noresponse%3Dtrue%26nickname%3D${escape(escape(message.from_name))}%26address%3D${escape(escape(message.from_addr))}%26new_address%3Dtrue">${wtvshared.htmlEntitize(message.from_addr)} </a>`;
|
||||||
|
// } else {
|
||||||
|
data += `${wtvshared.htmlEntitize(response.article.headers.FROM)}`;
|
||||||
|
// }
|
||||||
|
|
||||||
|
data += `<tr>
|
||||||
|
<td nowrap valign=top>
|
||||||
|
<td>
|
||||||
|
</table>
|
||||||
|
<table cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=10 rowspan=99>
|
||||||
|
<td><br><br><br><font color=E7CE4A>
|
||||||
|
${(response.article.headers.SUBJECT) ? wtvshared.htmlEntitize(response.article.headers.SUBJECT) : '(No subject)'}<br><br>
|
||||||
|
</font>
|
||||||
|
<td abswidth=20 rowspan=99>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
`;
|
||||||
|
var message_body = response.article.body.join("\n");
|
||||||
|
data += `
|
||||||
|
${wtvshared.htmlEntitize(message_body, true)}
|
||||||
|
<br>
|
||||||
|
<br>`;
|
||||||
|
data += `<p>
|
||||||
|
`;
|
||||||
|
/*
|
||||||
|
if (message.attachments) {
|
||||||
|
message.attachments.forEach((v, k) => {
|
||||||
|
if (v) {
|
||||||
|
console.log("*****************", v['Content-Type']);
|
||||||
|
switch (v['Content-Type']) {
|
||||||
|
case "image/jpeg":
|
||||||
|
data += `<img border=2 src="wtv-news:/get-attachment?message_id=${messageid}&attachment_id=${k}&group=${(message.to_group)}&wtv-title=Video%20Snapshot" width="380" height="290"><br><br>`;
|
||||||
|
break;
|
||||||
|
case "audio/wav":
|
||||||
|
data += `<table href="wtv-news:/get-attachment?message_id=${messageid}&attachment_id=${k}&group=${(message.to_group)}&wtv-title=Voice%20Mail" width=386 cellspacing=0 cellpadding=0>
|
||||||
|
<td align=left valign=middle><img src="wtv-mail:/ROMCache/FileSound.gif" align=absmiddle><font color="#189CD6"> recording.wav (wav attachment)</font>
|
||||||
|
<td align=right valign=middle>
|
||||||
|
</table><br><br>
|
||||||
|
`;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (message.url) {
|
||||||
|
data += `Included Page: <a href="${(message.url)}">${wtvshared.htmlEntitize(message.url_title).replace(/'/gi, "'")}`;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
data += `
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
`;
|
||||||
|
sendToClient(socket, headers, data);
|
||||||
|
} else {
|
||||||
|
var errpage = wtvshared.doErrorPage("400", "No such article in group <b>"+group+"</b>");
|
||||||
|
sendToClient(socket, errpage[0], errpage[1]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
var errpage = wtvshared.doErrorPage("400", "No such group: <b>"+group+"</b>");
|
||||||
|
sendToClient(socket, errpage[0], errpage[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (!minisrv_config.services[service_name].upstream_address || !minisrv_config.services[service_name].upstream_port) {
|
||||||
|
var errpage = doErrorPage("400");
|
||||||
|
headers = errpage[0];
|
||||||
|
data = errpage[1];
|
||||||
|
} else {
|
||||||
|
var request_is_async = true;
|
||||||
|
if (request_headers.query.group) {
|
||||||
|
const Client = require('newsie').default
|
||||||
|
const client = new Client({
|
||||||
|
host: minisrv_config.services[service_name].upstream_address,
|
||||||
|
port: minisrv_config.services[service_name].upstream_port
|
||||||
|
})
|
||||||
|
if (request_headers.query.article) {
|
||||||
|
WebTVShowMessage(client, request_headers.query.group, request_headers.query.article);
|
||||||
|
} else {
|
||||||
|
WebTVListGroup(client, request_headers.query.group);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -424,7 +424,7 @@ class WTVClientSessionData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
generatePassword(len) {
|
generatePassword(len) {
|
||||||
return CryptoJS.lib.WordArray.random(len).toString(CryptoJS.enc.Hex);
|
return CryptoJS.lib.WordArray.random(Math.round(len / 2)).toString(CryptoJS.enc.Hex);
|
||||||
}
|
}
|
||||||
|
|
||||||
setUserPassword(passwd) {
|
setUserPassword(passwd) {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ const vm = require('vm');
|
|||||||
process
|
process
|
||||||
.on('SIGTERM', shutdown('SIGTERM'))
|
.on('SIGTERM', shutdown('SIGTERM'))
|
||||||
.on('SIGINT', shutdown('SIGINT'))
|
.on('SIGINT', shutdown('SIGINT'))
|
||||||
.on('uncaughtException', shutdown('uncaughtException'));
|
.on('uncaughtException', (e => { console.log(e); }));
|
||||||
|
|
||||||
|
|
||||||
function shutdown(signal) {
|
function shutdown(signal) {
|
||||||
@@ -114,9 +114,10 @@ async function processPath(socket, service_vault_file_path, request_headers = ne
|
|||||||
// Example: an attempt to change "minisrv_config" from a ServiceVault script would be discarded
|
// Example: an attempt to change "minisrv_config" from a ServiceVault script would be discarded
|
||||||
var contextObj = {
|
var contextObj = {
|
||||||
console: console,
|
console: console,
|
||||||
Buffer: Buffer,
|
|
||||||
require: require,
|
require: require,
|
||||||
wtvmime: wtvmime,
|
wtvmime: wtvmime,
|
||||||
|
http: http,
|
||||||
|
https: https,
|
||||||
wtvshared: wtvshared,
|
wtvshared: wtvshared,
|
||||||
clientShowAlert: clientShowAlert,
|
clientShowAlert: clientShowAlert,
|
||||||
strftime: strftime,
|
strftime: strftime,
|
||||||
@@ -135,6 +136,7 @@ async function processPath(socket, service_vault_file_path, request_headers = ne
|
|||||||
headers: headers,
|
headers: headers,
|
||||||
data: data,
|
data: data,
|
||||||
request_is_async: request_is_async,
|
request_is_async: request_is_async,
|
||||||
|
Buffer: Buffer,
|
||||||
String: String,
|
String: String,
|
||||||
Object: Object
|
Object: Object
|
||||||
}
|
}
|
||||||
@@ -296,8 +298,7 @@ async function processPath(socket, service_vault_file_path, request_headers = ne
|
|||||||
var eval_ctx = new vm.Script(script_data, {
|
var eval_ctx = new vm.Script(script_data, {
|
||||||
"filename": service_vault_file_path + ".js"
|
"filename": service_vault_file_path + ".js"
|
||||||
})
|
})
|
||||||
vm.createContext(contextObj);
|
eval_ctx.runInNewContext(contextObj, {
|
||||||
eval_ctx.runInContext(contextObj, {
|
|
||||||
"breakOnSigint": true
|
"breakOnSigint": true
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -341,8 +342,7 @@ async function processPath(socket, service_vault_file_path, request_headers = ne
|
|||||||
var eval_ctx = new vm.Script(script_data, {
|
var eval_ctx = new vm.Script(script_data, {
|
||||||
"filename": catchall_file
|
"filename": catchall_file
|
||||||
})
|
})
|
||||||
vm.createContext(contextObj);
|
eval_ctx.runInNewContext(contextObj, {
|
||||||
eval_ctx.runInContext(contextObj, {
|
|
||||||
"breakOnSigint": true
|
"breakOnSigint": true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,10 @@
|
|||||||
"port": 1603,
|
"port": 1603,
|
||||||
"flags": "0x00000007"
|
"flags": "0x00000007"
|
||||||
},
|
},
|
||||||
|
"wtv-news": {
|
||||||
|
"port": 1605,
|
||||||
|
"disabled": true
|
||||||
|
},
|
||||||
"wtv-register": {
|
"wtv-register": {
|
||||||
"port": 1607
|
"port": 1607
|
||||||
},
|
},
|
||||||
|
|||||||
14
zefie_wtvp_minisrv/package-lock.json
generated
14
zefie_wtvp_minisrv/package-lock.json
generated
@@ -15,6 +15,7 @@
|
|||||||
"html-entities": "^2.3.3",
|
"html-entities": "^2.3.3",
|
||||||
"iconv-lite": "^0.6.3",
|
"iconv-lite": "^0.6.3",
|
||||||
"mime-types": "^2.1.35",
|
"mime-types": "^2.1.35",
|
||||||
|
"newsie": "^1.2.1",
|
||||||
"proxy-agent": "^5.0.0",
|
"proxy-agent": "^5.0.0",
|
||||||
"sanitize-html": "^2.7.2",
|
"sanitize-html": "^2.7.2",
|
||||||
"socks-proxy-agent": "^6.2.1",
|
"socks-proxy-agent": "^6.2.1",
|
||||||
@@ -511,6 +512,14 @@
|
|||||||
"node": ">= 0.4.0"
|
"node": ">= 0.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/newsie": {
|
||||||
|
"version": "1.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/newsie/-/newsie-1.2.1.tgz",
|
||||||
|
"integrity": "sha512-41jhtKmlpSc27oIBkp681fm4aLURPT/AgeBvSRicxNPWDVeHLaq7tSvG/OsEXz7g41thgv9JMV1ZjYSABMiYVA==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8.9.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/optionator": {
|
"node_modules/optionator": {
|
||||||
"version": "0.8.3",
|
"version": "0.8.3",
|
||||||
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz",
|
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz",
|
||||||
@@ -1212,6 +1221,11 @@
|
|||||||
"resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz",
|
||||||
"integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg=="
|
"integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg=="
|
||||||
},
|
},
|
||||||
|
"newsie": {
|
||||||
|
"version": "1.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/newsie/-/newsie-1.2.1.tgz",
|
||||||
|
"integrity": "sha512-41jhtKmlpSc27oIBkp681fm4aLURPT/AgeBvSRicxNPWDVeHLaq7tSvG/OsEXz7g41thgv9JMV1ZjYSABMiYVA=="
|
||||||
|
},
|
||||||
"optionator": {
|
"optionator": {
|
||||||
"version": "0.8.3",
|
"version": "0.8.3",
|
||||||
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz",
|
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz",
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
"html-entities": "^2.3.3",
|
"html-entities": "^2.3.3",
|
||||||
"iconv-lite": "^0.6.3",
|
"iconv-lite": "^0.6.3",
|
||||||
"mime-types": "^2.1.35",
|
"mime-types": "^2.1.35",
|
||||||
|
"newsie": "^1.2.1",
|
||||||
"proxy-agent": "^5.0.0",
|
"proxy-agent": "^5.0.0",
|
||||||
"sanitize-html": "^2.7.2",
|
"sanitize-html": "^2.7.2",
|
||||||
"socks-proxy-agent": "^6.2.1",
|
"socks-proxy-agent": "^6.2.1",
|
||||||
|
|||||||
@@ -52,6 +52,15 @@
|
|||||||
},
|
},
|
||||||
"wtv-author": {
|
"wtv-author": {
|
||||||
"enable_multi_query": true
|
"enable_multi_query": true
|
||||||
|
},
|
||||||
|
"wtv-news": {
|
||||||
|
"disabled": false,
|
||||||
|
"upstream_address": "192.168.11.8",
|
||||||
|
"upstream_port": 1699,
|
||||||
|
"upstream_auth": {
|
||||||
|
"username": "not_yet",
|
||||||
|
"password": "implemented"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -240,6 +240,8 @@
|
|||||||
<Content Include="ServiceVault\wtv-music\get-playlist.js">
|
<Content Include="ServiceVault\wtv-music\get-playlist.js">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Include="ServiceVault\wtv-news\lobby.js" />
|
||||||
|
<Content Include="ServiceVault\wtv-news\news.js" />
|
||||||
<Content Include="ServiceVault\wtv-register\BeMyGuest.js">
|
<Content Include="ServiceVault\wtv-register\BeMyGuest.js">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Content>
|
</Content>
|
||||||
@@ -454,6 +456,7 @@
|
|||||||
<Folder Include="ServiceVault\wtv-music\" />
|
<Folder Include="ServiceVault\wtv-music\" />
|
||||||
<Folder Include="ServiceVault\wtv-music\demo\" />
|
<Folder Include="ServiceVault\wtv-music\demo\" />
|
||||||
<Folder Include="ServiceVault\wtv-music\demo\midi\" />
|
<Folder Include="ServiceVault\wtv-music\demo\midi\" />
|
||||||
|
<Folder Include="ServiceVault\wtv-news\" />
|
||||||
<Folder Include="ServiceVault\wtv-register\" />
|
<Folder Include="ServiceVault\wtv-register\" />
|
||||||
<Folder Include="ServiceVault\wtv-setup\" />
|
<Folder Include="ServiceVault\wtv-setup\" />
|
||||||
<Folder Include="ServiceVault\wtv-star\" />
|
<Folder Include="ServiceVault\wtv-star\" />
|
||||||
|
|||||||
Reference in New Issue
Block a user