diff --git a/README.md b/README.md index 7ebb6d01..68d9c232 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,14 @@ This open source server is in alpha status. Use at your own risk. - Can handle client "relogin" and "reconnect" events - Suports `.js` service files with synchronous or asynchronous requests - Supports multiple simultaneous users -- WebTV-compatible HTTP Proxy (via minisrv, or using an external proxy for enhanced features (such as [WebOne](https://github.com/atauenis/webone)) +- WebTV-compatible HTTP(S) Proxy (via minisrv, or using an external proxy for enhanced features (such as [WebOne](https://github.com/atauenis/webone)) - wtv-flashrom for LC2 and newer boxes (bf0app unsupported, need test unit) - Can flash anything on [Ultra Willies](https://wtv.zefie.com/willie.php) with optional `use_zefie_server` flag set on `wtv-flashrom` service. +- wtv-update:/sync for Download-o-Rama style file downloading ### Current issues: -- wtv-update:/update does not yet function as intended -- HTTPS Proxying untested, likely needs SSL spoofing with self-signed solution +- Occasionally, in certain circumstances, a specific SSID may be unable to reconnect to the server until the server is restarted +- Mis-configuring wtv-update:/sync DiskMaps may cause units to delete contents of partitions (need more info) ### Won't fix: - wtv-encryption stream breaks when two different sessions have the same SSID (eg spoofing, won't fix (production did it too)) @@ -28,6 +29,7 @@ This open source server is in alpha status. Use at your own risk. - ~~Flashrom flashing functionality (at least for LC2 and higher)~~ ***Done*** - Flashrom flashing for bf0app old classic (need donor unit) - SSID/IP black/whitelisting (including tying SSID to an IP or multiple IPs) +- wtv-lzpf support - (maybe) Proper wtv-star (generic service outage page) support (maybe useful for allowing a unit to multiple sub-minisrvs). - (maybe) wtvchat stuff - (probably not) url tokenizer (eg wtv-token-blabla, was mostly to secure service URLs from unintended access, which this server does not aim to do) diff --git a/ServiceVault.md b/ServiceVault.md index 4b6d806f..3002959b 100644 --- a/ServiceVault.md +++ b/ServiceVault.md @@ -1,8 +1,15 @@ ## Brief ServiceVault Explanation -The server will look for a subdirectory under the running directory, called `ServiceVault` (might be user-configurable in the future). +The server will scan configured ServiceVaults in order of priority and look for files within them. -Within that directory, it looks for a subdirectory named after the wtv-service URL requested. +Currently only 2 Service Vaults are supported, the `User Server Vault` and the `Service Vault`. + +The paths to the Service Vaults are user configurable in `user_config.json` or `config.json` + +The `User Service Vault` has priority, and files found in that Service Vault will be loaded, even if the +file exists in the `Service Vault`. + +Within the Service Vaults, the server looks for a subdirectory named after the wtv-service URL requested. The server will then look for files in sequential order when requesting a URL, stopping at the first match. diff --git a/zefie_wtvp_minisrv/ServiceVault/wtv-1800/finish-prereg.js b/zefie_wtvp_minisrv/ServiceVault/wtv-1800/finish-prereg.js index b51ac449..8278d416 100644 --- a/zefie_wtvp_minisrv/ServiceVault/wtv-1800/finish-prereg.js +++ b/zefie_wtvp_minisrv/ServiceVault/wtv-1800/finish-prereg.js @@ -1,10 +1,9 @@ -if (socket.ssid != null && !ssid_sessions[socket.ssid].get("wtvsec_login")) { +if (socket.ssid != null) { + if (ssid_sessions[socket.ssid].get("wtvsec_login")) ssid_sessions[socket.ssid].delete("wtvsec_login"); var wtvsec_login = new WTVSec(); wtvsec_login.IssueChallenge(); wtvsec_login.set_incarnation(request_headers["wtv-incarnation"]); ssid_sessions[socket.ssid].set("wtvsec_login", wtvsec_login); -} else if (socket.ssid != null) { - var wtvsec_login = ssid_sessions[socket.ssid].get("wtvsec_login"); } if (wtvsec_login) { diff --git a/zefie_wtvp_minisrv/ServiceVault/wtv-head-waiter/login-stage-two.js b/zefie_wtvp_minisrv/ServiceVault/wtv-head-waiter/login-stage-two.js index 52f33699..5ad309ac 100644 --- a/zefie_wtvp_minisrv/ServiceVault/wtv-head-waiter/login-stage-two.js +++ b/zefie_wtvp_minisrv/ServiceVault/wtv-head-waiter/login-stage-two.js @@ -24,11 +24,11 @@ if (socket.ssid !== null) { if (challenge_response && client_challenge_response) { //if (challenge_response.toString(CryptoJS.enc.Base64).substring(0,85) == client_challenge_response.substring(0,85)) { if (challenge_response.toString(CryptoJS.enc.Base64) == client_challenge_response) { - console.log(" * wtv-challenge-response success for " + processSSID(socket.ssid)); + console.log(" * wtv-challenge-response success for " + filterSSID(socket.ssid)); wtvsec_login.PrepareTicket(); //socket_sessions[socket.id].secure = true; } else { - console.log(" * wtv-challenge-response FAILED for " + processSSID(socket.ssid)); + console.log(" * wtv-challenge-response FAILED for " + filterSSID(socket.ssid)); if (zdebug) console.log("Response Expected:", challenge_response.toString(CryptoJS.enc.Base64)); if (zdebug) console.log("Response Received:", client_challenge_response) gourl = "wtv-head-waiter:/login?reissue_challenge=true"; @@ -63,7 +63,7 @@ wtv-country: US wtv-language-header: en-US,en wtv-visit: client:closeallpanels wtv-expire-all: client:closeallpanels -wtv-offline-user-list: `+offline_user_list+` +wtv-offline-user-list: `+ offline_user_list + ` wtv-bypass-proxy: true wtv-ticket: `+ wtvsec_login.ticket_b64 + ` wtv-messagewatch-checktimeoffset: off @@ -72,14 +72,15 @@ wtv-connection-timeout: 90 wtv-fader-timeout: 900 wtv-ssl-log-url: wtv-log:/log wtv-smartcard-inserted-message: Contacting service -user-id: `+userid+` +user-id: `+ userid + ` wtv-transition-override: off wtv-allow-dsc: true wtv-messenger-enable: 0 wtv-noback-all: wtv- wtv-service: reset `+ getServiceString('all') + ` -wtv-boot-url: wtv-1800:/preregister?relogin=true` +wtv-boot-url: wtv-1800:/preregister?relogin=true +`; //wtv-ssl-certs-download-url: wtv-head-waiter:/ssl-cert.der //wtv-ssl-certs-checksum: 473926DC1B11F635A6B920953FDCDE6A headers += `wtv-user-name: `+ nickname + ` diff --git a/zefie_wtvp_minisrv/ServiceVault/wtv-home/home.js b/zefie_wtvp_minisrv/ServiceVault/wtv-home/home.js index 6d737a3d..e39da33d 100644 --- a/zefie_wtvp_minisrv/ServiceVault/wtv-home/home.js +++ b/zefie_wtvp_minisrv/ServiceVault/wtv-home/home.js @@ -22,8 +22,8 @@ function go() { }