FIX #4: added DISABLE_STATS flag and moved stats refresh in a dedicated script

This commit is contained in:
2025-07-31 15:43:47 +02:00
parent 8d534bfd9b
commit b8c4e51fbe
5 changed files with 23 additions and 1 deletions

15
rootfs/app/stats.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/sh
if [ "${DISABLE_STATS:-0}" -eq 1 ] ; then
exit 0
fi
PATH_BASE=/data
PATH_STATS=${PATH_BASE}/stats
PATH_STATSDB=${PATH_BASE}/stats.db
PATH_LOGS=${PATH_BASE}/logs
/usr/bin/goaccess "${PATH_LOGS}/nginx-access.log.1" \
--agent-list --anonymize-ip --real-os \
--output "${PATH_STATS}/index.html" --log-format COMBINED \
--tz="${TZ}" "--db-path=${PATH_STATSDB}" --persist --restore