@universis/webdav
v1.1.0
Published
Universis Project WebDAV client library for content management.
Readme
@universis/webdav
@universis/webdav exports an alternative content service for Universis that allows you to use a WebDAV server as the storage backend for private content.
It provides a simple and efficient way to integrate WebDAV storage into Universis environments, enabling users to manage their private content using WebDAV protocol.
Installation
npm install @universis/webdavUsage
Register WebDAVContentService under services service section, overriding PrivateStorageService:
{
"serviceType": "./services/content-service#PrivateContentService",
"strategyType": "@universis/webdav#WebDAVContentService"
}Then, add the WebDAV configuration under settings/universis/webdav
{
"settings": {
"universis": {
"webdav": {
"url": "https://webdav.example.com/content/private/",
"username": "user",
"password": "pass"
}
}
}
}where url is the WebDAV server URL, username and password are the credentials to access the WebDAV server.
An example of enabling WebDAV protocol on nginx
nginx natively supports WebDAV protocol, so you can easily enable it by adding the following configuration to your nginx server block:
Add a location block for WebDAV, for example:
location /webdav {
alias /var/www/webdav;
client_body_temp_path /var/tmp/nginx/webdav;
dav_methods PUT DELETE MKCOL COPY MOVE;
create_full_put_path on;
# Enable basic authentication
auth_basic "Restricted Access";
auth_basic_user_file /etc/nginx/webdav.passwd;
# deny all access unless authenticated
satisfy all;
allow all; # This allows all authenticated users
deny all; # This denies all other users
}where /webdav is the URL path for WebDAV access, /var/www/webdav is the directory where the WebDAV files are stored, and /etc/nginx/webdav.passwd is the file containing the username and password for authentication.
/etc/nginx/webdav.passwd can be created using the htpasswd command:
htpasswd -c /etc/nginx/webdav.passwd userThis command will create a new password file and add a user with the specified username. You will be prompted to enter a password for the user.
License
This project is licensed under the GNU Lesser General Public License v3.0. See the LICENSE file for details.
