Files
paspo 2da562ffcb
All checks were successful
Container Publish / on-success-skip (push) Has been skipped
Container Publish / build-image (arm64) (push) Successful in 20s
Container Publish / build-image (amd64) (push) Successful in 3m21s
Container Publish / update docker manifest (push) Successful in 53s
fix #5: added DISABLE_WEBDAV flag
2025-07-31 20:16:35 +02:00

34 lines
764 B
Bash
Executable File

#!/bin/sh
if [ ${DISABLE_WEBDAV} -eq 1 ] ; then
exit 0
fi
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}"