minimal prealpha support (may remove later)

This commit is contained in:
zefie
2025-08-14 20:22:18 -04:00
parent e7d16387da
commit 35a9ae2c8f
5 changed files with 89 additions and 81 deletions

View File

@@ -587,6 +587,10 @@ async function processPath(socket, service_vault_file_path, request_headers = []
updateFromVM.push(["socket_sessions", "socket_sessions"]); // global socket_sessions object for privileged service scripts, such as wtv-1800, etc updateFromVM.push(["socket_sessions", "socket_sessions"]); // global socket_sessions object for privileged service scripts, such as wtv-1800, etc
} }
if (request_headers['User-Agent'] === "Artemis/0.0") {
socket_sessions[socket.id].prealpha = true;
}
try { try {
vaults_to_scan.forEach(function (service_vault_dir) { vaults_to_scan.forEach(function (service_vault_dir) {
if (service_vault_found) return; if (service_vault_found) return;
@@ -1631,7 +1635,7 @@ async function sendToClient(socket, headers_obj, data = null) {
if (!socket.res) { if (!socket.res) {
// encrypt if needed // encrypt if needed
if (socket_sessions[socket.id].secure === true && !socket_sessions[socket.id].do_not_encrypt) { if (socket_sessions[socket.id].secure === true && !socket_sessions[socket.id].do_not_encrypt && !socket_sessions[socket.id].prealpha) {
headers_obj["wtv-encrypted"] = 'true'; headers_obj["wtv-encrypted"] = 'true';
headers_obj = wtvshared.moveObjectKey('wtv-encrypted', 'Connection', headers_obj); headers_obj = wtvshared.moveObjectKey('wtv-encrypted', 'Connection', headers_obj);
if (content_length > 0 && socket_sessions[socket.id].wtvsec) { if (content_length > 0 && socket_sessions[socket.id].wtvsec) {
@@ -1646,6 +1650,9 @@ async function sendToClient(socket, headers_obj, data = null) {
} }
} }
if (socket_sessions[socket.id].prealpha === true && !socket_sessions[socket.id].secure) {
if (headers_obj["wtv-encrypted"]) delete headers_obj["wtv-encrypted"];
}
// calculate content length // calculate content length
// make sure we are using our Content-length and not one set in a script. // make sure we are using our Content-length and not one set in a script.

View File

@@ -69,15 +69,19 @@ wtv-visit: client:hangupphone`
} else { } else {
console.log(" * wtv-challenge-response FAILED for " + wtvshared.filterSSID(socket.ssid)); console.log(" * wtv-challenge-response FAILED for " + wtvshared.filterSSID(socket.ssid));
if (minisrv_config.config.debug_flags.debug) console.log("Response Expected:", challenge_response.toString(CryptoJS.enc.Base64)); if (minisrv_config.config.debug_flags.debug) console.log("Response Expected:", challenge_response.toString(CryptoJS.enc.Base64));
if (minisrv_config.config.debug_flags.debug) console.log("Response Received:", client_challenge_response) if (minisrv_config.config.debug_flags.debug) console.log("Response Received:", client_challenge_response);
errpage = wtvshared.doErrorPage(500, "Invalid challenge response received"); errpage = wtvshared.doErrorPage(500, "Invalid challenge response received");
headers = errpage[0]; headers = errpage[0];
data = errpage[1]; data = errpage[1];
} }
} else { } else {
if (!socket_sessions[socket.id].prealpha) {
errpage = wtvshared.doErrorPage(500, "No challenge response received"); errpage = wtvshared.doErrorPage(500, "No challenge response received");
headers = errpage[0]; headers = errpage[0];
data = errpage[1]; data = errpage[1];
} else {
gourl = "wtv-head-waiter:/login-stage-two?";
}
} }
} else { } else {
gourl = "wtv-head-waiter:/login-stage-two?"; gourl = "wtv-head-waiter:/login-stage-two?";
@@ -110,10 +114,9 @@ minisrv-no-mail-count: true`;
limitedLoginRegistered = (limitedLogin && session_data.isRegistered()); limitedLoginRegistered = (limitedLogin && session_data.isRegistered());
} }
headers = `200 OK headers = `200 OK
wtv-connection-close: true
Connection: close
minisrv-no-mail-count: true minisrv-no-mail-count: true
Content-Type: text/html`; Content-Type: text/html`;
if (client_challenge_response) { if (client_challenge_response) {
headers += ` headers += `
wtv-encrypted: ${(request_headers['wtv-encrypted']) ? wtvshared.parseBool(request_headers['wtv-encrypted']) : true}`; wtv-encrypted: ${(request_headers['wtv-encrypted']) ? wtvshared.parseBool(request_headers['wtv-encrypted']) : true}`;

View File

@@ -40,11 +40,11 @@ AutoCaps selected value="${request_headers.query.subscriber_contact || ""}">
<font size="-2"><b>CONTACT INFO TYPE:</b></font><img src="ROMCache/spacer.gif" width="7"> <font size="-2"><b>CONTACT INFO TYPE:</b></font><img src="ROMCache/spacer.gif" width="7">
<img src="ROMCache/spacer.gif" width="3"><select usestyle id="subscriber_contact_method" name="subscriber_contact_method"> <img src="ROMCache/spacer.gif" width="3"><select usestyle id="subscriber_contact_method" name="subscriber_contact_method">
<option value="">Type</option> <option value="">Type</option>
<option${(request_headers.query.subscriber_contact_method === "E-Mail") ? " selected" : ""}>E-Mail</option> <option value="E-Mail"${(request_headers.query.subscriber_contact_method === "E-Mail") ? " selected" : ""}>E-Mail</option>
<option${(request_headers.query.subscriber_contact_method === "Discord") ? " selected" : ""}>Discord</option> <option value="Discord"${(request_headers.query.subscriber_contact_method === "Discord") ? " selected" : ""}>Discord</option>
<option${(request_headers.query.subscriber_contact_method === "Twitter") ? " selected" : ""}>Twitter</option> <option value="Twitter"${(request_headers.query.subscriber_contact_method === "Twitter") ? " selected" : ""}>Twitter</option>
<option${(request_headers.query.subscriber_contact_method === "Telegram") ? " selected" : ""}>Telegram</option> <option value="Telegram"${(request_headers.query.subscriber_contact_method === "Telegram") ? " selected" : ""}>Telegram</option>
<option${(request_headers.query.subscriber_contact_method === "Instagram") ? " selected" : ""}>Instagram</option> <option value="Instagram"${(request_headers.query.subscriber_contact_method === "Instagram") ? " selected" : ""}>Instagram</option>
</select> </select>
`; `;
const form_data = `<shadow> const form_data = `<shadow>

View File

@@ -59,76 +59,74 @@ if (!request_headers.query.registering ||
} else { } else {
headers = `200 OK headers = `200 OK
Content-Type: text/html`; Content-Type: text/html`;
data = `<html> data = `<html>
<head> <head>
<title> <title>
Finished signing up Finished signing up
</title> </title>
<display nooptions noscroll ClearBack <display nooptions noscroll ClearBack
NoScroll NoScroll
> >
</head> </head>
<body noscroll <body noscroll
bgcolor="#171726" text="#D1D3D3" link=#FFEA9C vlink=#FFEA9C bgcolor="#171726" text="#D1D3D3" link=#FFEA9C vlink=#FFEA9C
hspace=0 vspace=0 fontsize="large" hspace=0 vspace=0 fontsize="large">
> <table cellspacing=0 cellpadding=0 border=0 width=560 bgcolor=#171726>
<table cellspacing=0 cellpadding=0 border=0 width=560 bgcolor=#171726> <tr>
<tr> <td align=middle bgcolor="#5b6c81" border=0 colspan= 3 width="100" height="80">
<td align=middle bgcolor="#5b6c81" border=0 colspan= 3 width="100" height="80"> <img src="${minisrv_config.config.service_logo}" WIDTH="87" HEIGHT="67">
<img src="${minisrv_config.config.service_logo}" WIDTH="87" HEIGHT="67"> <td colspan= 6 bgcolor="#5b6c81" border=0 width=100% absheight="80" valign=bottom >
<td colspan= 6 bgcolor="#5b6c81" border=0 width=100% absheight="80" valign=bottom > <img src="images/head_registration.gif" >
<img src="images/head_registration.gif" > <tr>
<tr> <td bgcolor= "#5b6c81" border=0 rowspan=2 width=21 height= 220></td>
<td bgcolor= "#5b6c81" border=0 rowspan=2 width=21 height= 220></td> <td bgcolor="#171726" border=0 width=9 height=25 align=left valign=top>
<td bgcolor="#171726" border=0 width=9 height=25 align=left valign=top> <img src="images/L_corner.gif" width=8 height=8>
<img src="images/L_corner.gif" width=8 height=8> <td bgcolor="#171726" border=1 colspan=1 width=70 height=25>
<td bgcolor="#171726" border=1 colspan=1 width=70 height=25> <td colspan=6 bgcolor="#171726" border=1 height=25 align=left valign=bottom gradcolor=#262E3D gradangle=90>
<td colspan=6 bgcolor="#171726" border=1 height=25 align=left valign=bottom gradcolor=#262E3D gradangle=90> <font color=#d1d3d3 size=+1>
<font color=#d1d3d3 size=+1> <blackface>
<blackface> You've finished signing up
You've finished signing up </blackface></font>
</blackface></font> <tr> <td border=0 width=40 bgcolor="#171726" rowspan="2" >
<tr> <td border=0 width=40 bgcolor="#171726" rowspan="2" > <td absheight=20 width=100 bgcolor="#171726" colspan=6>
<td absheight=20 width=100 bgcolor="#171726" colspan=6> </tr>
</tr> </table>
</table> <table cellspacing=0 cellpadding=0 border=0 width=560 bgcolor=#171726>
<table cellspacing=0 cellpadding=0 border=0 width=560 bgcolor=#171726> <tr>
<tr> <td bgcolor= "#5b6c81" border=0 rowspan=6 abswidth=21 height= 220></td>
<td bgcolor= "#5b6c81" border=0 rowspan=6 abswidth=21 height= 220></td> <td border=0 abswidth=40 bgcolor="#171726" rowspan="6" >
<td border=0 abswidth=40 bgcolor="#171726" rowspan="6" > <form action="FinishRegistration">
<form action="FinishRegistration" <td height=230 width= 300 bgcolor="#171726" colspan=5 valign=top align=left>
> Thank you for signing up for ${minisrv_config.config.service_name}.
<td height=230 width= 300 bgcolor="#171726" colspan=5 valign=top align=left> <p>
Thank you for signing up for ${minisrv_config.config.service_name}. You will now go
<p> to your <b>Web Home</b> page. You can always
You will now go connect to the Internet by choosing
to your <b>Web Home</b> page. You can always <b>Web Home</b> on your TV Home page.
connect to the Internet by choosing </font>
<b>Web Home</b> on your TV Home page. <td abswidth=20 bgcolor=#171726 >
</font> </tr>
<td abswidth=20 bgcolor=#171726 > <tr>
</tr> <td valign= bottom height=15 colspan=7 bgcolor=#171726>
<tr> <shadow>
<td valign= bottom height=15 colspan=7 bgcolor=#171726> <hr size=5 valign=bottom></shadow>
<shadow> </tr>
<hr size=5 valign=bottom></shadow> <tr>
</tr> <td border=2 colspan=4 width=300 height=50 bgcolor=#171726 valign=top align=left>
<tr> <font size=-1><i>
<td border=2 colspan=4 width=300 height=50 bgcolor=#171726 valign=top align=left> </i></font>
<font size=-1><i> <td bgcolor=#171726 height=50 width=150 valign=top align=right>
</i></font> <font size=-1 color=#e7ce4a>
<td bgcolor=#171726 height=50 width=150 valign=top align=right> <shadow>
<font size=-1 color=#e7ce4a> <input type=submit Value=Continue name="Continue" borderimage="file://ROM/Borders/ButtonBorder2.bif" usestyle width=110>
<shadow> </shadow>
<input type=submit Value=Continue name="Continue" borderimage="file://ROM/Borders/ButtonBorder2.bif" usestyle width=110> </font>
</shadow> </form> <td abswidth=13 absheight=50 bgcolor=#171726>
</font> </tr> </table>
</form> <td abswidth=13 absheight=50 bgcolor=#171726> </body>
</tr> </table> </html>
</body>
</html>
`; `;
} }
} }

View File

@@ -135,7 +135,7 @@ class WTVClientCapabilities {
} }
get(key = null) { get(key = null) {
if (typeof (this.capabilities) === 'undefined') return null; if (typeof (this.capabilities) === 'undefined' || !this.capabilities) return null;
else if (key === null) return this.capabilities; else if (key === null) return this.capabilities;
else if (this.capabilities[key]) return this.capabilities[key]; else if (this.capabilities[key]) return this.capabilities[key];
else return null; else return null;