This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
WEBROOT=/data/www
|
||||
WEBDAV_PORT=${WEBDAV_PORT:-8080}
|
||||
PHP=${PHP:-none}
|
||||
USERNAME=${USERNAME:-theuser}
|
||||
PUID=${PUID:-1000}
|
||||
@@ -70,5 +71,32 @@ fi
|
||||
chmod 0700 "${WEBROOT}/.ssh"
|
||||
/usr/sbin/sshd -e
|
||||
|
||||
cat > /etc/nginx/conf.d/user.conf <<EOF
|
||||
user ${USERNAME} ${GROUPNAME};
|
||||
EOF
|
||||
|
||||
cat > /etc/nginx/http.d/webdav.conf <<EOF
|
||||
server {
|
||||
listen ${WEBDAV_PORT} default_server;
|
||||
listen [::]:${WEBDAV_PORT} default_server;
|
||||
root ${WEBROOT};
|
||||
|
||||
location / {
|
||||
autoindex on;
|
||||
autoindex_exact_size off;
|
||||
autoindex_localtime on;
|
||||
dav_methods PUT DELETE MKCOL COPY MOVE;
|
||||
dav_ext_methods PROPFIND OPTIONS;
|
||||
create_full_put_path on;
|
||||
dav_access user:rw;
|
||||
}
|
||||
|
||||
auth_basic "Restricted area";
|
||||
auth_basic_user_file /app/htpasswd;
|
||||
}
|
||||
EOF
|
||||
|
||||
touch /app/htpasswd
|
||||
|
||||
# start nginx
|
||||
nginx
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# /etc/nginx/nginx.conf
|
||||
|
||||
user nginx;
|
||||
# user nginx;
|
||||
|
||||
# Set number of worker processes automatically based on number of CPU cores.
|
||||
worker_processes auto;
|
||||
|
||||
Reference in New Issue
Block a user