From 18d6ec57f82b1cc469c46333e50c56d307ff5371 Mon Sep 17 00:00:00 2001 From: bergware Date: Mon, 21 Mar 2022 20:11:58 +0100 Subject: [PATCH 01/11] Make links in help text standout (red) --- plugins/dynamix/styles/default-azure.css | 1 + plugins/dynamix/styles/default-black.css | 1 + plugins/dynamix/styles/default-gray.css | 1 + plugins/dynamix/styles/default-white.css | 1 + 4 files changed, 4 insertions(+) diff --git a/plugins/dynamix/styles/default-azure.css b/plugins/dynamix/styles/default-azure.css index c8b0f26ee..b8b335d54 100644 --- a/plugins/dynamix/styles/default-azure.css +++ b/plugins/dynamix/styles/default-azure.css @@ -338,6 +338,7 @@ dd p{margin:0 0 4px 0} dd blockquote{padding-left:0} blockquote{width:90%;margin:10px auto;text-align:left;padding:4px 20px;border:1px solid #bce8f1;color:#3a87ad;background-color:#d9edf7;box-sizing:border-box} blockquote.ontop{margin-top:0;margin-bottom:46px} +blockquote a{color:red;} label.checkbox{display:block;position:relative;padding-left:28px;margin:3px 0;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} label.checkbox input{position:absolute;opacity:0;cursor:pointer} span.checkmark{position:absolute;top:0;left:6px;height:14px;width:14px;background-color:#d4d2d4;border-radius:100%} diff --git a/plugins/dynamix/styles/default-black.css b/plugins/dynamix/styles/default-black.css index e2f65fc24..2146b36a6 100644 --- a/plugins/dynamix/styles/default-black.css +++ b/plugins/dynamix/styles/default-black.css @@ -315,6 +315,7 @@ dd p{margin:0 0 4px 0} dd blockquote{padding-left:0} blockquote{width:90%;margin:10px auto;text-align:left;padding:4px 20px;border-top:2px solid #bce8f1;border-bottom:2px solid #bce8f1;color:#3a87ad;background-color:#d9edf7} blockquote.ontop{margin-top:-20px;margin-bottom:46px} +blockquote a{color:red;} label.checkbox{display:block;position:relative;padding-left:28px;margin:3px 0;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} label.checkbox input{position:absolute;opacity:0;cursor:pointer} span.checkmark{position:absolute;top:0;left:6px;height:14px;width:14px;background-color:#2b2b2b;border-radius:100%} diff --git a/plugins/dynamix/styles/default-gray.css b/plugins/dynamix/styles/default-gray.css index 49798b342..f00545d02 100644 --- a/plugins/dynamix/styles/default-gray.css +++ b/plugins/dynamix/styles/default-gray.css @@ -338,6 +338,7 @@ dd p{margin:0 0 4px 0} dd blockquote{padding-left:0} blockquote{width:90%;margin:10px auto;text-align:left;padding:4px 20px;border:1px solid #bce8f1;color:#3a87ad;background-color:#d9edf7;box-sizing:border-box} blockquote.ontop{margin-top:0;margin-bottom:46px} +blockquote a{color:red;} label.checkbox{display:block;position:relative;padding-left:28px;margin:3px 0;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} label.checkbox input{position:absolute;opacity:0;cursor:pointer} span.checkmark{position:absolute;top:0;left:6px;height:14px;width:14px;background-color:#2b2d2b;border-radius:100%} diff --git a/plugins/dynamix/styles/default-white.css b/plugins/dynamix/styles/default-white.css index 4e6575294..7ab46ff93 100644 --- a/plugins/dynamix/styles/default-white.css +++ b/plugins/dynamix/styles/default-white.css @@ -315,6 +315,7 @@ dd p{margin:0 0 4px 0} dd blockquote{padding-left:0} blockquote{width:90%;margin:10px auto;text-align:left;padding:4px 20px;border-top:2px solid #bce8f1;border-bottom:2px solid #bce8f1;color:#3a87ad;background-color:#d9edf7} blockquote.ontop{margin-top:-20px;margin-bottom:46px} +blockquote a{color:red;} label.checkbox{display:block;position:relative;padding-left:28px;margin:3px 0;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} label.checkbox input{position:absolute;opacity:0;cursor:pointer} span.checkmark{position:absolute;top:0;left:6px;height:14px;width:14px;background-color:#e3e3e3;border-radius:100%} From 6fc7f913c8ea9c8ed2795b27e6ae7c5d48c2b6ea Mon Sep 17 00:00:00 2001 From: bergware Date: Mon, 21 Mar 2022 23:12:50 +0100 Subject: [PATCH 02/11] Make links in help text standout --- plugins/dynamix/styles/default-azure.css | 3 ++- plugins/dynamix/styles/default-black.css | 3 ++- plugins/dynamix/styles/default-gray.css | 3 ++- plugins/dynamix/styles/default-white.css | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/dynamix/styles/default-azure.css b/plugins/dynamix/styles/default-azure.css index b8b335d54..862fbca86 100644 --- a/plugins/dynamix/styles/default-azure.css +++ b/plugins/dynamix/styles/default-azure.css @@ -338,7 +338,8 @@ dd p{margin:0 0 4px 0} dd blockquote{padding-left:0} blockquote{width:90%;margin:10px auto;text-align:left;padding:4px 20px;border:1px solid #bce8f1;color:#3a87ad;background-color:#d9edf7;box-sizing:border-box} blockquote.ontop{margin-top:0;margin-bottom:46px} -blockquote a{color:red;} +blockquote a{color:#ff8c2f;font-weight:600} +blockquote a:hover,blockquote a:focus{color:#f15a2c} label.checkbox{display:block;position:relative;padding-left:28px;margin:3px 0;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} label.checkbox input{position:absolute;opacity:0;cursor:pointer} span.checkmark{position:absolute;top:0;left:6px;height:14px;width:14px;background-color:#d4d2d4;border-radius:100%} diff --git a/plugins/dynamix/styles/default-black.css b/plugins/dynamix/styles/default-black.css index 2146b36a6..d1748c566 100644 --- a/plugins/dynamix/styles/default-black.css +++ b/plugins/dynamix/styles/default-black.css @@ -315,7 +315,8 @@ dd p{margin:0 0 4px 0} dd blockquote{padding-left:0} blockquote{width:90%;margin:10px auto;text-align:left;padding:4px 20px;border-top:2px solid #bce8f1;border-bottom:2px solid #bce8f1;color:#3a87ad;background-color:#d9edf7} blockquote.ontop{margin-top:-20px;margin-bottom:46px} -blockquote a{color:red;} +blockquote a{color:#ff8c2f;font-weight:600} +blockquote a:hover,blockquote a:focus{color:#f15a2c} label.checkbox{display:block;position:relative;padding-left:28px;margin:3px 0;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} label.checkbox input{position:absolute;opacity:0;cursor:pointer} span.checkmark{position:absolute;top:0;left:6px;height:14px;width:14px;background-color:#2b2b2b;border-radius:100%} diff --git a/plugins/dynamix/styles/default-gray.css b/plugins/dynamix/styles/default-gray.css index f00545d02..95101248b 100644 --- a/plugins/dynamix/styles/default-gray.css +++ b/plugins/dynamix/styles/default-gray.css @@ -338,7 +338,8 @@ dd p{margin:0 0 4px 0} dd blockquote{padding-left:0} blockquote{width:90%;margin:10px auto;text-align:left;padding:4px 20px;border:1px solid #bce8f1;color:#3a87ad;background-color:#d9edf7;box-sizing:border-box} blockquote.ontop{margin-top:0;margin-bottom:46px} -blockquote a{color:red;} +blockquote a{color:#ff8c2f;font-weight:600} +blockquote a:hover,blockquote a:focus{color:#f15a2c} label.checkbox{display:block;position:relative;padding-left:28px;margin:3px 0;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} label.checkbox input{position:absolute;opacity:0;cursor:pointer} span.checkmark{position:absolute;top:0;left:6px;height:14px;width:14px;background-color:#2b2d2b;border-radius:100%} diff --git a/plugins/dynamix/styles/default-white.css b/plugins/dynamix/styles/default-white.css index 7ab46ff93..fb471e44e 100644 --- a/plugins/dynamix/styles/default-white.css +++ b/plugins/dynamix/styles/default-white.css @@ -315,7 +315,8 @@ dd p{margin:0 0 4px 0} dd blockquote{padding-left:0} blockquote{width:90%;margin:10px auto;text-align:left;padding:4px 20px;border-top:2px solid #bce8f1;border-bottom:2px solid #bce8f1;color:#3a87ad;background-color:#d9edf7} blockquote.ontop{margin-top:-20px;margin-bottom:46px} -blockquote a{color:red;} +blockquote a{color:#ff8c2f;font-weight:600} +blockquote a:hover,blockquote a:focus{color:#f15a2c} label.checkbox{display:block;position:relative;padding-left:28px;margin:3px 0;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} label.checkbox input{position:absolute;opacity:0;cursor:pointer} span.checkmark{position:absolute;top:0;left:6px;height:14px;width:14px;background-color:#e3e3e3;border-radius:100%} From 43786719875de1e554458dd0d051674a2d5cb8c8 Mon Sep 17 00:00:00 2001 From: bergware Date: Mon, 21 Mar 2022 23:18:27 +0100 Subject: [PATCH 03/11] Make links in help text standout --- plugins/dynamix/styles/default-azure.css | 2 +- plugins/dynamix/styles/default-black.css | 2 +- plugins/dynamix/styles/default-gray.css | 2 +- plugins/dynamix/styles/default-white.css | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/dynamix/styles/default-azure.css b/plugins/dynamix/styles/default-azure.css index 862fbca86..ad4d2fa94 100644 --- a/plugins/dynamix/styles/default-azure.css +++ b/plugins/dynamix/styles/default-azure.css @@ -336,7 +336,7 @@ dt{clear:left;float:left;width:35%} dd{margin-bottom:12px;white-space:nowrap} dd p{margin:0 0 4px 0} dd blockquote{padding-left:0} -blockquote{width:90%;margin:10px auto;text-align:left;padding:4px 20px;border:1px solid #bce8f1;color:#3a87ad;background-color:#d9edf7;box-sizing:border-box} +blockquote{width:90%;margin:10px auto;text-align:left;padding:4px 20px;border:1px solid #bce8f1;color:#222222;background-color:#d9edf7;box-sizing:border-box} blockquote.ontop{margin-top:0;margin-bottom:46px} blockquote a{color:#ff8c2f;font-weight:600} blockquote a:hover,blockquote a:focus{color:#f15a2c} diff --git a/plugins/dynamix/styles/default-black.css b/plugins/dynamix/styles/default-black.css index d1748c566..d6b16f9b7 100644 --- a/plugins/dynamix/styles/default-black.css +++ b/plugins/dynamix/styles/default-black.css @@ -313,7 +313,7 @@ dt{clear:left;float:left;width:35%;font-weight:normal} dd{margin-bottom:12px;white-space:nowrap} dd p{margin:0 0 4px 0} dd blockquote{padding-left:0} -blockquote{width:90%;margin:10px auto;text-align:left;padding:4px 20px;border-top:2px solid #bce8f1;border-bottom:2px solid #bce8f1;color:#3a87ad;background-color:#d9edf7} +blockquote{width:90%;margin:10px auto;text-align:left;padding:4px 20px;border-top:2px solid #bce8f1;border-bottom:2px solid #bce8f1;color:#222222;background-color:#d9edf7} blockquote.ontop{margin-top:-20px;margin-bottom:46px} blockquote a{color:#ff8c2f;font-weight:600} blockquote a:hover,blockquote a:focus{color:#f15a2c} diff --git a/plugins/dynamix/styles/default-gray.css b/plugins/dynamix/styles/default-gray.css index 95101248b..b265852be 100644 --- a/plugins/dynamix/styles/default-gray.css +++ b/plugins/dynamix/styles/default-gray.css @@ -336,7 +336,7 @@ dt{clear:left;float:left;width:35%} dd{margin-bottom:12px;white-space:nowrap} dd p{margin:0 0 4px 0} dd blockquote{padding-left:0} -blockquote{width:90%;margin:10px auto;text-align:left;padding:4px 20px;border:1px solid #bce8f1;color:#3a87ad;background-color:#d9edf7;box-sizing:border-box} +blockquote{width:90%;margin:10px auto;text-align:left;padding:4px 20px;border:1px solid #bce8f1;color:#222222;background-color:#d9edf7;box-sizing:border-box} blockquote.ontop{margin-top:0;margin-bottom:46px} blockquote a{color:#ff8c2f;font-weight:600} blockquote a:hover,blockquote a:focus{color:#f15a2c} diff --git a/plugins/dynamix/styles/default-white.css b/plugins/dynamix/styles/default-white.css index fb471e44e..356aeca90 100644 --- a/plugins/dynamix/styles/default-white.css +++ b/plugins/dynamix/styles/default-white.css @@ -313,7 +313,7 @@ dt{clear:left;float:left;width:35%;font-weight:normal} dd{margin-bottom:12px;white-space:nowrap} dd p{margin:0 0 4px 0} dd blockquote{padding-left:0} -blockquote{width:90%;margin:10px auto;text-align:left;padding:4px 20px;border-top:2px solid #bce8f1;border-bottom:2px solid #bce8f1;color:#3a87ad;background-color:#d9edf7} +blockquote{width:90%;margin:10px auto;text-align:left;padding:4px 20px;border-top:2px solid #bce8f1;border-bottom:2px solid #bce8f1;color:#222222;background-color:#d9edf7} blockquote.ontop{margin-top:-20px;margin-bottom:46px} blockquote a{color:#ff8c2f;font-weight:600} blockquote a:hover,blockquote a:focus{color:#f15a2c} From 60e817ab9f49a0ba25bcda1a1c4cf0d5a160427b Mon Sep 17 00:00:00 2001 From: bergware Date: Mon, 21 Mar 2022 23:38:53 +0100 Subject: [PATCH 04/11] UpdateDNS to prefer IPv4 first and then IPv6 --- plugins/dynamix/include/UpdateDNS.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/dynamix/include/UpdateDNS.php b/plugins/dynamix/include/UpdateDNS.php index 244347af0..c851ab76f 100644 --- a/plugins/dynamix/include/UpdateDNS.php +++ b/plugins/dynamix/include/UpdateDNS.php @@ -93,7 +93,7 @@ function verbose_output($httpcode, $result) { echo (rebindDisabled()) ? "{$icon_ok}Rebind protection is disabled" : "{$icon_warn}Rebind protection is enabled"; echo " for ".($isLegacyCert ? "unraid.net" : "myunraid.net").PHP_EOL; if ($post) { - $wanip = trim(@file_get_contents("https://wanip.unraid.net/")); + $wanip = trim(@file_get_contents("https://wanip4.unraid.net/") ?: @file_get_contents("https://wanip6.unraid.net/")); // check the data $certhostname = $nginx['NGINX_CERTNAME']; if ($certhostname) { @@ -331,7 +331,7 @@ if ($isRegistered) { } if ($remoteaccess == 'yes') { // include wanip in the cache file so we can track if it changes - $post['_wanip'] = trim(@file_get_contents("https://wanip.unraid.net/")); + $post['_wanip'] = trim(@file_get_contents("https://wanip4.unraid.net/") ?: @file_get_contents("https://wanip6.unraid.net/")); $post['externalhostname'] = $externalhostname; $post['externalport'] = $externalport; $post['externalprotocol'] = $externalprotocol; @@ -345,7 +345,7 @@ if ($post['_wanip'] && ($post['_wanip'] != $nginx['NGINX_WANIP']) && version_com // if remoteaccess is currently disabled (perhaps because a wanip was not available when nginx was started) // BUT the system is configured to have it enabled AND a wanip is now available // then reload nginx -if ($remoteaccess == 'no' && $nginx['NGINX_WANACCESS'] == 'yes' && !empty(trim(@file_get_contents("https://wanip.unraid.net/")))) $reloadNginx = true; +if ($remoteaccess == 'no' && $nginx['NGINX_WANACCESS'] == 'yes' && !empty(trim(@file_get_contents("https://wanip4.unraid.net/") ?: @file_get_contents("https://wanip6.unraid.net/")))) $reloadNginx = true; if ($reloadNginx) { exec("/etc/rc.d/rc.nginx reload &>/dev/null"); } From a1fd464957795b932a87e12f8aa7186397eff7fd Mon Sep 17 00:00:00 2001 From: bergware Date: Tue, 22 Mar 2022 08:20:31 +0100 Subject: [PATCH 05/11] Allow simultaneous log and console windows for containers --- plugins/dynamix/include/DefaultPageLayout.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/dynamix/include/DefaultPageLayout.php b/plugins/dynamix/include/DefaultPageLayout.php index 7da3d3145..9d245ff19 100644 --- a/plugins/dynamix/include/DefaultPageLayout.php +++ b/plugins/dynamix/include/DefaultPageLayout.php @@ -228,7 +228,7 @@ function openTerminal(tag,name,more) { } // open terminal window (run in background) name = name.replace(/ /g,"_"); - tty_window = makeWindow(name,Math.max(screen.availHeight*3/5,600),Math.min(Math.max(screen.availWidth/2,900),1600)); + tty_window = makeWindow(name+(more=='.log'?more:''),Math.max(screen.availHeight*3/5,600),Math.min(Math.max(screen.availWidth/2,900),1600)); var socket = ['ttyd','syslog'].includes(tag) ? '/webterminal/'+tag+'/' : '/logterminal/'+name+(more=='.log'?more:'')+'/'; $.get('/webGui/include/OpenTerminal.php',{tag:tag,name:name,more:more},function(){tty_window.location=socket; tty_window.focus();}); } From ff73c0f8434824c690e19abeea5371cebceee4f8 Mon Sep 17 00:00:00 2001 From: bergware Date: Tue, 22 Mar 2022 08:33:51 +0100 Subject: [PATCH 06/11] UpdateDNS to prefer IPv4 only --- plugins/dynamix/include/UpdateDNS.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/dynamix/include/UpdateDNS.php b/plugins/dynamix/include/UpdateDNS.php index c851ab76f..e0443f8b3 100644 --- a/plugins/dynamix/include/UpdateDNS.php +++ b/plugins/dynamix/include/UpdateDNS.php @@ -93,7 +93,7 @@ function verbose_output($httpcode, $result) { echo (rebindDisabled()) ? "{$icon_ok}Rebind protection is disabled" : "{$icon_warn}Rebind protection is enabled"; echo " for ".($isLegacyCert ? "unraid.net" : "myunraid.net").PHP_EOL; if ($post) { - $wanip = trim(@file_get_contents("https://wanip4.unraid.net/") ?: @file_get_contents("https://wanip6.unraid.net/")); + $wanip = trim(@file_get_contents("https://wanip4.unraid.net/")); // check the data $certhostname = $nginx['NGINX_CERTNAME']; if ($certhostname) { @@ -331,7 +331,7 @@ if ($isRegistered) { } if ($remoteaccess == 'yes') { // include wanip in the cache file so we can track if it changes - $post['_wanip'] = trim(@file_get_contents("https://wanip4.unraid.net/") ?: @file_get_contents("https://wanip6.unraid.net/")); + $post['_wanip'] = trim(@file_get_contents("https://wanip4.unraid.net/")); $post['externalhostname'] = $externalhostname; $post['externalport'] = $externalport; $post['externalprotocol'] = $externalprotocol; @@ -345,7 +345,7 @@ if ($post['_wanip'] && ($post['_wanip'] != $nginx['NGINX_WANIP']) && version_com // if remoteaccess is currently disabled (perhaps because a wanip was not available when nginx was started) // BUT the system is configured to have it enabled AND a wanip is now available // then reload nginx -if ($remoteaccess == 'no' && $nginx['NGINX_WANACCESS'] == 'yes' && !empty(trim(@file_get_contents("https://wanip4.unraid.net/") ?: @file_get_contents("https://wanip6.unraid.net/")))) $reloadNginx = true; +if ($remoteaccess == 'no' && $nginx['NGINX_WANACCESS'] == 'yes' && !empty(trim(@file_get_contents("https://wanip4.unraid.net/")))) $reloadNginx = true; if ($reloadNginx) { exec("/etc/rc.d/rc.nginx reload &>/dev/null"); } From cee04f0a68a7834f91e05b78ac5e11c05faab26b Mon Sep 17 00:00:00 2001 From: bergware Date: Tue, 22 Mar 2022 19:43:12 +0100 Subject: [PATCH 07/11] Fixed: missing samesite attribute in cookies Removes browser warning that cookies without this attribute will be deprecated In addition all cookies have a default path = '/' to reference the complete site --- .../dynamix.plugin.manager/PluginInstall.page | 6 ++--- .../javascript/vmmanager.js | 4 +-- plugins/dynamix/ArrayDevices.page | 6 ++--- plugins/dynamix/ArrayOperation.page | 8 +++--- plugins/dynamix/Browse.page | 8 +++--- plugins/dynamix/DashStats.page | 6 ++--- plugins/dynamix/DiskList.page | 8 +++--- plugins/dynamix/HelpButton.page | 8 +++--- plugins/dynamix/LanguageButton.page | 6 ++--- plugins/dynamix/SecurityNFS.page | 8 +++--- plugins/dynamix/Selftest.page | 10 +++---- plugins/dynamix/ShareList.page | 8 +++--- plugins/dynamix/include/DefaultPageLayout.php | 26 +++++++++---------- plugins/dynamix/include/DiskList.php | 8 +++--- plugins/dynamix/include/ShareList.php | 8 +++--- plugins/dynamix/javascript/dynamix.js | 4 +-- 16 files changed, 66 insertions(+), 66 deletions(-) diff --git a/plugins/dynamix.plugin.manager/PluginInstall.page b/plugins/dynamix.plugin.manager/PluginInstall.page index 284f4d2b3..86d0bccc6 100644 --- a/plugins/dynamix.plugin.manager/PluginInstall.page +++ b/plugins/dynamix.plugin.manager/PluginInstall.page @@ -3,8 +3,8 @@ Title="Install Plugin" Tag="download" --- diff --git a/plugins/dynamix.vm.manager/javascript/vmmanager.js b/plugins/dynamix.vm.manager/javascript/vmmanager.js index f7e9c6033..10b6dfe5a 100644 --- a/plugins/dynamix.vm.manager/javascript/vmmanager.js +++ b/plugins/dynamix.vm.manager/javascript/vmmanager.js @@ -130,10 +130,10 @@ function toggle_id(itemID){ var cookie = $.cookie('vmshow')||''; if ((document.getElementById(itemID).style.display == 'none')) { slideDownRows($('#'+itemID)); - if (cookie.indexOf(itemID)<0) $.cookie('vmshow',cookie+itemID+',',{path:'/'}); + if (cookie.indexOf(itemID)<0) $.cookie('vmshow',cookie+itemID+','); } else { slideUpRows($('#'+itemID)); - if (cookie.indexOf(itemID)>=0) $.cookie('vmshow',cookie.replace(itemID+',',''),{path:'/'}); + if (cookie.indexOf(itemID)>=0) $.cookie('vmshow',cookie.replace(itemID+',','')); } return false; } diff --git a/plugins/dynamix/ArrayDevices.page b/plugins/dynamix/ArrayDevices.page index aeb3a4dbc..59f1a7beb 100644 --- a/plugins/dynamix/ArrayDevices.page +++ b/plugins/dynamix/ArrayDevices.page @@ -3,8 +3,8 @@ Title="Array Devices" Tag="database" --- '); @@ -260,7 +260,7 @@ mymonitor.on('message', function(state) { $('#mover-button').prop('disabled',false); - $('#mover-text').html("_(Move)_ _(will immediately invoke the Mover)_.  onclick=\"$.cookie('one','tab2',{path:'/'})\">(_(Schedule)_)"); + $('#mover-text').html("_(Move)_ _(will immediately invoke the Mover)_.  onclick=\"$.cookie('one','tab2')\">(_(Schedule)_)"); break; case '1': // parity running @@ -419,7 +419,7 @@ function formatWarning(val) { **_(Clear)_** _(will start **Disk-Clear** of new data disk(s))_. 1):?> - _(Parity is valid)_.**_(Check)_** _(will start **Parity-Check**)_.  onclick="$.cookie('one','tab1',{path:'/'})">(_(Schedule)_) + _(Parity is valid)_.**_(Check)_** _(will start **Parity-Check**)_.  onclick="$.cookie('one','tab1')">(_(Schedule)_)
_(Write corrections to parity)_ **_(Check)_** _(will start **Read-Check** of all array disks)_. diff --git a/plugins/dynamix/Browse.page b/plugins/dynamix/Browse.page index 59934e3a9..f93ebf685 100644 --- a/plugins/dynamix/Browse.page +++ b/plugins/dynamix/Browse.page @@ -3,8 +3,8 @@ Tag="navicon" Markdown="false" --- function displayDisks(all) { if (all == 'yes') { - $.cookie('ssz','ssz',{path:'/'}); + $.cookie('ssz','ssz'); $('#disk_list').html("
"); $('div.spinner').html(unraid_logo); } $.get('/webGui/include/DiskList.php',{compute:all,path:'',scale:'',number:'',fill:$.cookie('ssz')},function(data){ - $.removeCookie('ssz',{path:'/'}) + $.removeCookie('ssz') $('#disk_list').html(data); $('#compute-disks').prop('disabled',!data || data.indexOf('colspan=')!=-1); }); diff --git a/plugins/dynamix/HelpButton.page b/plugins/dynamix/HelpButton.page index 1a076320a..cc0f2696e 100644 --- a/plugins/dynamix/HelpButton.page +++ b/plugins/dynamix/HelpButton.page @@ -4,8 +4,8 @@ Icon="icon-u-help" Code="e934" --- \ No newline at end of file diff --git a/plugins/dynamix/LanguageButton.page b/plugins/dynamix/LanguageButton.page index a9da275a4..017e5fac9 100644 --- a/plugins/dynamix/LanguageButton.page +++ b/plugins/dynamix/LanguageButton.page @@ -4,8 +4,8 @@ Icon="icon-u-switch" Code="e982" --- '; if (locale) { switchLanguage(''); - $.cookie('locale',locale,{path:'/'}); + $.cookie('locale',locale); } else { switchLanguage($.cookie('locale')); $.removeCookie('locale'); diff --git a/plugins/dynamix/SecurityNFS.page b/plugins/dynamix/SecurityNFS.page index f88638203..f5ba05846 100644 --- a/plugins/dynamix/SecurityNFS.page +++ b/plugins/dynamix/SecurityNFS.page @@ -4,8 +4,8 @@ Tag="linux" Cond="(($var['shareNFSEnabled']!='no') && (isset($name)?array_key_exists($name,$sec_nfs):0))" --- @@ -110,7 +110,7 @@ function readNFS() { var data = $.parseJSON(json); form.shareExportNFS.value = data.export; form.shareSecurityNFS.value = data.security; - if (data.hostList != '') $.cookie('hostList',data.hostList,{path:'/'}); + if (data.hostList != '') $.cookie('hostList',data.hostList); $(form).find('select').trigger('change'); }); } diff --git a/plugins/dynamix/Selftest.page b/plugins/dynamix/Selftest.page index 6bfacf33d..3034cab83 100644 --- a/plugins/dynamix/Selftest.page +++ b/plugins/dynamix/Selftest.page @@ -85,7 +85,7 @@ function testUpdate(init) { $('#short_test').val("_(Start)_"); $('#long_test').val("_(Start)_"); if (!init) { - $.removeCookie('test.',{path:'/'}); + $.removeCookie('test.'); } } }); @@ -104,11 +104,11 @@ function startShortTest() { if ($('#short_test').val()=="_(Start)_") { $('#short_test').val("_(Stop)_"); $('#long_test').attr('disabled','disabled'); - $.cookie('test.','short',{path:'/',expires:365}); + $.cookie('test.','short',{expires:365}); $.post('/webGui/include/SmartInfo.php',{cmd:'short',port:'',name:''},function(){timers.testUpdate = setTimeout(testUpdate,0);}); } else { clearTimeout(timers.testUpdate); - $.removeCookie('test.',{path:'/'}); + $.removeCookie('test.); $.post('/webGui/include/SmartInfo.php',{cmd:'stop',port:'',name:''},function(){setTimeout(testUpdate,0);}); } } @@ -116,11 +116,11 @@ function startLongTest() { if ($('#long_test').val()=="_(Start)_") { $('#long_test').val("_(Stop)_"); $('#short_test').attr('disabled','disabled'); - $.cookie('test.','long',{path:'/',expires:365}); + $.cookie('test.','long',{expires:365}); $.post('/webGui/include/SmartInfo.php',{cmd:'long',port:'',name:''},function(){timers.testUpdate = setTimeout(testUpdate,0);}); } else { clearTimeout(timers.testUpdate); - $.removeCookie('test.',{path:'/'}); + $.removeCookie('test.'); $.post('/webGui/include/SmartInfo.php',{cmd:'stop',port:'',name:''},function(){setTimeout(testUpdate,0);}); } } diff --git a/plugins/dynamix/ShareList.page b/plugins/dynamix/ShareList.page index af6fa3c9a..84bcde62e 100644 --- a/plugins/dynamix/ShareList.page +++ b/plugins/dynamix/ShareList.page @@ -4,8 +4,8 @@ Tag="user-circle" Cond="$var['fsState']!='Stopped' && $var['shareUser']=='e'" --- function displayShares(all) { if (all == 'yes') { - $.cookie('ssz','ssz',{path:'/'}); + $.cookie('ssz','ssz'); $('#shareslist').html("
"); $('div.spinner').html(unraid_logo); } $.get('/webGui/include/ShareList.php',{compute:all,path:'',scale:'',number:'',raw:'',fill:$.cookie('ssz')},function(data){ - $.removeCookie('ssz',{path:'/'}) + $.removeCookie('ssz') $('#shareslist').html(data); $('#compute-shares').prop('disabled',!data || data.indexOf('colspan=')!=-1); }); diff --git a/plugins/dynamix/include/DefaultPageLayout.php b/plugins/dynamix/include/DefaultPageLayout.php index 9d245ff19..c77d4d28c 100644 --- a/plugins/dynamix/include/DefaultPageLayout.php +++ b/plugins/dynamix/include/DefaultPageLayout.php @@ -157,34 +157,34 @@ function refresh(top) { for (var i=0,link; link=document.getElementsByTagName('a')[i]; i++) { link.style.color = "gray"; } //fake disable location.reload(); } else { - $.cookie('top',top,{path:'/'}); + $.cookie('top',top); location.reload(); } } function initab() { - $.removeCookie('one',{path:'/'}); - $.removeCookie('tab',{path:'/'}); + $.removeCookie('one'); + $.removeCookie('tab'); } function settab(tab) { - $.cookie('tab',tab,{path:'/'}); + $.cookie('tab',tab); - $.cookie('one','tab1',{path:'/'}); + $.cookie('one','tab1'); - $.cookie('one',tab,{path:'/'}); + $.cookie('one',tab); - $.cookie(($.cookie('one')==null?'tab':'one'),tab,{path:'/'}); + $.cookie(($.cookie('one')==null?'tab':'one'),tab); } function done(key) { var url = location.pathname.split('/'); var path = '/'+url[1]; if (key) for (var i=2; i$icon
"._($title)."
"; + echo ""; } } // create list of nchan scripts to be started @@ -715,7 +715,7 @@ $(function() { }); var top = ($.cookie('top')||0) - $('.tabs').offset().top - 75; if (top>0) {$('html,body').scrollTop(top);} - $.removeCookie('top',{path:'/'}); + $.removeCookie('top'); showNotice(" "); diff --git a/plugins/dynamix/include/DiskList.php b/plugins/dynamix/include/DiskList.php index 9c5547d2b..a9885a2cd 100644 --- a/plugins/dynamix/include/DiskList.php +++ b/plugins/dynamix/include/DiskList.php @@ -1,6 +1,6 @@ $disk) { default: $luks = ""._('Unknown encryption state').""; break; } else $luks = ""; echo ""; - echo "$help$luks".compress($name).""; + echo "$help$luks".compress($name).""; echo "{$disk['comment']}"; echo "".disk_share_settings($var['shareSMBEnabled'], $sec[$name]).""; echo "".disk_share_settings($var['shareNFSEnabled'], $sec_nfs[$name]).""; @@ -117,7 +117,7 @@ foreach ($disks as $name => $disk) { } } else { echo "$type"; - echo ""._('Compute')."..."; + echo ""._('Compute')."..."; echo "".my_scale($disk['fsFree']*1024, $unit)." $unit"; echo ""; echo ""; diff --git a/plugins/dynamix/include/ShareList.php b/plugins/dynamix/include/ShareList.php index 21c1098a9..f91f2b8fc 100644 --- a/plugins/dynamix/include/ShareList.php +++ b/plugins/dynamix/include/ShareList.php @@ -1,6 +1,6 @@ $share) { default: $luks = ""._('Unknown encryption state').""; break; } else $luks = ""; echo ""; - echo "$help$luks".compress($name).""; + echo "$help$luks".compress($name).""; echo "{$share['comment']}"; echo "".user_share_settings($var['shareSMBEnabled'], $sec[$name]).""; echo "".user_share_settings($var['shareNFSEnabled'], $sec_nfs[$name]).""; @@ -120,7 +120,7 @@ foreach ($shares as $name => $share) { } } else { echo "$cache"; - echo ""._('Compute')."..."; + echo ""._('Compute')."..."; echo "".my_scale($share['free']*1024, $unit)." $unit"; echo ""; echo ""; diff --git a/plugins/dynamix/javascript/dynamix.js b/plugins/dynamix/javascript/dynamix.js index 064fbebc3..a190400a7 100644 --- a/plugins/dynamix/javascript/dynamix.js +++ b/plugins/dynamix/javascript/dynamix.js @@ -47,8 +47,8 @@ Q.find=(function(){var aP=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][ /* SweetAlert v1.0.0, copyright Tristan Edwards - modified by Bergware - reversed buttons for use in Unraid NOT UPDATED */ !function(a,b,c){"use strict";!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0;)d=d.replace(" "+c+" "," ");b.className=d.replace(/^\s+|\s+$/g,"")}},i=function(c){var d=b.createElement("div");return d.appendChild(b.createTextNode(c)),d.innerHTML},j=function(b){b.style.opacity="",b.style.display="block"},k=function(b){if(b&&!b.length)return j(b);for(var c=0;c0?setTimeout(e,c):b.style.display="none"});e()},r=function(d){if("function"==typeof MouseEvent){var e=new MouseEvent("click",{view:a,bubbles:!1,cancelable:!0});d.dispatchEvent(e)}else if(b.createEvent){var f=b.createEvent("MouseEvents");f.initEvent("click",!1,!1),d.dispatchEvent(f)}else b.createEventObject?d.fireEvent("onclick"):"function"==typeof d.onclick&&d.onclick()},s=function(c){"function"==typeof c.stopPropagation?(c.stopPropagation(),c.preventDefault()):a.event&&a.event.hasOwnProperty("cancelBubble")&&(a.event.cancelBubble=!0)};e.hasClass=f,e.addClass=g,e.removeClass=h,e.escapeHtml=i,e._show=j,e.show=k,e._hide=l,e.hide=m,e.isDescendant=n,e.getTopMargin=o,e.fadeIn=p,e.fadeOut=q,e.fireClick=r,e.stopEventPropagation=s},{}],5:[function(b,d,e){Object.defineProperty(e,"__esModule",{value:!0});var f=b("./handle-dom"),g=b("./handle-swal-dom"),h=function(d,e,h){var i=d||a.event,j=i.keyCode||i.which,k=h.querySelector("button.confirm"),l=h.querySelector("button.cancel"),m=h.querySelectorAll("button[tabindex]");if([9,13,32,27].indexOf(j)!==-1){for(var n=i.target||i.srcElement,o=-1,p=0;p"),j.innerHTML=b.html?b.text:g.escapeHtml(b.text||"").split("\n").join("
"),b.text&&g.show(j),b.customClass)g.addClass(d,b.customClass),d.setAttribute("data-custom-class",b.customClass);else{var m=d.getAttribute("data-custom-class");g.removeClass(d,m),d.setAttribute("data-custom-class","")}if(g.hide(d.querySelectorAll(".sa-icon")),b.type&&!e.isIE8()){var n=function(){for(var a=!1,e=0;e","/":"?","\\":"|"},o={esc:27,escape:27,tab:9,space:32,return:13,enter:13,backspace:8,scrolllock:145,scroll_lock:145,scroll:145,capslock:20,caps_lock:20,caps:20,numlock:144,num_lock:144,num:144,pause:19,break:19,insert:45,home:36,delete:46,end:35,pageup:33,page_up:33,pu:33,pagedown:34,page_down:34,pd:34,left:37,up:38,right:39,down:40,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},d={shift:{wanted:!1,pressed:!1},ctrl:{wanted:!1,pressed:!1},alt:{wanted:!1,pressed:!1},meta:{wanted:!1,pressed:!1}};e.ctrlKey&&(d.ctrl.pressed=!0),e.shiftKey&&(d.shift.pressed=!0),e.altKey&&(d.alt.pressed=!0),e.metaKey&&(d.meta.pressed=!0);for(var c=0;k=r[c],c Date: Tue, 22 Mar 2022 19:51:02 +0100 Subject: [PATCH 08/11] Fixed typo --- plugins/dynamix/Selftest.page | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/dynamix/Selftest.page b/plugins/dynamix/Selftest.page index 3034cab83..d41d7be9f 100644 --- a/plugins/dynamix/Selftest.page +++ b/plugins/dynamix/Selftest.page @@ -108,7 +108,7 @@ function startShortTest() { $.post('/webGui/include/SmartInfo.php',{cmd:'short',port:'',name:''},function(){timers.testUpdate = setTimeout(testUpdate,0);}); } else { clearTimeout(timers.testUpdate); - $.removeCookie('test.); + $.removeCookie('test.'); $.post('/webGui/include/SmartInfo.php',{cmd:'stop',port:'',name:''},function(){setTimeout(testUpdate,0);}); } } From 3f01535f05cee99c49a3574284e83b0da3c65c48 Mon Sep 17 00:00:00 2001 From: bergware Date: Tue, 22 Mar 2022 20:19:04 +0100 Subject: [PATCH 09/11] WireGuard: user nginx settings and unraid.net api --- plugins/dynamix/WG0.page | 10 ++++++---- plugins/dynamix/include/update.wireguard.php | 8 ++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/plugins/dynamix/WG0.page b/plugins/dynamix/WG0.page index 285fe7a6e..710d4e27f 100644 --- a/plugins/dynamix/WG0.page +++ b/plugins/dynamix/WG0.page @@ -4,8 +4,8 @@ Tag="icon-vpn" Nchan="wg_poller" --- /dev/null",$filter); +$nginx = (array)parse_ini_file('state/nginx.ini'); + // add subnets defined in Docker custom networks if (count($filter)) { exec("docker network inspect --format='{{range .IPAM.Config}}{{println .Subnet}}{{end}}' ".implode(' ',$filter),$docker); @@ -122,7 +124,7 @@ function readConf(&$peer_wg,&$wg,$vtun) { foreach ($peer_wg as $i) if ((int)$wg["TYPE:$i"]==7) {$vpn = true; break;} return [$conf,$cfg,$file,$vpn]; } -$public = strpos($_SERVER['HTTP_HOST'],'unraid.net')!==false && $remote['wanaccess']=='yes' ? (substr($_SERVER['HTTP_HOST'],0,4)!='www.'?'www.':'').explode(':',$_SERVER['HTTP_HOST'])[0] : ''; +$public = $nginx['NGINX_WANFQDN']; $active = (array)explode(' ',exec('wg show interfaces')); $autostart = (array)explode(' ',@file_get_contents("$etc/autostart")); $build = false; @@ -1289,7 +1291,7 @@ _(Local tunnel address IPv6)_: _(Local endpoint)_: -: : +: : diff --git a/plugins/dynamix/include/update.wireguard.php b/plugins/dynamix/include/update.wireguard.php index ff03109fd..d9ad75d12 100644 --- a/plugins/dynamix/include/update.wireguard.php +++ b/plugins/dynamix/include/update.wireguard.php @@ -1,6 +1,6 @@ ['timeout'=>12]]); $int_ipv4 = $v4 ? (preg_match("/^$validIP4$/", $ip) ? $ip : (@dns_get_record($ip, DNS_A)[0]['ip'] ?: '')) : ''; - $ext_ipv4 = $v4 ? (@file_get_contents('https://api.ipify.org',false,$context) ?: '') : ''; + $ext_ipv4 = $v4 ? (@file_get_contents('https://wanip4.unraid.net',false,$context) ?: '') : ''; $int_ipv6 = $v6 ? (preg_match("/^$validIP6$/", $ip) ? $ip : (@dns_get_record($ip, DNS_AAAA)[0]['ipv6'] ?: '')) : ''; - $ext_ipv6 = $v6 ? (@file_get_contents('https://api6.ipify.org',false,$context) ?: '') : ''; + $ext_ipv6 = $v6 ? (@file_get_contents('https://wanip6.unraid.net',false,$context) ?: '') : ''; echo "$int_ipv4;$ext_ipv4;$int_ipv6;$ext_ipv6"; break; case 'addtunnel': From 72cdef6289dd2d0081a7f3894bf9fde8bc5a0290 Mon Sep 17 00:00:00 2001 From: bergware Date: Tue, 22 Mar 2022 21:17:49 +0100 Subject: [PATCH 10/11] WireGuard: user nginx settings and unraid.net api --- plugins/dynamix/WG0.page | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/dynamix/WG0.page b/plugins/dynamix/WG0.page index 710d4e27f..295a7f683 100644 --- a/plugins/dynamix/WG0.page +++ b/plugins/dynamix/WG0.page @@ -1291,7 +1291,7 @@ _(Local tunnel address IPv6)_: _(Local endpoint)_: -: : +: : From 90120593fd45385946ab20970393603432d5866a Mon Sep 17 00:00:00 2001 From: bergware Date: Wed, 23 Mar 2022 19:01:37 +0100 Subject: [PATCH 11/11] Parity: shown duration time excluding idle time --- plugins/dynamix/nchan/parity_list | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/dynamix/nchan/parity_list b/plugins/dynamix/nchan/parity_list index f98ec576b..517e86323 100755 --- a/plugins/dynamix/nchan/parity_list +++ b/plugins/dynamix/nchan/parity_list @@ -97,9 +97,9 @@ while (true) { if (new_parity_log($timestamp)) { $idle = []; while (count($synced)>1) $idle[] = array_pop($synced)-array_pop($synced); [$action,$size] = file_exists($resync) ? my_explode(',',file_get_contents($resync)) : [$var['mdResyncAction'],$var['mdResyncSize']]; - $duration = $var['sbSynced2']-$sbSynced; + $duration = $var['sbSynced2']-$sbSynced-array_sum($idle); $status = $var['sbSyncExit']; - $speed = $status==0 ? round($size*1024/($duration-array_sum($idle))) : 0; + $speed = $status==0 ? round($size*1024/$duration) : 0; $error = $var['sbSyncErrs']; file_put_contents($log,"$timestamp|$duration|$speed|$status|$error|$action|$size\n",FILE_APPEND); }