Files
docker-webserver-nginx/rootfs/app/entrypoint.sh.d/90_stats.sh
paspo dfdea84bf7
All checks were successful
Container Publish / on-success-skip (push) Has been skipped
Container Publish / build-image (amd64) (push) Successful in 20s
Container Publish / build-image (arm64) (push) Successful in 19s
Container Publish / update docker manifest (push) Successful in 9s
fix #9: stats doesn't need a separate server
2025-07-31 16:16:02 +02:00

23 lines
506 B
Bash
Executable File

#!/bin/sh
if [ ${DISABLE_STATS} -eq 1 ] ; then
exit 0
fi
echo "# Configuring stats"
# make sure paths exists
mkdir -p "${PATH_AUTH}" "${PATH_STATS}" "${PATH_STATSDB}"
touch "${PATH_AUTH}/stats"
chown -R "${USERNAME}:${GROUPNAME}" "${PATH_AUTH}" "${PATH_STATS}" "${PATH_STATSDB}"
# stats endpoint
cat > /etc/nginx/local.d/stats.conf <<EOF
location ^~ /stats {
root ${PATH_STATS};
auth_basic "Restricted area";
auth_basic_user_file ${PATH_AUTH}/stats;
try_files /index.html =404;
}
EOF