moved config steps into separate scripts
All checks were successful
All checks were successful
This commit is contained in:
29
rootfs/app/entrypoint.sh.d/90_webdav.sh
Executable file
29
rootfs/app/entrypoint.sh.d/90_webdav.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "# Configuring webdav"
|
||||
|
||||
cat > /etc/nginx/http.d/webdav.conf <<EOF
|
||||
server {
|
||||
listen ${WEBDAV_PORT} default_server;
|
||||
listen [::]:${WEBDAV_PORT} default_server;
|
||||
root ${PATH_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 ${PATH_AUTH}/webdav;
|
||||
}
|
||||
EOF
|
||||
|
||||
# authentication
|
||||
mkdir -p "${PATH_AUTH}"
|
||||
touch "${PATH_AUTH}/webdav"
|
||||
chown -R "${USERNAME}:${GROUPNAME}" "${PATH_AUTH}"
|
||||
Reference in New Issue
Block a user