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