From 03d7d370ee8b58c0ed49c051f1e02072557a1df4 Mon Sep 17 00:00:00 2001 From: Richard Klafter Date: Tue, 23 May 2017 11:28:25 -0700 Subject: [PATCH 01/15] cache bust --- vnc_auto.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vnc_auto.html b/vnc_auto.html index 08b12569..28882bcb 100644 --- a/vnc_auto.html +++ b/vnc_auto.html @@ -36,7 +36,7 @@ - + From b067030242cfb66641146f3d0875974642aa4f8e Mon Sep 17 00:00:00 2001 From: Eric Swanson Date: Tue, 30 May 2017 16:21:31 -0700 Subject: [PATCH 03/15] Nit for DL link --- vnc_auto.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vnc_auto.html b/vnc_auto.html index b480ff21..c85a3338 100644 --- a/vnc_auto.html +++ b/vnc_auto.html @@ -292,7 +292,7 @@ var coyoteName = WebUtil.getConfigVar('name', ''); var elm = document.getElementById('zn-download-link'); - elm.href = 'https://coyote.priceyak.com/download/' + coyoteName; + elm.href = '/download/' + coyoteName; elm.style.display = ''; rfb.connect(host, port, password, path); From 49031257f2478a0f9e9e03ab3d251d129993f626 Mon Sep 17 00:00:00 2001 From: Eric Swanson Date: Wed, 30 Aug 2017 14:30:20 -0700 Subject: [PATCH 04/15] Work with mouse on touchscreens --- include/input.js | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/include/input.js b/include/input.js index fa6ba44a..9f6a4d2d 100644 --- a/include/input.js +++ b/include/input.js @@ -338,14 +338,13 @@ var Keyboard, Mouse; Util.addEvent(window, 'touchend', this._eventHandlers.mouseup); Util.addEvent(c, 'touchend', this._eventHandlers.mouseup); Util.addEvent(c, 'touchmove', this._eventHandlers.mousemove); - } else { - Util.addEvent(c, 'mousedown', this._eventHandlers.mousedown); - Util.addEvent(window, 'mouseup', this._eventHandlers.mouseup); - Util.addEvent(c, 'mouseup', this._eventHandlers.mouseup); - Util.addEvent(c, 'mousemove', this._eventHandlers.mousemove); - Util.addEvent(c, (Util.Engine.gecko) ? 'DOMMouseScroll' : 'mousewheel', - this._eventHandlers.mousewheel); } + Util.addEvent(c, 'mousedown', this._eventHandlers.mousedown); + Util.addEvent(window, 'mouseup', this._eventHandlers.mouseup); + Util.addEvent(c, 'mouseup', this._eventHandlers.mouseup); + Util.addEvent(c, 'mousemove', this._eventHandlers.mousemove); + Util.addEvent(c, (Util.Engine.gecko) ? 'DOMMouseScroll' : 'mousewheel', + this._eventHandlers.mousewheel); /* Work around right and middle click browser behaviors */ Util.addEvent(document, 'click', this._eventHandlers.mousedisable); @@ -360,14 +359,13 @@ var Keyboard, Mouse; Util.removeEvent(window, 'touchend', this._eventHandlers.mouseup); Util.removeEvent(c, 'touchend', this._eventHandlers.mouseup); Util.removeEvent(c, 'touchmove', this._eventHandlers.mousemove); - } else { - Util.removeEvent(c, 'mousedown', this._eventHandlers.mousedown); - Util.removeEvent(window, 'mouseup', this._eventHandlers.mouseup); - Util.removeEvent(c, 'mouseup', this._eventHandlers.mouseup); - Util.removeEvent(c, 'mousemove', this._eventHandlers.mousemove); - Util.removeEvent(c, (Util.Engine.gecko) ? 'DOMMouseScroll' : 'mousewheel', - this._eventHandlers.mousewheel); } + Util.removeEvent(c, 'mousedown', this._eventHandlers.mousedown); + Util.removeEvent(window, 'mouseup', this._eventHandlers.mouseup); + Util.removeEvent(c, 'mouseup', this._eventHandlers.mouseup); + Util.removeEvent(c, 'mousemove', this._eventHandlers.mousemove); + Util.removeEvent(c, (Util.Engine.gecko) ? 'DOMMouseScroll' : 'mousewheel', + this._eventHandlers.mousewheel); /* Work around right and middle click browser behaviors */ Util.removeEvent(document, 'click', this._eventHandlers.mousedisable); From 168ffd5123d53e3fc907fcd89fe067ff3d6bd9d2 Mon Sep 17 00:00:00 2001 From: Eric Swanson Date: Wed, 6 Sep 2017 14:32:41 -0700 Subject: [PATCH 05/15] Hide creds on connection --- vnc_auto.html | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/vnc_auto.html b/vnc_auto.html index c85a3338..af4b10a4 100644 --- a/vnc_auto.html +++ b/vnc_auto.html @@ -290,10 +290,14 @@ return; // don't continue trying to connect } - var coyoteName = WebUtil.getConfigVar('name', ''); - var elm = document.getElementById('zn-download-link'); - elm.href = '/download/' + coyoteName; - elm.style.display = ''; + var coyoteName = WebUtil.getConfigVar('name', ''); + var elm = document.getElementById('zn-download-link'); + elm.href = '/download/' + coyoteName; + elm.style.display = ''; + + // Scrub the query params from the URL so that it can be safely copy/pasted + console.log("Pushing new URL. Original: " + window.location.href); + window.history.replaceState({}, document.title, window.location.pathname); rfb.connect(host, port, password, path); }; From 9b8d86db258174293c4094658d37781487873ce7 Mon Sep 17 00:00:00 2001 From: Eric Swanson Date: Wed, 10 Jan 2018 11:30:09 -0800 Subject: [PATCH 06/15] Hack to hide the URL in local storage --- vnc_auto.html | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/vnc_auto.html b/vnc_auto.html index af4b10a4..ac33b96e 100644 --- a/vnc_auto.html +++ b/vnc_auto.html @@ -188,7 +188,7 @@ var xvpbuttons; xvpbuttons = $D('noVNC_xvp_buttons'); if (ver >= 1) { - xvpbuttons.style.display = 'inline';yakpal.setClipboard + xvpbuttons.style.display = 'inline'; } else { xvpbuttons.style.display = 'none'; } @@ -196,7 +196,7 @@ function onClipboard(rfb, text){ $D('copyBox').value = text - if(window.yakpal && window.yakpal.setClipboard){ + if(window['yakpal'] && window.yakpal.setClipboard){ yakpal.setClipboard(text); } } @@ -204,6 +204,19 @@ window.onscriptsload = function () { var host, port, password, path, token, lastClipboard; + // Expire any old (>4h) entries from localStorage + Object.keys(localStorage) + .filter((x)=>x.indexOf('coyote-url-') === 0) + .map((x)=>[x, JSON.parse(localStorage.getItem(x))]) + .filter((x)=>!x[1].timestamp || (new Date() - new Date(x[1].timestamp)) > 1000 * 3600 * 4) + .map((x)=>localStorage.removeItem(x[0])); + + // If we have an RID, try to load the real URL from session storage + var rid = WebUtil.getConfigVar('rid', ''); + var url = localStorage.getItem('coyote-url-' + rid); + if (rid && url) + window.history.replaceState({}, document.title, url.url); + //$D('sendCtrlAltDelButton').style.display = "inline"; //$D('sendCtrlAltDelButton').onclick = sendCtrlAltDel; //$D('xvpShutdownButton').onclick = xvpShutdown; @@ -220,7 +233,7 @@ $D('copyBox').addEventListener('paste', updateClipboard); setInterval(function(){ - if(!window.yakpal || !window.yakpal.getClipboard) return; + if(!window['yakpal'] || !window.yakpal.getClipboard) return; //hide use-yakpal if they have it try{ document.getElementById('use-yakpal').style.display = 'none'; @@ -296,8 +309,15 @@ elm.style.display = ''; // Scrub the query params from the URL so that it can be safely copy/pasted + // However, to support F5 or Ctrl-Shift-T, save the real URL in localstorage + // under a magic ID. The credentials are only valid for ~30 minutes after + // the user disconnects anyway, so this isn't a huge security issue. console.log("Pushing new URL. Original: " + window.location.href); - window.history.replaceState({}, document.title, window.location.pathname); + if (!rid) { + rid = ("" + Math.random()).replace("0.", ""); + } + localStorage.setItem("coyote-url-" + rid, JSON.stringify({url: window.location.href, timestamp: new Date()})); + window.history.replaceState({}, document.title, window.location.pathname + "?rid=" + rid); rfb.connect(host, port, password, path); }; From 06a686eb79777db861ad1d958cd0943751a557bd Mon Sep 17 00:00:00 2001 From: Eric Swanson Date: Wed, 10 Jan 2018 11:32:01 -0800 Subject: [PATCH 07/15] VNC fixes --- vnc_auto.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vnc_auto.html b/vnc_auto.html index ac33b96e..f8ce458b 100644 --- a/vnc_auto.html +++ b/vnc_auto.html @@ -213,7 +213,7 @@ // If we have an RID, try to load the real URL from session storage var rid = WebUtil.getConfigVar('rid', ''); - var url = localStorage.getItem('coyote-url-' + rid); + var url = JSON.parse(localStorage.getItem('coyote-url-' + rid)); if (rid && url) window.history.replaceState({}, document.title, url.url); @@ -315,8 +315,8 @@ console.log("Pushing new URL. Original: " + window.location.href); if (!rid) { rid = ("" + Math.random()).replace("0.", ""); + localStorage.setItem("coyote-url-" + rid, JSON.stringify({url: window.location.href, timestamp: new Date()})); } - localStorage.setItem("coyote-url-" + rid, JSON.stringify({url: window.location.href, timestamp: new Date()})); window.history.replaceState({}, document.title, window.location.pathname + "?rid=" + rid); rfb.connect(host, port, password, path); From 905cac387721d2ce2b89bf91c41d89ce3a2493f1 Mon Sep 17 00:00:00 2001 From: Eric Swanson Date: Tue, 15 May 2018 16:23:10 -0700 Subject: [PATCH 08/15] Native VNC creds --- vnc_auto.html | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/vnc_auto.html b/vnc_auto.html index f8ce458b..8798614e 100644 --- a/vnc_auto.html +++ b/vnc_auto.html @@ -44,6 +44,24 @@ location.href = "https://www.priceyak.com/expired"; }, 1000 * 3600 * 12); + + @@ -86,6 +104,11 @@ + + + + +
VNC Host:
VNC Password:
@@ -266,6 +289,7 @@ password = WebUtil.getConfigVar('password', ''); path = WebUtil.getConfigVar('path', 'websockify'); + var vncPort = WebUtil.getConfigVar('vncport', ''); // If a token variable is passed in, set the parameter in a cookie. // This is used by nova-novncproxy. @@ -319,6 +343,12 @@ } window.history.replaceState({}, document.title, window.location.pathname + "?rid=" + rid); + document.getElementById('zn-creds-host').innerHTML = window.location.hostname + ":" + vncPort; + document.getElementById('zn-creds-password').innerHTML = password; + document.getElementById('zn-show-creds').addEventListener('click', function() { + document.getElementById('zn-creds').style.display = "block"; + }); + rfb.connect(host, port, password, path); }; From 313f94b91522929e060de173ea8a319903632346 Mon Sep 17 00:00:00 2001 From: Doug Feigelson Date: Fri, 8 Jun 2018 00:46:02 -0700 Subject: [PATCH 09/15] add vncurl --- vnc_auto.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vnc_auto.html b/vnc_auto.html index 8798614e..a19236ba 100644 --- a/vnc_auto.html +++ b/vnc_auto.html @@ -104,7 +104,7 @@ - + @@ -343,6 +343,7 @@ } window.history.replaceState({}, document.title, window.location.pathname + "?rid=" + rid); + document.getElementById('zn-vncurl').href = "vnc://:" + password + "@" + window.location.hostname + ":" +vncPort; document.getElementById('zn-creds-host').innerHTML = window.location.hostname + ":" + vncPort; document.getElementById('zn-creds-password').innerHTML = password; document.getElementById('zn-show-creds').addEventListener('click', function() { From 4378eca2e8141ec00c4f2d5ffe491809d0e7b53c Mon Sep 17 00:00:00 2001 From: Doug Feigelson Date: Fri, 8 Jun 2018 00:51:49 -0700 Subject: [PATCH 10/15] style --- vnc_auto.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vnc_auto.html b/vnc_auto.html index a19236ba..984b5e9b 100644 --- a/vnc_auto.html +++ b/vnc_auto.html @@ -54,7 +54,7 @@ font-family: monospace; } #zn-show-creds { - color:white; + color:white !important; padding-left: 5px; font-size: 20px; } From c892d74e0ff3096f57ea71e8716dcd5f796f4de1 Mon Sep 17 00:00:00 2001 From: Doug Feigelson Date: Fri, 8 Jun 2018 00:54:41 -0700 Subject: [PATCH 11/15] style --- vnc_auto.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vnc_auto.html b/vnc_auto.html index 984b5e9b..5ace5d4b 100644 --- a/vnc_auto.html +++ b/vnc_auto.html @@ -54,13 +54,16 @@ font-family: monospace; } #zn-show-creds { - color:white !important; + color:white; padding-left: 5px; font-size: 20px; } .zn-creds-left { padding-right: 20px; } + #zn-vnccurl { + color:white; + } From 5f625452b042686ce2471ad50dbf19ae1a9e224a Mon Sep 17 00:00:00 2001 From: Doug Feigelson Date: Fri, 8 Jun 2018 00:55:49 -0700 Subject: [PATCH 12/15] tired --- vnc_auto.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vnc_auto.html b/vnc_auto.html index 5ace5d4b..60efb23c 100644 --- a/vnc_auto.html +++ b/vnc_auto.html @@ -61,7 +61,7 @@ .zn-creds-left { padding-right: 20px; } - #zn-vnccurl { + #zn-vncurl { color:white; } From 48f6acdc191028e54355a23c27d39fe326a4f278 Mon Sep 17 00:00:00 2001 From: Eric Swanson Date: Tue, 14 May 2019 23:23:16 -0700 Subject: [PATCH 13/15] Update script to allow closing explicitly --- favicon.ico | Bin 18 -> 1150 bytes vnc_auto.html | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+) mode change 120000 => 100644 favicon.ico diff --git a/favicon.ico b/favicon.ico deleted file mode 120000 index 45399c8c..00000000 --- a/favicon.ico +++ /dev/null @@ -1 +0,0 @@ -images/favicon.ico \ No newline at end of file diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..c999634f0e9b5fd5250f34d13118104261346610 GIT binary patch literal 1150 zcmb_bK~BR!4D{}%NjX#s9JoSJg;IC}2M$OaxNv|cAf&!xD-=TC(J!=D`m@FM#>T2d zB?5_@acqyryU7ALyz3h9c@D1yz$pMUXc)psjw1kIZjC@DSJ!pvuZF$S5EEVD`sO-K zwz~vXl@a^8vuXCdXQVt?^|DBBs};`<&ZW>?Y2J;;?7QO=uH&8|a7?raW54z=y-+UK zVvcb1_^ff#m~1{1q4bC`vi{NXgX{e4l9BSnCkyj_O)k$bT-NXTtaW?GeaRR8=>9={ zI559(gopow&Y>}1=uA{k`xoEyx2KvRChM
VNC Host:
VNC Password: