fix: wtv-log:/log

add: wtv-chat
add: wtv-setup
This commit is contained in:
zefie
2021-07-23 09:38:32 -04:00
parent 88784e253c
commit d2a6ea0097
16 changed files with 236 additions and 18 deletions

View File

@@ -0,0 +1,174 @@
headers = `200 OK`;
if (request_headers.query.nick) headers += `
wtv-irc-nick: ${request_headers.query.nick}
wtv-user-nick: ${request_headers.query.nick}`
;
headers += `
Content-Type: text/html`;
if (request_headers.query.host && request_headers.query.port && request_headers.query.channel) {
data = `<html>
<display address="${request_headers.query.host}, port ${request_headers.query.port}, room ${request_headers.query.channel}">
<wtvchat
host="${request_headers.query.host}"
port="${request_headers.query.port}"
channel="#${request_headers.query.channel}"
bgcolor="#101C1E"
>
<head>
<title>
${request_headers.query.channel}
</title>
</head>
<body bgcolor="#101C1E" text="#A2ACB5" link="#CFC382" vlink="#E1EOE3" fontsize="medium" vspace=0 hspace=0>
<sidebar width=109>
<table cellspacing=0 cellpadding=0>
<tr>
<td width=104 height=420 bgcolor=#69758B valign=top>
<table cellspacing=0 cellpadding=0>
<tr>
<td height=7 colspan=3>
<spacer type=vertical size=7>
<tr>
<td width=7>
<spacer type=horizontal size=7>
<td width=87 href="wtv-home:/home">
<img src="${minisrv_config.config.service_logo}" width=87 height=67>
<td width=10>
<spacer type=horizontal size=10>
</table>
<spacer type=vertical size=6>
<table cellspacing=0 cellpadding=0 border=0>
<tr> <td bgcolor=#2E3A54 height=2 width=104 colspan=3>
<tr>
<td width=10 height=26>
<td width=89 valign=middle>
<td width=5>
<tr> <td bgcolor=#2E3A54 height=2 width=104 colspan=3>
<tr>
<td width=10 height=26>
<td width=89 valign=middle>
<td width=5>
<tr> <td bgcolor=#2E3A54 height=2 width=104 colspan=3>
<tr>
<td width=10 height=26>
<td width=89 valign=middle>
<table cellspacing=0 cellpadding=0 href="javascript:void(window.open('newChatChannel.panel'))" >
<tr>
<td height=1>
<tr>
<td><shadow><font sizerange=medium color=#E1EOE3>Create</font></shadow>
</table>
<td width=5>
<tr> <td bgcolor=#2E3A54 height=2 width=104 colspan=3>
<tr>
<td width=10 height=26>
<td width=89 valign=middle>
<table cellspacing=0 cellpadding=0 href="client:ListChannelUsers" >
<tr>
<td height=1>
<tr>
<td><shadow><font sizerange=medium color=#E1EOE3>People</font></shadow>
</table>
<td width=5>
<tr> <td bgcolor=#2E3A54 height=2 width=104 colspan=3>
<tr>
<td width=10 height=26>
<td width=89 valign=middle>
<table cellspacing=0 cellpadding=0 href="client:OpenChatWhisperPanel" >
<tr>
<td height=1>
<tr>
<td><shadow><font sizerange=medium color=#E1EOE3>Whisper</font></shadow>
</table>
<td width=5>
<tr> <td bgcolor=#2E3A54 height=2 width=104 colspan=3>
</table>
<td width=5 bgcolor=#2E3A54>
</table>
</sidebar>
<table cellspacing=0 cellpadding=0 border=0>
<tr>
<td width=451 colspan=2 align=center bgcolor=#2E3A54>
<spacer type=vertical size=13>
<tr>
<td><img src="wtv-chat:/images/top_corner_dark.jpg" width=8 height=8>
<td width=60>
<tr>
<td bgcolor=#101C1E width=13>
<spacer type=horizontal size=13>
<td bgcolor=#101C1E width=438 valign=top>
<table cellspacing=0 cellpadding=0>
<tr>
<td width=105 height=9><spacer type=vertical size=9>
<td>
</table>
<tr>
<td colspan=2>
<table cellspacing=0 cellpadding=0 border=0>
<tr>
<td width=375 height=25 bgcolor=#101C1E gradcolor=#3C4652 gradangle=90>
<table cellspacing=0 cellpadding=0 border=0>
<tr>
<td width=366 valign=middle>&nbsp;&nbsp;
<blackface><font color=#D6D6D6> ${request_headers.query.channel}
</font></blackface><td>
<table cellspacing=0 cellpadding=0 border=0 bgcolor=#3C4652 gradcolor=#2E3A54 gradangle=90>
<tr>
<td><img src="wtv-chat:/images/widget.gif" width=16 height=16>
<td width=3>
<td width=54>
<spacer type=vertical size=1><br>
<a href="wtv-chat:/type"><font size=-1 color=#E7CE4A><b> Go to</b></font></a>
<td width=21>
<img src="wtv-chat:/images/widget.gif" width=16 height=16>
<td width=34>
</table>
</table>
</table>
<spacer type=vertical size=12> <table cellspacing=0 cellpadding=0>
<tr>
<td colspan=3 height=12>
<spacer type=vertical size=12> <tr>
<td abswidth=14>
<td>
<wtvchattranscript height=250 width=100%>
<td abswidth=20>
<tr>
<td height=10>
<tr>
<td>
<td colspan=2 height=2>
<spacer>
<tr>
<td height=1>
<tr>
<td>
<td colspan=2 height=2>
<spacer>
<tr>
<td height=6>
</table>
<table cellspacing=0 cellpadding=0 width=100%>
<tr>
<form action="client:ChatAddMessage" ONSUBMIT="this.chatinput.focus()">
<td abswidth=14>
<td>
<input id="chatinput" name="message" type="text" value="" size=32 bgcolor=262626 text=ffc342 cursor=cc9933 font=proportional selected autoactivate nohighlight>
<td align=right>
<font color=e7ce4a><shadow>
<input type=submit borderimage="file://ROM/Borders/ButtonBorder2.bif" value="Send" usestyle width=80>
<td abswidth=9>
</form>
<tr> <TD HEIGHT=8>
</table>
</body>
</html>`;
} else {
var errpage = doErrorPage("400 Chat requires host, port and channel arguments. Do not use the # on channels.");
headers = errpage[0];
data = errpage[1];
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 B

View File

@@ -96,6 +96,7 @@ wtv-demo-mode: 0
wtv-wink-deferrer-retries: 3 wtv-wink-deferrer-retries: 3
wtv-offline-mail-enable: false wtv-offline-mail-enable: false
wtv-name-server: 8.8.8.8 wtv-name-server: 8.8.8.8
wtv-settings-url: wtv-setup:/get
wtv-visit: wtv-home:/splash? wtv-visit: wtv-home:/splash?
Content-Type: text/html`; Content-Type: text/html`;
} }

