- Small update for CGI Security
- Various AI suggested fixes
- Fix to logging verbosity
- Fixes for Last-Modified headers
- Removed 2 unused node module deps
- Added pc-only user_config.json example
- Initial work updating catchall system to support CGI
- Reverted registration and home theme system due to problems
This commit is contained in:
zefie
2025-01-03 12:50:29 -05:00
parent 907cec23c2
commit 65521fcad6
45 changed files with 421 additions and 716 deletions

View File

@@ -22,7 +22,7 @@ class WTVRegister {
}
checkUsernameSanity(username) {
var regex_str = "^([A-Za-z0-9\-\_]{" + this.minisrv_config.config.user_accounts.min_username_length + "," + this.minisrv_config.config.user_accounts.max_username_length + "})$";
var regex_str = "^([A-Za-z0-9-\_]{" + this.minisrv_config.config.user_accounts.min_username_length + "," + this.minisrv_config.config.user_accounts.max_username_length + "})$";
var regex = new RegExp(regex_str);
return regex.test(username);
}
@@ -73,29 +73,40 @@ class WTVRegister {
* @param {string} title HTML Page Title
* @param {string} main_content Main center content
* @param {string} form_buttons Form and buttons
* @param {boolean} is_old_build True or false
* @returns {string} HTML Page
*/
getHTMLTemplate(title, main_content, form_buttons, hasJS) {
getHTMLTemplate(title, main_content, form_buttons, is_old_build) {
var data;
data = `<html><head>`;
if (hasJS) {
data += `<script src=/ROMCache/h.js></script><script src=/ROMCache/n.js></script></head><script>head('${title}','','','',1)</script>`
} else {
data += `<body background=/ROMCache/Themes/Images/Pattern.gif text=42bd52 bgcolor=191919 vlink=dddddd link=dddddd hspace=0 vspace=0 fontsize=medium>
<table cellspacing=0 cellpadding=0>
<tr><td>
<td width=100% height=80 valign=top align=left>
<spacer type=block width=11 height=11><br>
<spacer type=block width=10 height=1>
<img src=/ROMCache/WebTVLogoJewel.gif width=90 height=69>
<td width=100% height=80 valign=top>
<td abswidth=460 height=54 valign=top align=right>
<spacer height=32 type=block><b><shadow><blackface><font color=cbcbcb>${title} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </font></blackface></shadow></b>
</td></tr></table>`;
}
data += `<display nooptions>
<table width=480 align=center cellspacing=0 cellpadding=0>
if (is_old_build) {
data = `<html>
<head>
<title>
${title}
</title>
<display nooptions>
</head>
<body bgcolor=#191919 text=#42CC55 fontsize=large hspace=0 vspace=0>
<table cellspacing=0 cellpadding=0>
<tr>
<td width=104 height=74 valign=middle align=center bgcolor=#3B3A4D>
<img src="${this.minisrv_config.config.service_logo}" width=86 height=64>
<td width=20 valign=top align=left bgcolor=#3B3A4D>
<spacer>
<td colspan=2 width=100% align=left bgcolor=#3B3A4D>
<font color=D6DFD0 size=+2>
<blackface>
<shadow>
<spacer type=block width=1 height=4>
<br>
${title}
</shadow>
</blackface>
</font>
</tr>
</td>
</table>
<table width=520 align=center cellspacing=0 cellpadding=0>
<tr>
<td height=242>
<font size=+1>
@@ -121,9 +132,67 @@ class WTVRegister {
</body>
</html>
`;
} else {
data = `<html>
<head>
<title>
${title}
</title>
<display nooptions noscroll NoScroll>
</head>
<body noscroll
bgcolor="#171726" text="#D1D3D3" link=#FFEA9C vlink=#FFEA9C
hspace=0 vspace=0 fontsize="large"
>
<table cellspacing=0 cellpadding=0 border=0 width=560 bgcolor=#171726>
<tr>
<td align=middle bgcolor="#5b6c81" border=0 colspan= 3 width="100" height="80">
<img src="${this.minisrv_config.config.service_logo}" WIDTH="87" HEIGHT="67">
<td colspan= 6 bgcolor="#5b6c81" border=0 width=100% absheight="80" valign=bottom >
<img src="images/head_registration.gif" >
<tr>
<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>
<img src="images/L_corner.gif" width=8 height=8>
<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>
<font color=#d1d3d3 size=+1>
<blackface>
${title}
</blackface></font>
<tr> <td border=0 width=40 bgcolor="#171726" rowspan="2" >
<td absheight=20 width=100 bgcolor="#171726" colspan=6>
</tr>
</table>
<table cellspacing=0 cellpadding=0 border=0 width=560 bgcolor=#171726>
<tr>
<td bgcolor= "#5b6c81" border=0 rowspan=6 abswidth=21 height= 220></td>
<td border=0 abswidth=40 bgcolor="#171726" rowspan="6" >
<td height=230 width= 300 bgcolor="#171726" colspan=5 valign=top align=left>
${main_content}
<td abswidth=20 bgcolor=#171726 >
</tr>
<tr>
<td valign= bottom height=15 colspan=7 bgcolor=#171726>
<shadow>
<hr size=5 valign=bottom></shadow>
</tr>
<tr>
<td border=2 colspan=4 width=100 height=50 bgcolor=#171726 valign=top align=left>
<font size=-1><i>
</i></font>
<td bgcolor=#171726 height=50 width=560 valign=top align=right>
<font size=-1 color=#e7ce4a>
${form_buttons}
<td abswidth=13 absheight=50 bgcolor=#171726>
</tr>
</table>
</body>
</html>`;
}
return data;
}
}
module.exports = WTVRegister;
module.exports = WTVRegister;

View File

@@ -520,8 +520,8 @@ class WTVShared {
if (minisrv_config.config.verbosity >= 0 && minisrv_config.config.verbosity <= 3) {
debugFlags.quiet = minisrv_config.config.verbosity < 2;
debugFlags.show_headers = minisrv_config.config.verbosity % 2 === 1;
debugFlags.debug = minisrv_config.config.verbosity === 2 || minisrv_config.config.verbosity === 3;
debugFlags.show_headers = minisrv_config.config.verbosity === 2
debugFlags.debug = minisrv_config.config.verbosity === 3;
log(` * Console Verbosity level ${minisrv_config.config.verbosity}`);
} else {
Object.assign(debugFlags, { debug: true, quiet: false, show_headers: true });