diff --git a/.assets/example.png b/.assets/example.png index 0913c63..22cff22 100644 Binary files a/.assets/example.png and b/.assets/example.png differ diff --git a/README.md b/README.md index 8a8dd2b..30ebb22 100644 --- a/README.md +++ b/README.md @@ -15,11 +15,11 @@ If adding multiple mods, enter them in an array separated by |, such as DOCKER_M Navigate to `dashboard.domain.com` from your LAN to view the dashboard. ## Notes -- The application discovery scans all the conf files and looks for the following structure in accordance with the samples, incorrect discovery results can be fixed by using the structure. +- The application discovery scans the proxy configs and looks for the following structure in accordance with the samples: ```yaml - set $upstream_app something; - set $upstream_port 123; - set $upstream_proto http; + set $upstream_app ; + set $upstream_port ; + set $upstream_proto ; proxy_pass $upstream_proto://$upstream_app:$upstream_port; ``` - Either [Swag Maxmind mod](https://github.com/linuxserver/docker-mods/tree/swag-maxmind) or [Swag DBIP mod](https://github.com/linuxserver/docker-mods/tree/swag-dbip) are required to enable the geo location graph. diff --git a/root/dashboard/www/index.php b/root/dashboard/www/index.php index 3d13027..adc4dcf 100644 --- a/root/dashboard/www/index.php +++ b/root/dashboard/www/index.php @@ -24,11 +24,11 @@ .far, .fas { font-family: "Font Awesome 5 Free" !important; } - .fa-exclamation-circle,.fa-check-circle, .fa-info-circle, .fa-edit { + .fa-exclamation-circle,.fa-check-circle, .fa-info-circle, .fa-edit, .fa-lock { font-size:20px; padding: 2px; } - .fa-check-circle { + .fa-check-circle, .fa-lock { color: #5DB56A; } .fa-exclamation-circle { @@ -38,6 +38,10 @@ color: gray; cursor: help; } + .fa-exclamation-circle:hover{ + color: gray; + cursor: help; + } HTML; } @@ -53,7 +57,7 @@ if ($data->status == 1) { $status .= ''; } else { - $status .= ''; + $status .= ''; } $status .= ''; if (!empty($data->locations)) { @@ -61,7 +65,12 @@ $location = implode(",", $locations); $status .= ''.$location.''; } else { - $status .= ''; + $error = 'Unable to locate the proxy config for '.$result.', it must use the following structure:'.PHP_EOL; + $error .= ' set $upstream_app ;'.PHP_EOL; + $error .= ' set $upstream_port ;'.PHP_EOL; + $error .= ' set $upstream_proto ;'.PHP_EOL; + $error .= ' proxy_pass $upstream_proto://$upstream_app:$upstream_port;'.PHP_EOL; + $status .= ''; } $status .= ''; $index++; @@ -133,7 +142,7 @@ $output = shell_exec("/etc/cont-init.d/70-templates"); foreach(explode(PHP_EOL, $output) as $line) { if(substr($line, 0, 1) === "*"){ - $tooltip .= str_replace("*", "", $line)." "; + $tooltip .= str_replace("*", "", $line).PHP_EOL; } elseif(substr($line, 0, 1) === "/") { $tr_class = ($counter % 2 == 0) ? 'shaded' : ''; $files .= ''.htmlspecialchars($line).''; @@ -236,8 +245,30 @@ return $goaccess; } + function GetCertificate() { + $certdate = shell_exec("openssl x509 -in /config/keys/letsencrypt/fullchain.pem -noout -enddate | awk -F '=' '{print \$NF}'"); + $certtime = strtotime($certdate); + $certdateshort = date('Y-m-d', $certtime ); + if (time() < $certtime) { + $ssl = ' SSL certificate valid until '.$certdateshort; + } else { + $ssl = ' SSL certificate expired on '.$certdateshort; + } + return << +

+ + {$ssl} + +

+ + HTML; + } + $goaccess = GetGoaccess(); - $status = GetHeader() . GetProxies() . GetF2B() . GetTemplates() . GetAnnouncements() . GetLinks() . '
'; + $status = GetHeader() . GetProxies() . GetF2B() . GetTemplates() . GetAnnouncements() . GetLinks() . "
"; $page = str_replace("
", $status, $goaccess); + $ssl = GetCertificate() . "
"; + $page = str_replace("
", $ssl, $page); echo $page; ?>