View File

@@ -31,6 +31,7 @@ Connection Speed: &rate;
<li><a href="wtv-tricks:/blastcache?return_to=wtv-home:/home">Clear Cache</a></li> <li><a href="wtv-tricks:/blastcache?return_to=wtv-home:/home">Clear Cache</a></li>
<li><a href="wtv-flashrom:/willie">Ultra Willies</a></li> <li><a href="wtv-flashrom:/willie">Ultra Willies</a></li>
<li><a href="wtv-music:/demo/index">MIDI Music Demo</a></li> <li><a href="wtv-music:/demo/index">MIDI Music Demo</a></li>
<li><a href="wtv-chat:/MakeChatPage?host=chat.irchat.tv&port=6667&channel=webtv">IRC Chat Test</a>
<li>Old MSNTV DealerDemo: <a href="wtv-update:/DealerDemo">Download</a> ~ <a href="file://Disk/Demo/index.html">Access (after Download)</a></li> <li>Old MSNTV DealerDemo: <a href="wtv-update:/DealerDemo">Download</a> ~ <a href="file://Disk/Demo/index.html">Access (after Download)</a></li>
<li><a href="http://duckduckgo.com/lite/">DuckDuckGo Lite</a></li> <li><a href="http://duckduckgo.com/lite/">DuckDuckGo Lite</a></li>
<li><input name=url `; <li><input name=url `;

View File

