v0.9.54 combined merge from dev

* initial (very incomplete) work on PC Services Admin (eg csops)
  * primitive account listing
  * add ban/unban/delete functionality
* fix wtv-tricks theme
* fix wtv-tricks theme (cSetup)
* better tricks code
* fix session_data.getTicketData()
* speedtest and other tricks stuff
* better protection against direct access to finished url
* dependancies update (run `npm update`)
* Bump path-to-regexp and express in /zefie_wtvp_minisrv (#29)

Bumps [path-to-regexp](https://github.com/pillarjs/path-to-regexp) to 0.1.12 and updates ancestor dependency [express](https://github.com/expressjs/express). These dependencies need to be updated together.

Updates `path-to-regexp` from 0.1.10 to 0.1.12
- [Release notes](https://github.com/pillarjs/path-to-regexp/releases)
- [Changelog](https://github.com/pillarjs/path-to-regexp/blob/master/History.md)
- [Commits](https://github.com/pillarjs/path-to-regexp/compare/v0.1.10...v0.1.12)

Updates `express` from 4.21.1 to 4.21.2
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.21.2/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.21.1...4.21.2)

---
updated-dependencies:
- dependency-name: path-to-regexp
  dependency-type: indirect
- dependency-name: express
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix up path functions

* force version 1.2.1 of newsie due to breaking change

* remove debug log print for usenet

* fix account directory was broken due to previous changes

* fix wtv-home:/home was hiding options bar

* bump to 0.9.54

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
zefie
2024-12-18 19:30:33 -05:00
committed by GitHub
parent 8315347e95
commit 9314705def
25 changed files with 713 additions and 324 deletions

View File

@@ -0,0 +1,79 @@
var minisrv_service_file = true;
headers = `200 OK
Connection: Keep-Alive
wtv-expire-all: wtv-tricks:/benchmark
Content-type: text/html`
data = `<html>
<display nosave nosend skipback>
<script src=/ROMCache/h.js></script><script src=/ROMCache/n.js></script><script>
head('Speed Test Result')</script>`;
var start_time = parseInt(session_data.getTicketData("benchmark_starttime"));
if (isNaN(start_time)) {
data += "Invalid data, please try your benchmark again";
} else {
var end_time = Math.floor(new Date().getTime());
if (!session_data.getTicketData("benchmark_endtime")) {
session_data.setTicketData("benchmark_endtime", end_time);
} else {
end_time = session_data.getTicketData("benchmark_endtime");
}
var download_time = end_time - start_time;
var image_filename = wtvshared.getServiceDep("/wtv-tricks/benchmark.jpg", true);
var image_size = fs.statSync(image_filename).size
var image_size_kb = parseFloat(image_size / 1024).toFixed(3);
var throughput = parseFloat((image_size / download_time) * 1024).toFixed(0);
data += `
<table>
<tr>
<td height=20>
<tr>
<td valign=top align=right width=200><shadow>POP Number:</shadow>
<td width=10>
<td valign=top>&phone;
<tr>
<td valign=top align=right><shadow>Connected at:</shadow>
<td width=10>
<td valign=top>&rate;
<tr>
<td valign=top align=right><shadow>Modem f/w:</shadow>
<td width=10>
<td valign=top>&modem;
<tr>
<td height=40>
<tr>
<td valign=top align=right width=200><shadow>Image Size:</shadow>
<td width=10>
<td valign=top>${image_size_kb} KBytes
<tr>
<td valign=top align=right><shadow>Start Time:</shadow>
<td width=10>
<td valign=top>${new Date(start_time).toISOString().replace('T', ' ').substr(0, 19)}
<tr>
<td valign=top align=right><shadow>End Time:</shadow>
<td width=10>
<td valign=top>${new Date(end_time).toISOString().replace('T', ' ').substr(0, 19)}
<tr>
<td valign=top align=right><shadow>Total Time:</shadow>
<td width=10>
<td valign=top>${parseFloat(download_time / 1000).toFixed(1)} seconds
<tr>
<td valign=top align=right><shadow>Throughput:</shadow>
<td width=10>
<td valign=top>${throughput} bytes/sec
</table>
`;
}
data += `
<p>
<p>
<a selected href="wtv-tricks:/benchmark">Re-Test</a>
<td width=30>
<a href="wtv-tricks:/tricks">Back to Tricks</a>
</CENTER>
</BODY>
</HTML>
`;

View File

@@ -0,0 +1,35 @@
var minisrv_service_file = true;
headers = `200 OK
Connection: Keep-Alive
`;
if (!request_headers.query.getimage) {
if (session_data.getTicketData("benchmark_starttime")) {
session_data.deleteTicketData("benchmark_endtime")
}
headers += `wtv-expire-all: wtv-tricks:/benchmark
Content-type: text/html`
data = `<HTML>
<HEAD>
<TITLE>Speedtest in progress...</TITLE>
<display nosend noback>
</HEAD>
<BODY BGCOLOR=191919 TEXT=44cc55 LINK=189cd6 VLINK=189cd6>
<CENTER>
<h1>Benchmark Image</h1>
<br>
<IMG SRC="wtv-tricks:/benchmark?getimage=true" ALIGN=CENTER onload="location.href='wtv-tricks:/benchmark-finished'">
</CENTER>
</BODY>
</HTML>`;
} else {
var start_time = Math.floor(new Date().getTime());
session_data.setTicketData("benchmark_starttime", start_time);
headers += "wtv-expire-all: wtv-tricks:/benchmark\nContent-type: image/jpg"
data = wtvshared.getServiceDep("/wtv-tricks/benchmark.jpg", false);
}

View File

@@ -37,174 +37,42 @@ function load() {
headers = `200 OK
Content-Type: text/html`
data = `<html>
<head>
<title>Connect Setup v2.2-minisrv</title>
<DISPLAY noscroll notvaudio switchtowebmode>
</head>
<body bgcolor="#3C2F47" text="#cbcbcb" link="#aaaaaa"
hspace="0" vspace="0" fontsize="large" noscroll>
<table cellspacing="0" cellpadding="0" cellborder="0">
<tr>
<td width="104" height="80" valign="top" align="left"><spacer type="block" WIDTH="11" HEIGHT="11"><br>
<spacer type="block" WIDTH="10" HEIGHT="1"> <a href="wtv-home:/home"><img src="${minisrv_config.config.service_logo}" width="87"
height="67"></a>
</td>
<td width="456" height="80" valign="middle" align="center">
<br><h2>
&nbsp;Connection Setup v2.2-minisrv
</h2>
</td>
</tr>
<tr><td colspan=4><hr>
<tr><td absheight=6>
data = `<html><head><display nooptions noscroll allowoffline notvaudio switchtowebmode nosend>
<script src=/ROMCache/h.js></script><script src=/ROMCache/n.js></script>
<script src=htv-cSetup.js></script>
</head><form name=t><input type=hidden name=h value=&pname;></form>
<script>head('Connect Setup v2.6');
window.onload=uS;
</script><form name=c action=client:ConfirmConnectSetup>
<table width=100% cellspacing=1 cellpadding=0>
<tr><td height=18>
<tr><td colspan=3>&nbsp;Server:</td>
<td><select width=420 name=p onchange=uS() selected>
<option value=htv>MattMan's (HTV) MiniSrv</option>
<option value=htvb>MattMan's (HTV) MiniSrv Backup</option>
<option value=mm69>MattMan's Revival Srv.</option>
<option value=zef>zefie's MiniSrv</option>
<option value=jar>WebTV Redialed</option>
<option value=zlan>zefie LAN (.8)</option>
<option value=zlan2>zefie LAN (.95)</option>
<option value=other>Other</option>
</select></table>
<table width=100% cellspacing=1 cellpadding=0>
<tr><td height=18>
<tr><td><input name=serviceType type=hidden value=custom>
&nbsp;Address:&nbsp;&nbsp;&nbsp;<input size=21 asciionly name=machine value="" bgcolor=191919 text=c6c6c6 cursor=cc9933>
&nbsp;&nbsp;&nbsp;Port:<input size=5 asciionly numbers name=port value="" bgcolor=191919 text=c6c6c6 cursor=cc9933>
</table>
<script>
function doConnect() {
if (document.connect.machine.value == "${minisrv_config.services['wtv-1800'].host}" && document.connect.port.value == "${minisrv_config.services['wtv-1800'].port}") {
alert("You are already here!");
} else {
document.connect.submit();
}
}
function setOther() {
count = document.connect.preset.length;
document.connect.preset.selectedIndex = count - 1;
setTimeout(updateService,10);
}
function updateService() {
srv = document.connect.preset[document.connect.preset.selectedIndex].value;
switch (srv) {
case "mattman69":
document.connect.machine.value="71.244.121.234"
document.connect.port.value="1615"
document.message.msg.value="This is MattMan69's Public HackTV minisrv, all are welcome to connect and enjoy the wonders of WebTV. Offers a custom experience."
break;
case "mm69bak":
document.connect.machine.value="71.244.121.234"
document.connect.port.value="1415"
document.message.msg.value="This is the public HackTV minisrv backup, only available when the main HackTV server is down."
break;
case "mm69pri":
document.connect.machine.value="71.244.121.234"
document.connect.port.value="1515"
document.message.msg.value="This is MattMan's normally private WebTV server. It's the real deal, not minisrv! May be up from time to time."
break;
case "redialed":
document.connect.machine.value="217.160.150.209"
document.connect.port.value="1615"
document.message.msg.value="WebTV Redialed, a server designed to replicate the original WebTV service."
break
case "zefie":
document.connect.machine.value="38.175.202.142"
document.connect.port.value="1615"
document.message.msg.value="This is zefie's public minisrv, for those who want the vanilla minisrv experience."
break
case "local":
document.connect.machine.value="127.0.0.1"
document.connect.port.value="1615"
document.message.msg.value="Connect to your server via localhost. Localhost refers to the computer that you are on that is running your server."
break;
case "other":
document.message.msg.value="Your custom service."
}
}
</script>
<form name="connect" action="wtv-tricks:/cSetup">
<table width=100% cellspacing=1 cellpadding=0>
<tr>
<td colspan=3>
&nbsp;<font color=#4489a8>Presets:</font>
</td>
<td><spacer W=24 type=block>
<select width="440" name="preset" onchange="updateService()" selected>
<option value="mattman69" selected>MattMan's (HTV) MiniSrv - Public</option>
<option value="mm69bak">MattMan's (HTV) MiniSrv - Bakup</option>
<option value="mm69pri">MattMan's Revival Server</option>
<option value="redialed">WebTV Redialed</option>
<option value="zefie">Zefie's MiniSrv - Public</option>
<option value="local">Localhost - Your Server</option>
<option value="other">Other</option>
</select>
<tr><td absheight=6>
</table>
<hr>
<table width=100% cellspacing=1 cellpadding=0>
<tr>
<td height=6>
<tr>
<td colspan=3>
&nbsp;<font color=#4489a8>Service:</font>
<tr>
<td width=15></td>
<td height=2>
<tr>
<td height=2>
<tr>
<td>
<td>
<input name=serviceType type=radio bgcolor=#444444 value=custom checked>
<td>
&nbsp;Custom:&nbsp;&nbsp;&nbsp;
<td>
Address:
<input size=16 ASCIIONLY name=machine bgcolor=#444444 text=#cbcbcb cursor=#cc9933 value="71.244.121.234" onkeypress="setOther()">
&nbsp;&nbsp;&nbsp;Port:
<input size=5 ASCIIONLY NUMBERS name=port bgcolor=#444444 text=#cbcbcb cursor=#cc9933 value="1615" onkeypress="setOther()">
</table>
<spacer type=block height="8">
<hr>
<table cellspacing=1 cellpadding=0>
<tr>
<td height=8>
<tr>
<td colspan=3>
&nbsp;<font color=#4489a8>Description:</font><br><br>
<tr>
<td width=20>
<td width=390 align=left valign=top>
<form name=message>
<textarea rows=4 size=46 text=#cbcbcb id=msg name=msg border="0" bgcolor=#3C2F47 value='This is the public HackTV minisrv, all are welcome to connect and enjoy the wonders of WebTV. Custom experience!' nohighlight noselect>
</textarea>
</form>
<td>
<td width=100% align=right valign=top>
<form action="client:GoToPhoneSetup">
<font color="#E7CE4A" size=-2><shadow>&nbsp;
<input
type=submit
borderimage="file://ROM/tvimages/TVButtonBorder.bif"
value="Phone Settings"
name="Phone Settings"
usestyle
width=170> &nbsp;
</shadow></font>
</form>
<spacer type=block height="60">
<font color="#E7CE4A" size=-2><shadow>&nbsp;
<input type=hidden name=useEncryption value=true checked>
<input
type=button
borderimage="file://ROM/tvimages/TVButtonBorder.bif"
value="Connect"
name="Connect"
onclick="doConnect()"
usestyle
width=170> &nbsp;
</shadow></font>
</table>
</form>
</body>
</html>`;
<spacer type=block height=42><hr><br>
<table cellspacing=1 cellpadding=0>
<tr><td height=1>
<tr><td colspan=2>&nbsp;Info:<br><br><td>
<tr><td width=20><td width=300 align=left valign=top>
<form name=i><font size=-1><script>ta(6,46,'msg',0,'','nohighlight noselect',1)</script></font></form>
<td><td width=100% align=right valign=top>
<font size=-2><input type=hidden name=useEncryption value=true><script>butt('Connect','Connect',170);</script></font>
</form>
<form action=client:gotophonesetup><font size=-2><script>butt( 'Dialing Options', '', 170);</script></font></form>
</table>
`;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 B

View File

@@ -6,7 +6,7 @@ var legend_every = 6;
function getLegend() {
d = "<tr>\n";
for (var i = 0; i < num_per_line; i++) {
d += "<td><b><font color=44cc55>Code</font></b>\n<td><b><font color=44cc55>Char</font></b>\n";
d += "<td><b>Code</b>\n<td><b>Char</b>\n";
}
d += "<tr>\n";
return d;
@@ -16,18 +16,12 @@ function getLegend() {
headers = `200 OK
Content-Type: text/html`;
data = `<html>
<body>
<display nosave nosend>
<title>WebTV Character Map</title>
<sidebar width=20%>
<img src="wtv-tricks:/images/Favorites_bg2.jpg">
</sidebar>
<body bgcolor="#191919" text="#33bb44" link="36d5ff" vlink="36d5ff" vspace=0>
<br>
<br>
<font color=44cc55><h1>WebTV Character Map</h1></font>
<br>
data = `<html><head><display allowoffline switchtowebmode>
<script src=/ROMCache/h.js></script><script src=/ROMCache/n.js></script>
<script src=htv-cSetup.js></script>
</head ><form name=t><input type=hidden name=h value=&pname;></form>
<script>head('WebTV Character Map');</script>
<br><br>
<table border=1>`;

View File

@@ -0,0 +1,27 @@
function uI(ip,prt,dsc,ro){
if(!ro){ro=false}
d.c.machine.value=ip
d.c.port.value=prt
d.i.msg.value=dsc
d.c.machine.readonly=ro
d.c.port.readonly=ro
}
function uS(){switch(d.c.p[d.c.p.selectedIndex].value){
case "htv":uI("71.244.121.234","1615","This is the public HackTV minisrv, all are welcome to connect and enjoy the wonders of WebTV. Custom experience, including updates to HackTV builds!",true)
break
case "htvb":uI("71.244.121.234","1415","This is the public HackTV minisrv backup, only available when the main HackTV server is down.",true)
break
case "zef": uI("38.175.202.142","1615","zefie's public minisrv, for those who want an experience close to the vanilla minisrv.",true)
break
case "mm69":uI("71.244.121.234","1515","MattMan's megasrv. It's the real deal, not minisrv! May be up from time to time.",true)
break
case "jar":uI("217.160.150.209","1615","WebTV Redialed aims to replicate the look and feel of the original production WebTV service.",true)
break
case "zlan":uI("192.168.11.8","1615","zefie's Desktop via LAN.",false)
break
case "zlan2":uI("192.168.11.95","1615","zefie's public minisrv via LAN.",false)
break
case "other":uI("","1615","Your custom service.",false)
break
}}

View File

@@ -31,7 +31,7 @@ Content-Type: text/html`
data = `<html>
<!--- *=* Copyright 1996, 1997 WebTV Networks, Inc. All rights reserved. --->
<display nosave nosend skipback>
<script src=file://rom/Cache/h.js></script><script src=file://rom/Cache/n.js></script><script>
<script src=/ROMCache/h.js></script><script src=/ROMCache/n.js></script><script>
head('${minisrv_config.config.service_name} Info')</script>
<table cellspacing=0 cellpadding=0><tr><td abswidth=10>&nbsp;<td colspan=3>

View File

@@ -12,69 +12,51 @@ var notAdminAlert = new clientShowAlert({
headers = `200 OK
Content-Type: text/html`
tricks = [
["wtv-tricks:/info", minisrv_config.config.service_name + " info"],
["wtv-tricks:/themes", "Theme Switcher"],
["wtv-cookie:list", "List Cookies"],
["wtv-cookie:reset", "Clear Cookies"],
["wtv-tricks:/bastblacklist?return_to=wtv-tricks%3A%2Ftricks", "Blast Blacklist"],
["client:ResetNVAndPowerOff", "Blast NVRAM"],
["wtv-tricks:/charmap", "Character Map"],
["wtv-tricks:/cSetup", "Connect Setup"],
["wtv-tricks:/benchmark", "Speed Test"],
["", ""],
["", ""],
["", ""],
["", ""],
["", ""],
["", ""],
["", ""],
]
// add these at the bottom
tricks.push((session_data.getSessionData("registered")) ? ["wtv-tricks:/unregister", "Unregister This Box"] : ["wtv-tricks:/register", "Register This Box"]); // reg/unreg
tricks.push((wtvshared.isAdmin(session_data)) ? ["wtv-admin:/admin", minisrv_config.config.service_name + " Admin"] : [notAdminAlert, minisrv_config.config.service_name + " Admin"]); // wtv-admin
data = `<html>
<display nosave nosend>
<script src=file://rom/Cache/h.js></script><script src=file://rom/Cache/n.js></script><script>
<script src=/ROMCache/h.js></script><script src=/ROMCache/n.js></script><script>
head('${minisrv_config.config.service_name} Tricks')</script>
<table cellspacing=0 cellpadding=0><tr><td abswidth=10>&nbsp;<td colspan=3>
<br>
<table>
<tr>
<td colspan=3 height=6>
<tr>
<td><a href="wtv-tricks:/info">Info</a>
<td width = 25>
<td><a href="wtv-cookie:list">List Cookies</a>
<tr>
<td colspan=3 height=6>
<tr>
<td><a href="wtv-flashrom:/willie">Visit Ultra Willie's!</a>
<td width = 25>
<td><a href="wtv-cookie:reset">Clear Cookies</a>
<tr>
<td colspan=3 height=6>
<tr>
<td><a href="wtv-tricks:/blastbacklist?return_to=wtv-tricks%3A%2Ftricks">Blast Backlist</a>
<td width = 25>
<td><a href="client:ResetNVAndPowerOff">Blast NVRAM</a>
<tr>
<td colspan=3 height=6>
<tr>
<td><a href="client:showservices">Show Services</a>
<td width = 25>
`;
if (session_data.getSessionData("registered")) data += `<td><a href="wtv-tricks:/unregister">Unregister This Box</a>`;
else data += `<td><a href="wtv-tricks:/register">Register This Box</a>`
<table>`;
data += `
<tr>
for (i = 0; i < tricks.length; i += 2) {
data += `<tr>
<td colspan=3 height=6>
<tr>
<td><a href="${(wtvshared.isAdmin(session_data)) ? "wtv-admin:/admin" : notAdminAlert}">${minisrv_config.config.service_name} Admin</a>
<td width = 25>
<td><!-- TODO -->
<tr>
<td colspan=3 height=6>
<tr>
<td><!-- TODO -->
<td width = 25>
<td><!-- TODO -->
<tr>
<td colspan=3 height=6>
<tr>
<td><!-- TODO -->
<td width = 25>
<td><!-- TODO -->
<tr>
<td colspan=3 height=6>
<tr>
<td><!-- TODO -->
<td width = 25>
<td>
<!-- TODO -->
<td width = 25>
</table>
<td>${(tricks[i][0] != "") ? `<a href="${tricks[i][0]}">${tricks[i][1]}</a>` : `<!-- TODO --> &nbsp;`}
<td width=25>
<td>`
if (i + 1 < tricks.length) {
data += (tricks[i + 1][0] != "") ? `<a href="${tricks[i + 1][0]}">${tricks[i + 1][1]}</a>` : `<!-- TODO --> &nbsp;`
} else {
// require even number of tricks
data += "<!-- TODO --> &nbsp;"
}
}
data += `</table>
</body>
</html>
`;