diff --git a/zefie_wtvp_minisrv/ServiceVault/wtv-home/home.js b/zefie_wtvp_minisrv/ServiceVault/wtv-home/home.js index 93b41609..e298f413 100644 --- a/zefie_wtvp_minisrv/ServiceVault/wtv-home/home.js +++ b/zefie_wtvp_minisrv/ServiceVault/wtv-home/home.js @@ -1,392 +1,302 @@ var minisrv_service_file = true; - -if (request_headers.query.url) { - headers = `300 OK -Location: ${request_headers.query.url}`; -} else { - headers = `200 OK +headers =`200 OK Connection: Keep-Alive wtv-expire-all: wtv-home:/splash -wtv-expire-all: wtv-flashrom: Content-type: text/html` - var cryptstatus = (wtv_encrypted ? "Encrypted" : "Not Encrypted") - var comp_type = wtvmime.shouldWeCompress(session_data, 'text/html'); - var compstatus = "uncompressed"; - switch (comp_type) { - case 1: - compstatus = "wtv-lzpf"; - break; - case 2: - compstatus = "gzip (level 9)"; - break; - } +var cryptstatus = (wtv_encrypted ? "Encrypted" : "Not Encrypted") +var comp_type = wtvmime.shouldWeCompress(socket.ssid,'text/html'); +var compstatus = "uncompressed"; +switch (comp_type) { + case 1: + compstatus = "wtv-lzpf"; + break; + case 2: + compstatus = "gzip (level 9)"; + break; +} - var unread_mailcount = session_data.mailstore.countUnreadMessages(0) - var mailbox_gif_num = 0; // no messages - if (unread_mailcount > 0) { - if (unread_mailcount == 1) mailbox_gif_num = 1; - else mailbox_gif_num = 2; - } +var wtv_system_sysconfig = session_data.get("wtv-system-sysconfig"); +var wtv_client_bootrom_version = session_data.get("wtv-client-bootrom-version"); +var wtv_system_chipversion_str = session_data.get("wtv-system-chipversion"); +var notImplementedAlert = new clientShowAlert({ + 'image': minisrv_config.config.service_logo, + 'message': "This feature is not available.", + 'buttonlabel1': "Okay", + 'buttonaction1': "client:donothing", + 'noback': true, +}).getURL(); - data = ` - +var notAdminAlert = new clientShowAlert({ + 'image': minisrv_config.config.service_logo, + 'message': "Sorry, you are not configured as an admin on this server.

If you are the server operator, please
see user_config.example.json
for an example on how to configure yourself as an administrator.", + 'buttonlabel1': "Ugh, fine.", + 'buttonaction1': "client:donothing", + 'noback': true, +}).getURL(); - Home for ${session_data.getSessionData("subscriber_username") || "minisrv"} - - +var ownMinisrv = new clientShowAlert({ + 'image': minisrv_config.config.service_logo, + 'message': "To run your own minisrv, please visit the following link on your PC:

https://zef.pw/minisrv", + 'buttonlabel1': "Okay", + 'buttonaction1': "client:donothing", + 'noback': true, +}).getURL(); - +var supportZefieAlert = new clientShowAlert({ + 'image': minisrv_config.config.service_logo, + 'message': "If you would like to support zefie or minisrv, please visit the following link on your PC:

https://zef.pw/helpminisrv", + 'buttonlabel1': "Okay", + 'buttonaction1': "client:donothing", + 'noback': true, +}).getURL(); - - - - - - - - - -
-
+data =`\0 + + + +Home for ${session_data.getSessionData("subscriber_username") || "minisrv"} + + + + + + + + +
+ + + + + + + + + - - - - + - - +
+
+
+
+ WebTV URL, FILE, and CLIENT Access: + + + + +
+
+ +
+
- -
- - - - -
- -
-
- -
- +
+ - -
- - - -
-
- - - -
- - -
- Login -
-
-
-
+
+
+ + +
+Mail + +Favorites + +Music + +Search + +ROMs + +Settings + +Help +
- -
- - - - -
- -
-
- -
- - - -
- - - -
-
- - - - - -
- - -
- Setup -
-
-
-
- - -
- - - - -
- -
-
- -
- - - - -
- - - -
-
- - - - -
- - -
- Discuss -
-
- -
-
- - - - - -
- - - - -
- -
-
- -
- + + +
+ + + +
+ + + + + + + + + +
+» Community « +
+
+€ Chat +
+
+€ Discuss + +
+
+€ Messenger + +
+
+
+ + + + + + + + + + + + + - - - - -
+» Account « +
+
+€ Relogin + +
+
+€ Configure + +
+
+€ Password + +
+
+€ Add User + +
+
`; - data += ` - -
- - - -
-
- - - - -
- - -
- Help (WIP) -
-
- -
-
- - -
- - - - - -
- -
-
- -
- - - -
- -
- - -
- -
- - - - - - - - - - - - - -
- -
- - - -
- - - - - - - -
-
- -
-
- - -
- Mail -
-
- - -
- - - - - - -
-
- -
-
- - -
- Favorites -
-
- - -
- - - - - - -
-
- -
-
- - -
- Flashroms -
-
- - -
- - - - - - -
-
- -
-
- - -
- Search -
-
-
-
- -
- - - - - - - -
-Welcome to ${minisrv_config.config.service_name}`; - if (session_data.getSessionData("registered")) data += ", " + session_data.getSessionData("subscriber_username") + "!"; - data += ` +if (session_data.getSessionData("registered")) data += `€ Unregister`; +else data += `€ Register` +data += ` +
-
-Status: ${cryptstatus} (${compstatus}) -
-
-
-

  Main Menu

-
    -
  • wtv-admin new!
  • -`; - if (session_data.hasCap("client-can-do-chat")) { - data += "
  • IRC Chat Test
  • \n" - } - if (session_data.hasCap("client-has-disk")) { - // only show disk stuff if client has disk - data += "
  • DiskHax ~ VFatHax
  • \n"; - if (session_data.hasCap("client-can-do-macromedia-flash2")) { - // only show demo if client can do flash2 - data += "
  • Old DealerDemo: Download ~ Access
  • \n"; - } - } - data += `
`; - // for development - if (fs.existsSync(service_vaults[0] + "/" + service_name + "/home.zefie.html")) { - data += fs.readFileSync(service_vaults[0] + "/" + service_name + "/home.zefie.html", { 'encoding': 'utf8' }); - } - data += `
-
-
-
-Connection Speed: &rate; -
-
-minisrv v${minisrv_config.version}${(minisrv_config.config.git_commit) ? ' git-' + minisrv_config.config.git_commit : ''}, hosted by ${minisrv_config.config.service_owner}  
-
+
- -` -} \ No newline at end of file +
+ + + + + +
+ + + + +
+ € Welcome to zefie's minisrv ${minisrv_version_string.split(" ")[3]} +
+
+This server is operated by ${minisrv_config.config.service_owner}. +
+ +
+ + + + + +
+ € minisrv Latest Updates +
+
+•  Added a WebTV Character Map
+•  Redesigned homepage based on MattMan69's HackTV
+•  Added a new minisrv logo
+
+
+ +
+ + + + + +
+ + + + + + + + + + + + +
+ +» Tools « +
+
+€ WTV Tricks + +
+
+€ WTV Admin + +
+
+€ Clear Cache + +
+
+
+ + + + + + + + + + + +
+ +» More Stuff « +
+ +
+€ Switch
   server
+
+
+
+€ Run your
   own server
+
+
+
+€ Midnight
   Archives
+
+
+
+€ Help zefie + +
+
+
+
+` +data += "\n"; \ No newline at end of file diff --git a/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeColumn1Header.gif b/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeColumn1Header.gif new file mode 100644 index 00000000..b051c153 Binary files /dev/null and b/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeColumn1Header.gif differ diff --git a/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeColumn2Header.gif b/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeColumn2Header.gif new file mode 100644 index 00000000..a172a988 Binary files /dev/null and b/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeColumn2Header.gif differ diff --git a/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeColumn3Header.gif b/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeColumn3Header.gif new file mode 100644 index 00000000..838ee8c5 Binary files /dev/null and b/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeColumn3Header.gif differ diff --git a/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeColumn3Top.gif b/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeColumn3Top.gif new file mode 100644 index 00000000..7602e538 Binary files /dev/null and b/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeColumn3Top.gif differ diff --git a/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeMainSearchButton.gif b/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeMainSearchButton.gif new file mode 100644 index 00000000..26fb14aa Binary files /dev/null and b/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeMainSearchButton.gif differ diff --git a/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeShoppingSearchButton.gif b/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeShoppingSearchButton.gif new file mode 100644 index 00000000..2cf085e7 Binary files /dev/null and b/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeShoppingSearchButton.gif differ diff --git a/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeTaskBar.gif b/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeTaskBar.gif new file mode 100644 index 00000000..d7d27ba1 Binary files /dev/null and b/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeTaskBar.gif differ diff --git a/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeTaskBar1.gif b/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeTaskBar1.gif new file mode 100644 index 00000000..ab5280e3 Binary files /dev/null and b/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeTaskBar1.gif differ diff --git a/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeTaskBarDividers.gif b/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeTaskBarDividers.gif new file mode 100644 index 00000000..63dc1b57 Binary files /dev/null and b/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeTaskBarDividers.gif differ diff --git a/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeTopEdge.gif b/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeTopEdge.gif new file mode 100644 index 00000000..d144ea13 Binary files /dev/null and b/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeTopEdge.gif differ diff --git a/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeTopLeftEdge.gif b/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeTopLeftEdge.gif new file mode 100644 index 00000000..57031832 Binary files /dev/null and b/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeTopLeftEdge.gif differ diff --git a/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeTopLeftEdgeBLANK.gif b/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeTopLeftEdgeBLANK.gif new file mode 100644 index 00000000..29610d07 Binary files /dev/null and b/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/HomeTopLeftEdgeBLANK.gif differ diff --git a/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/circlearrow.gif b/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/circlearrow.gif new file mode 100644 index 00000000..8df8ba7c Binary files /dev/null and b/zefie_wtvp_minisrv/ServiceVault/wtv-home/images/proto3/circlearrow.gif differ diff --git a/zefie_wtvp_minisrv/ServiceVault/wtv-tricks/cSetup.js b/zefie_wtvp_minisrv/ServiceVault/wtv-tricks/cSetup.js new file mode 100644 index 00000000..8556132f --- /dev/null +++ b/zefie_wtvp_minisrv/ServiceVault/wtv-tricks/cSetup.js @@ -0,0 +1,168 @@ +var minisrv_service_file = true; + +headers = `200 OK +Content-Type: text/html` + +data = ` + +Connect Setup v2.2-minisrv + + + + + + + + + +

+ +
+

+  Connection Setup v2.2-minisrv +

+

+
+
+ + + + +
+ + + +
+  Presets: + + +
+
+
+ + + + + + + +
+
+  Service: +
+
+
+ + + +  Custom:    + + Address: + +    Port: + +
+ + +
+ + + + +
+
+  Description:

+
+ + + + + + +
+   +   + +
+ +   + +   + + + +
+ + + +`; \ No newline at end of file diff --git a/zefie_wtvp_minisrv/ServiceVault/wtv-tricks/cSetup/Pattern_Games.gif b/zefie_wtvp_minisrv/ServiceVault/wtv-tricks/cSetup/Pattern_Games.gif new file mode 100644 index 00000000..07bffdd6 Binary files /dev/null and b/zefie_wtvp_minisrv/ServiceVault/wtv-tricks/cSetup/Pattern_Games.gif differ diff --git a/zefie_wtvp_minisrv/ServiceVault/wtv-tricks/cSetup/cSetupShadowLogo.gif b/zefie_wtvp_minisrv/ServiceVault/wtv-tricks/cSetup/cSetupShadowLogo.gif new file mode 100644 index 00000000..b70846da Binary files /dev/null and b/zefie_wtvp_minisrv/ServiceVault/wtv-tricks/cSetup/cSetupShadowLogo.gif differ diff --git a/zefie_wtvp_minisrv/app.js b/zefie_wtvp_minisrv/app.js index 1824719c..bd4bb964 100644 --- a/zefie_wtvp_minisrv/app.js +++ b/zefie_wtvp_minisrv/app.js @@ -307,12 +307,7 @@ var runScriptInVM = function (script_data, user_contextObj = {}, privileged = fa } // unload any loaded modules for this vm - if (modules_loaded.length > 0) { - Object.keys(modules_loaded).forEach(function (k) { - wtvshared.unloadModule(modules_loaded[k]); - }) - } - + modules_loaded = null; return contextObj; // updated context object with whatever global varibles the script set } @@ -1964,6 +1959,7 @@ 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"); else console.log(" * Full SSIDs will be shown in console logs"); diff --git a/zefie_wtvp_minisrv/includes/WTVAdmin.js b/zefie_wtvp_minisrv/includes/WTVAdmin.js index 76201d60..9d49d49a 100644 --- a/zefie_wtvp_minisrv/includes/WTVAdmin.js +++ b/zefie_wtvp_minisrv/includes/WTVAdmin.js @@ -72,7 +72,7 @@ class WTVAdmin { } } - isAuthorized() { + isAuthorized(justchecking = false) { var allowed_ssid = false; var allowed_ip = false; if (this.minisrv_config.services[this.service_name].authorized_ssids) { @@ -95,7 +95,11 @@ class WTVAdmin { } }); } - return (allowed_ssid && allowed_ip) ? true : this.rejectConnection(!allowed_ssid); + if (justchecking) { + return (allowed_ssid && allowed_ip) ? true : false; + } else { + return (allowed_ssid && allowed_ip) ? true : this.rejectConnection(!allowed_ssid); + } } getAccountInfo(username, directory = null) { diff --git a/zefie_wtvp_minisrv/includes/WTVShared.js b/zefie_wtvp_minisrv/includes/WTVShared.js index 26ce29bc..a4edae3a 100644 --- a/zefie_wtvp_minisrv/includes/WTVShared.js +++ b/zefie_wtvp_minisrv/includes/WTVShared.js @@ -72,6 +72,14 @@ class WTVShared { return src; } + isAdmin(wtvclient, service_name = "wtv-admin") { + var WTVAdmin = require("./WTVAdmin.js"); + var wtva = new WTVAdmin(this.minisrv_config, wtvclient, service_name); + var result = wtva.isAuthorized(true); + wtva, WTVAdmin = null; + return result; + } + parseJSON(json) { if (!json) return null; if (typeof json !== 'string') json = json.toString(); @@ -912,12 +920,6 @@ class WTVShared { }); return outdata; } - - isAdmin(wtvclient, service_name = "wtv-admin") { - var WTVAdmin = require("./WTVAdmin.js"); - var wtva = new WTVAdmin(this.minisrv_config, wtvclient, service_name); - return (wtva.isAuthorized() === true) ? true : false; - } } class clientShowAlert { diff --git a/zefie_wtvp_minisrv/package.json b/zefie_wtvp_minisrv/package.json index 42236517..efefe9cc 100644 --- a/zefie_wtvp_minisrv/package.json +++ b/zefie_wtvp_minisrv/package.json @@ -1,6 +1,6 @@ { "name": "zefie_wtvp_minisrv", - "version": "0.9.35", + "version": "0.9.36", "description": "WebTV Service (WTVP) Emulation Server", "main": "app.js", "homepage": "https://github.com/zefie/zefie_wtvp_minisrv", diff --git a/zefie_wtvp_minisrv/zefie_wtvp_minisrv.njsproj b/zefie_wtvp_minisrv/zefie_wtvp_minisrv.njsproj index c0c1c3d5..8c01eb7b 100644 --- a/zefie_wtvp_minisrv/zefie_wtvp_minisrv.njsproj +++ b/zefie_wtvp_minisrv/zefie_wtvp_minisrv.njsproj @@ -1028,6 +1028,10 @@ + + Code + + Code