Files
docker-webserver-nginx/rootfs/app/entrypoint.sh.d/90_stats.sh
paspo 13d29c224a
All checks were successful
Container Publish / on-success-skip (push) Has been skipped
Container Publish / build-image (arm64) (push) Successful in 37s
Container Publish / build-image (amd64) (push) Successful in 50s
Container Publish / update docker manifest (push) Successful in 16s
moved config steps into separate scripts
2025-07-31 09:29:04 +02:00

34 lines
701 B
Bash
Executable File

#!/bin/sh
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/http.d/stats.conf <<EOF
server {
listen ${STATS_PORT} default_server;
listen [::]:${STATS_PORT} default_server;
root ${PATH_STATS};
location = / {
index index.html;
try_files /index.html =404;
}
location /index.html {
try_files /index.html =404;
}
location / {
return 404;
}
auth_basic "Restricted area";
auth_basic_user_file ${PATH_AUTH}/stats;
}
EOF