mirror of
https://github.com/linuxserver/docker-mods.git
synced 2026-02-05 04:59:42 +08:00
use optional volume mount instead of env
This commit is contained in:
parent
52aaaa7741
commit
52b59d4dce
@ -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 Statistics", "<title>SWAG 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'> SWAG ", $goaccess);
|
||||
|
||||
@ -22,10 +22,6 @@ if [ "$(sed -nE 's|## Version ([0-9]{4}\/[0-9]{2}\/[0-9]{2}).*|\1|p' /dashboard/
|
||||
echo "**** Compare the changes using the sample file: /config/nginx/proxy-confs/dashboard.subdomain.conf.sample"
|
||||
fi
|
||||
|
||||
# preserve environment variables in PHP
|
||||
sed -E -i 's/^clear_env =.*$/clear_env = no/g' /config/php/www2.conf
|
||||
grep -qxF 'clear_env = no' /config/php/www2.conf || echo 'clear_env = no' >> /config/php/www2.conf
|
||||
|
||||
# permissions
|
||||
chown -R abc:abc \
|
||||
/dashboard \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user