@@ -1,19 +1,18 @@
// write posted log data to disk. should be decrypted by this point (if it was encrypted) if the crypto stream didn't break // write posted log data to disk. should be decrypted by this point (if it was encrypted) if the crypto stream didn't break
request_is_async = true; request_is_async = true;
data = '';
var fullpath = __dirname + "/ServiceLogPost/" + Math.floor(new Date().getTime() / 1000) + "_" + request_headers.query.type;
if (socket.ssid) fullpath += "_" + socket.ssid;
fullpath += ".txt";
fullpath = fullpath.replace(/\\/g, "/");
if (request_headers.post_data) { if (request_headers.post_data) {
headers = `200 OK headers = `200 OK
Connection: Keep-Alive Connection: Keep-Alive
Content-length: 0`; Content-length: 0`;
data = '';
var fullpath = __dirname + "/ServiceLogPost/" + Math.floor(new Date().getTime() / 1000) + "_" + request_headers.query.type;
if (socket.ssid) fullpath += "_" + socket.ssid;
fullpath += ".txt";
fullpath = fullpath.replace(/\\/g, "/");
var logdata_outstring = ''; var logdata_outstring = '';
Object.keys(request_headers.query).forEach(function (k) { Object.keys(request_headers.query).forEach(function (k) {
logdata_outstring += k + "=" + unescape(request_headers.query[k].toString()) + "\r\n"; logdata_outstring += k + "=" + unescape(request_headers.query[k].toString()) + "\r\n";
@@ -35,7 +34,6 @@ Content-length: 0`;
Connection: Keep-Alive Connection: Keep-Alive
Content-length: 0`; Content-length: 0`;
data = '';
var logdata_outstring = ''; var logdata_outstring = '';
Object.keys(request_headers.query).forEach(function (k) { Object.keys(request_headers.query).forEach(function (k) {
logdata_outstring += k + "=" + unescape(request_headers.query[k].toString()) + "\r\n"; logdata_outstring += k + "=" + unescape(request_headers.query[k].toString()) + "\r\n";

View File

@@ -0,0 +1,31 @@
headers = `200 OK
Content-Type: text/html`
var settings_obj = new Array();
settings_obj["from-server"] = 1;
settings_obj["setup-advanced-options"] = 0;
settings_obj["setup-play-bgm"] = 0;
settings_obj["setup-bgm-tempo"] = -1;
settings_obj["setup-bgm-volume"] = 100;
settings_obj["setup-background-color"] = "c6c6c6";
settings_obj["setup-font-sizes"] = "medium";
settings_obj["setup-in-stereo"] = 1;
settings_obj["setup-keyboard"] = "alphabetical";
settings_obj["setup-link-color"] = "2222bb";
settings_obj["setup-play-songs"] = 1;
settings_obj["setup-play-sounds"] = 1;
settings_obj["setup-text-color"] = 0;
settings_obj["setup-visited-color"] = "8822bb";
settings_obj["setup-japan-keyboard"] = "roman";
settings_obj["setup-japan-softkeyboard"] = "norm"
settings_obj["setup-chat-access-level"] = 0;
settings_obj["setup-chat-on-nontrusted-pages"] = 1;
settings_obj["setup-tv-chat-level"] = 2;
data = "";
Object.keys(settings_obj).forEach(function (k, v) {
data += k + "=" + escape(settings_obj[k]) + "&";
});
data = data.substring(0, (data.length - 1));

View File

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@@ -170,12 +170,12 @@ if (request_headers.query.diskmap && request_headers.query.group && request_head
var errpage = doErrorPage(404,"The requested DiskMap does not exist."); var errpage = doErrorPage(404,"The requested DiskMap does not exist.");
headers = errpage[0]; headers = errpage[0];
data = errpage[1]; data = errpage[1];
console.log("wtv-update:/sync error", "could not find diskmap"); if (zdebug) console.log(" # wtv-update:/sync error", "could not find diskmap");
} }
} else { } else {
var errpage = doErrorPage(400); var errpage = doErrorPage(400);
headers = errpage[0]; headers = errpage[0];
data = errpage[1]; data = errpage[1];
if (zdebug) console.log("wtv-update:/sync error", "missing query arguments"); if (zdebug) console.log(" # wtv-update:/sync error", "missing query arguments");
} }

View File

@@ -344,8 +344,6 @@ async function doHTTPProxy(socket, request_headers) {
if (res.headers.date) headers.Date = res.headers.date; if (res.headers.date) headers.Date = res.headers.date;
if (res.headers["content-type"]) headers["Content-type"] = res.headers["content-type"]; if (res.headers["content-type"]) headers["Content-type"] = res.headers["content-type"];
if (res.headers.cookie) headers.Cookie = res.headers.cookie; if (res.headers.cookie) headers.Cookie = res.headers.cookie;
// content-length is best auto-calculated
//if (res.headers["content-length"]) headers["Content-Length"] = res.headers["content-length"];
if (res.headers.vary) headers.Vary = res.headers.vary; if (res.headers.vary) headers.Vary = res.headers.vary;
if (res.headers.location) headers.Location = res.headers.location; if (res.headers.location) headers.Location = res.headers.location;
if (data_hex.substring(0, 8) == "0d0a0d0a") data_hex = data_hex.substring(8); if (data_hex.substring(0, 8) == "0d0a0d0a") data_hex = data_hex.substring(8);
@@ -1023,8 +1021,8 @@ Object.keys(minisrv_config.services).forEach(function (k) {
if (minisrv_config.config.hide_ssid_in_logs) console.log(" * Masking SSIDs in console logs for security"); if (minisrv_config.config.hide_ssid_in_logs) console.log(" * Masking SSIDs in console logs for security");
else console.log(" * Full SSIDs will be shown in console logs"); else console.log(" * Full SSIDs will be shown in console logs");
if (minisrv_config.config.service_logo.indexOf(':') == -1) minisrv_config.config.service_logo = "wtv-star:/images/" + minisrv_config.config.service_logo; if (minisrv_config.config.service_logo.indexOf(':') == -1) minisrv_config.config.service_logo = "wtv-star:/ROMCache/" + minisrv_config.config.service_logo;
if (minisrv_config.config.service_splash_logo.indexOf(':') == -1) minisrv_config.config.service_splash_logo = "wtv-star:/images/" + minisrv_config.config.service_splash_logo; if (minisrv_config.config.service_splash_logo.indexOf(':') == -1) minisrv_config.config.service_splash_logo = "wtv-star:/ROMCache/" + minisrv_config.config.service_splash_logo;
minisrv_config.version = require('./package.json').version; minisrv_config.version = require('./package.json').version;

View File

@@ -55,6 +55,16 @@
"flags": "0x04", "flags": "0x04",
"connections": 3 "connections": 3
}, },
"wtv-setup": {
"port": 1613,
"flags": "0x00000010",
"connections": 3
},
"wtv-chat": {
"port": 1630,
"connections": 3,
"flags": "0x00000010"
},
"http": { "http": {
"port": 1650, "port": 1650,
"connections": 3, "connections": 3,

View File

@@ -32,6 +32,7 @@
<Content Include=".gitignore" /> <Content Include=".gitignore" />
<Content Include="app.js" /> <Content Include="app.js" />
<Content Include="config.json" /> <Content Include="config.json" />
<Content Include="ServiceVault\wtv-chat\MakeChatPage.js" />
<Content Include="ServiceVault\wtv-flashrom\get-by-path.js"> <Content Include="ServiceVault\wtv-flashrom\get-by-path.js">
<SubType>Code</SubType> <SubType>Code</SubType>
</Content> </Content>
@@ -174,9 +175,11 @@
<Content Include="ServiceVault\wtv-music\demo\midi\Wind1.mid" /> <Content Include="ServiceVault\wtv-music\demo\midi\Wind1.mid" />
<Content Include="ServiceVault\wtv-music\demo\midi\Xess.mid" /> <Content Include="ServiceVault\wtv-music\demo\midi\Xess.mid" />
<Content Include="ServiceVault\wtv-music\demo\music.jpg" /> <Content Include="ServiceVault\wtv-music\demo\music.jpg" />
<Content Include="ServiceVault\wtv-star\images\HackTVLogo.gif" /> <Content Include="ServiceVault\wtv-setup\get.js">
<Content Include="ServiceVault\wtv-star\images\HackTVLogoJewel.gif" /> <SubType>Code</SubType>
<Content Include="ServiceVault\wtv-star\images\WebTVLogoJewel.gif" /> </Content>
<Content Include="ServiceVault\wtv-star\ROMCache\HackTVLogoJewel.gif" />
<Content Include="ServiceVault\wtv-star\ROMCache\WebTVLogoJewel.gif" />
<Content Include="ServiceVault\wtv-tricks\access.js" /> <Content Include="ServiceVault\wtv-tricks\access.js" />
<Content Include="ServiceVault\wtv-tricks\blastcache.js" /> <Content Include="ServiceVault\wtv-tricks\blastcache.js" />
<Content Include="ServiceVault\wtv-tricks\go-offline.js" /> <Content Include="ServiceVault\wtv-tricks\go-offline.js" />
@@ -211,13 +214,15 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="ServiceVault\" /> <Folder Include="ServiceVault\" />
<Folder Include="ServiceVault\wtv-chat\" />
<Folder Include="ServiceVault\wtv-flashrom\" /> <Folder Include="ServiceVault\wtv-flashrom\" />
<Folder Include="ServiceVault\wtv-flashrom\ROMCache\" /> <Folder Include="ServiceVault\wtv-flashrom\ROMCache\" />
<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-setup\" />
<Folder Include="ServiceVault\wtv-star\" /> <Folder Include="ServiceVault\wtv-star\" />
<Folder Include="ServiceVault\wtv-star\images\" /> <Folder Include="ServiceVault\wtv-star\ROMCache\" />
<Folder Include="ServiceVault\wtv-tricks\" /> <Folder Include="ServiceVault\wtv-tricks\" />
<Folder Include="ServiceVault\wtv-update\" /> <Folder Include="ServiceVault\wtv-update\" />
<Folder Include="ServiceVault\wtv-1800\" /> <Folder Include="ServiceVault\wtv-1800\" />