use optional volume mount instead of env

This commit is contained in:
Alex Phillips
2022-02-03 09:38:52 -05:00
parent 52aaaa7741
commit 52b59d4dce
2 changed files with 2 additions and 6 deletions
+2 -2
View File
@@ -252,8 +252,8 @@
$geodb = '';
endif;
$access_log = getenv("GOACCESS_LOG_FILE") ?: "/config/log/nginx/access.log";
$goaccess = shell_exec("/usr/local/bin/goaccess -a -o html -f $access_log --config-file=/dashboard/goaccess.conf ".$geodb);
$access_log = file_exists("/dashboard/logs") ? "/dashboard/logs/*" : "/config/log/nginx/access.log";
$goaccess = shell_exec("cat $access_log" | /usr/local/bin/goaccess -a -o html --config-file=/dashboard/goaccess.conf $geodb -");
$goaccess = str_replace("<title>Server&nbsp;Statistics", "<title>SWAG&nbsp;Dashboard", $goaccess);
$goaccess = str_replace("<h1 class='h-dashboard'>", "<h1>", $goaccess);
$goaccess = str_replace("<i class='fa fa-tachometer'></i>", "<img src='/icon.svg' width='32' height='32'>&nbsp;SWAG&nbsp;", $goaccess);