minimal prealpha support (may remove later)
This commit is contained in:
@@ -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.
|
||||||
|
|||||||
@@ -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}`;
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -72,8 +72,7 @@ if (!request_headers.query.registering ||
|
|||||||
</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">
|
||||||
@@ -98,8 +97,7 @@ if (!request_headers.query.registering ||
|
|||||||
<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>
|
<td height=230 width= 300 bgcolor="#171726" colspan=5 valign=top align=left>
|
||||||
Thank you for signing up for ${minisrv_config.config.service_name}.
|
Thank you for signing up for ${minisrv_config.config.service_name}.
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user