auth file location
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
WEBROOT=/data/www
|
||||
WEBDAV_PORT=${WEBDAV_PORT:-8080}
|
||||
STATS_PORT=${STATS_PORT:-8081}
|
||||
LOG_DAYS=${LOG_DAYS:-7}
|
||||
PHP=${PHP:-none}
|
||||
POSTSIZE=${POSTSIZE:-256M}
|
||||
USERNAME=${USERNAME:-theuser}
|
||||
@@ -119,18 +120,19 @@ server {
|
||||
}
|
||||
|
||||
auth_basic "Restricted area";
|
||||
auth_basic_user_file /app/htpasswd;
|
||||
auth_basic_user_file /data/auth/webdav;
|
||||
}
|
||||
EOF
|
||||
|
||||
touch /app/htpasswd
|
||||
# authentication
|
||||
mkdir -p /data/auth
|
||||
touch /data/auth/stats /data/auth/webdav
|
||||
|
||||
# make sure nginx can log
|
||||
mkdir -p /data/logs /data/stats /data/stats.db
|
||||
chown -R "${USERNAME}:${GROUPNAME}" /data/logs /data/stats /data/stats.db
|
||||
|
||||
# configure logrotate
|
||||
LOG_DAYS=${LOG_DAYS:-7}
|
||||
cat >/etc/logrotate.d/nginx <<EOF
|
||||
/data/logs/nginx-access.log {
|
||||
missingok
|
||||
@@ -169,7 +171,7 @@ server {
|
||||
}
|
||||
|
||||
auth_basic "Restricted area";
|
||||
auth_basic_user_file /app/htpasswd;
|
||||
auth_basic_user_file /data/auth/stats;
|
||||
}
|
||||
EOF
|
||||
|
||||
|
||||
Reference in New Issue
Block a user