moved config steps into separate scripts
All checks were successful
All checks were successful
This commit is contained in:
33
rootfs/app/entrypoint.sh.d/90_stats.sh
Executable file
33
rootfs/app/entrypoint.sh.d/90_stats.sh
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user