webdav support
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-03-30 22:27:44 +02:00
parent dcb8ec0f1e
commit 875b475295
6 changed files with 166 additions and 3 deletions

View File

@@ -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