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); +?> +]]> + + +