From 90f8d8eec66eedecedf56f2dd79c686c2bedff77 Mon Sep 17 00:00:00 2001 From: Eric Schultz Date: Tue, 20 Oct 2020 02:02:02 -0700 Subject: [PATCH 1/2] fix: adjust wc copy options --- dynamix.unraid.net.plg | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/dynamix.unraid.net.plg b/dynamix.unraid.net.plg index e23a2827d..4693d2076 100644 --- a/dynamix.unraid.net.plg +++ b/dynamix.unraid.net.plg @@ -1,15 +1,15 @@ - - - - - - - - + + + + + + + + + ]> @@ -142,7 +142,7 @@ install() { # Copy across wc files rm -rf /usr/local/emhttp/webGui/wc mkdir -p /usr/local/emhttp/webGui/wc - cp -r /boot/config/plugins/Unraid.net/wc /usr/local/emhttp/webGui/wc + cp /boot/config/plugins/Unraid.net/wc/* /usr/local/emhttp/webGui/wc # Start new process start @@ -1214,7 +1214,7 @@ fi # Copy files to boot mkdir -p /boot/config/plugins/Unraid.net/wc -cp -r /usr/local/emhttp/webGui/wc /boot/config/plugins/Unraid.net/wc +cp /usr/local/emhttp/webGui/wc/* /boot/config/plugins/Unraid.net/wc ]]> From 655238ccd925f23feecbe6c10c51550b01358aa2 Mon Sep 17 00:00:00 2001 From: Eric Schultz Date: Tue, 20 Oct 2020 11:21:32 -0700 Subject: [PATCH 2/2] feat: async flash backup status --- dynamix.unraid.net.plg | 111 ++++++++++++++++++++++++++++++++++------- 1 file changed, 94 insertions(+), 17 deletions(-) diff --git a/dynamix.unraid.net.plg b/dynamix.unraid.net.plg index 4693d2076..81331ac5d 100644 --- a/dynamix.unraid.net.plg +++ b/dynamix.unraid.net.plg @@ -253,17 +253,11 @@ if (empty($remote['wanport'])) { $remote['wanport'] = 443; } -$hasCert = $var['USE_SSL']=='auto' && file_exists('/boot/config/ssl/certs/certificate_bundle.pem'); +$hasCert = $var['USE_SSL']!='no' && + file_exists('/boot/config/ssl/certs/certificate_bundle.pem') && + preg_match('/[0-9a-f]{40}\.unraid\.net$/', exec('openssl x509 -in /boot/config/ssl/certs/certificate_bundle.pem -subject -noout 2>&1')); $isRegistered = !empty($remote['apikey']); $boolWebUIAuth = $isRegistered && file_exists('/etc/nginx/htpasswd'); - -$isActivated = false; -$isUptodate = false; -if ($isRegistered) { - exec("/usr/bin/php -f $docroot/plugins/dynamix.unraid.net/include/UpdateFlashBackup.php status", $output, $retval); - $isActivated = ($retval == 0); - if ($isActivated) $isUptodate = empty($output); -} ?>
@@ -413,7 +424,7 @@ Unraid.net Status: Allow Remote Access: -: Disabled until you Provision a SSL Cert and enable SSL/TLS +: Disabled until you Provision an unraid.net SSL Cert and set SSL/TLS to Auto @@ -442,8 +453,13 @@ WAN Port: +
+Flash backup: +: Loading + +
+ + + + +
]]> @@ -738,6 +762,59 @@ esac + + + + "", + "username" => "", + "avatar" => "", + "wanaccess" => "no", + "wanport" => "443" + ]; +} + +$isRegistered = !empty($remote['apikey']); +$isActivated = false; +$isUptodate = false; +if ($isRegistered) { + exec("/usr/bin/php -f $docroot/plugins/dynamix.unraid.net/include/UpdateFlashBackup.php status", $output, $retval); + $isActivated = ($retval == 0); + if ($isActivated) $isUptodate = empty($output); +} + +$arrReturn = [ + 'registered' => $isRegistered, + 'activated' => $isActivated, + 'uptodate' => $isUptodate +]; + +header('Content-Type: application/json'); +echo json_encode($arrReturn); +?> +]]> + + +