Update README

This commit is contained in:
bohwaz 2022-10-21 19:22:37 +02:00
parent 806a194245
commit 234a058a92
4 changed files with 82 additions and 29 deletions

32
INSTALL.md Normal file
View file

@ -0,0 +1,32 @@
# Installing KaraDAV
0. Setup your server with PHP 8.0+, and don't forget `php-sqlite3` :)
1. Just download or clone this repo
2. Copy `config.dist.php` to `config.local.php`
3. Edit `config.local.php` to match your configuration
4. Create a virtual host (nginx, Apache, etc.) pointing to the `www` folder
5. Redirect all requests to `www/_router.php`
6. Go to your new virtual host and create your admin user
## Example Apache vhost
```
<VirtualHost *:80>
ServerName karadav.localhost
DocumentRoot /home/user/git/karadav/www
</VirtualHost>
<Directory /home/user/git/karadav/www>
Options -Indexes -Multiviews
AllowOverride None
DirectoryIndex index.php
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*$ /_router.php [L]
</Directory>
```
## Interaction with LDAP

View file

@ -1,10 +1,18 @@
KD2FW_URL=https://fossil.kd2.org/kd2fw/doc/tip/src/lib/KD2/
deps: js-deps php-deps
js-deps: js-deps:
wget -O www/webdav.js https://raw.githubusercontent.com/kd2org/webdav-manager.js/main/webdav.js wget -O www/webdav.js https://raw.githubusercontent.com/kd2org/webdav-manager.js/main/webdav.js
wget -O www/webdav.css https://raw.githubusercontent.com/kd2org/webdav-manager.js/main/webdav.css wget -O www/webdav.css https://raw.githubusercontent.com/kd2org/webdav-manager.js/main/webdav.css
php-deps: php-deps:
wget -O lib/KD2/WebDAV.php 'https://fossil.kd2.org/kd2fw/doc/tip/src/lib/KD2/WebDAV.php' wget -O lib/KD2/ErrorManager.php '${KD2FW_URL}ErrorManager.php'
wget -O lib/KD2/WebDAV_NextCloud.php 'https://fossil.kd2.org/kd2fw/doc/tip/src/lib/KD2/WebDAV_NextCloud.php' wget -O lib/KD2/WebDAV/Server.php '${KD2FW_URL}WebDAV/Server.php'
wget -O lib/KD2/WebDAV/AbstractStorage.php '${KD2FW_URL}WebDAV/AbstractStorage.php'
wget -O lib/KD2/WebDAV/FileStorage.php '${KD2FW_URL}WebDAV/FileStorage.php'
wget -O lib/KD2/WebDAV/NextCloud.php '${KD2FW_URL}WebDAV/NextCloud.php'
wget -O lib/KD2/WebDAV/WOPI.php '${KD2FW_URL}WebDAV/WOPI.php'
server: server:
php -S 0.0.0.0:8080 -t www www/_router.php php -S 0.0.0.0:8080 -t www www/_router.php

View file

@ -1,12 +1,10 @@
# Implement a server compatible with NextCloud desktop and mobile apps # Implement a server compatible with NextCloud desktop and mobile apps
FileRun Here are some random docs and thoughts on implementing a NextCloud-compatible WebDAV server.
https://docs.nextcloud.com/server/19/developer_manual/client_apis/OCS/ocs-api-overview.html?highlight=capabilities See also:
https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-status-api.html * [NextCloud WebDAV API](https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/index.html)
https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/index.html * [Capabilities](https://docs.nextcloud.com/server/19/developer_manual/client_apis/OCS/ocs-api-overview.html?highlight=capabilities)
The desktop client is the most annoying
## Two different login flows ## Two different login flows

View file

@ -1,32 +1,45 @@
# KaraDAV - A lightweight WebDAV server, with NextCloud compatibility # KaraDAV - A lightweight WebDAV server, with NextCloud compatibility
This is WebDAV server, allowing to easily set up a WebDAV file sharing server compatible with NextCloud clients with no depencies and high performance. This is simple and lighweight WebDAV server, allowing to easily set up a file sharing server compatible with WebDAV and NextCloud clients. It has no depencies and good performance.
The only dependency is SQLite3 for the database. It is written in PHP (8+) The only dependency is SQLite3 for the database.
Although this is a demo, this can be used as a simple but powerful file sharing server. Its original purpose was to serve as a demo and test for the KD2 WebDAV library, which we developed for [Paheko](http://paheko.cloud/), our non-profit management solution, but it can also be used as a simple but powerful file sharing server.
This server features: ## Features
* User-friendly directory listings for file browsing with a web browser, using [WebDAV Manager.js](https://github.com/kd2org/webdav-manager.js) * User-friendly directory listings for file browsing with a web browser, using our [WebDAV Manager.js](https://github.com/kd2org/webdav-manager.js) client
* Upload directly from browser, using paste, or drag and drop * Upload directly from browser, using paste or drag and drop
* Rename * Rename
* Delete * Delete
* Create and edit text file * Create and edit text files
* Create directories
* MarkDown live preview * MarkDown live preview
* Preview of images, text, MarkDown and PDF * Preview of images, text, MarkDown and PDF
* Editing of Office files using Collabora or OnlyOffice
* WebDAV class 1, 2, 3 support, support for Etags * WebDAV class 1, 2, 3 support, support for Etags
* No database is required * No database sever is required
* Multiple user accounts * Multiple user accounts
* Share files for users using WebDAV: delete, create, update, mkdir, get, list * Share files using WebDAV: delete, create, update, mkdir, get, list
* Compatible with WebDAV clients * Compatible with WebDAV clients
* Support for HTTP ranges (partial download) * Support for HTTP ranges (partial download of files)
* Support for [RFC 3230](https://greenbytes.de/tech/webdav/rfc3230.xhtml) to get the MD5 digest hash of a file (to check integrity) on `HEAD` requests (only MD5 is supported so far) * Support for [RFC 3230](https://greenbytes.de/tech/webdav/rfc3230.xhtml) to get the MD5 digest hash of a file (to check integrity) on `HEAD` requests (only MD5 is supported so far)
* Support for `Content-MD5` with `PUT` requests, see [dCache documentation for details](https://dcache.org/old/manuals/UserGuide-6.0/webdav.shtml#checksums) * Support for `Content-MD5` with `PUT` requests, see [dCache documentation for details](https://dcache.org/old/manuals/UserGuide-6.0/webdav.shtml#checksums)
* Support for some of the [Microsoft proprietary properties](https://greenbytes.de/tech/webdav/webdavfaq.html) * Support for some of the [Microsoft proprietary properties](https://greenbytes.de/tech/webdav/webdavfaq.html)
* Passes most of the [Litmus compliance tests](https://github.com/tolsen/litmus) * Passes most of the [Litmus compliance tests](https://github.com/tolsen/litmus) (see below)
* Supports WOPI, for editing and viewing of documents using OnlyOffice, Collabora Online or MS Office. * Supports WOPI, for editing and viewing of documents using OnlyOffice, Collabora Online or MS Office.
### NextCloud/ownCloud features
The following ownCloud/NextCloud specific features are supported:
* [Direct download](https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-api-overview.html#direct-download)
* [Chunk upload](https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/chunking.html)
* `X-OC-MTime` [header](https://gitlab.gnome.org/GNOME/gvfs/-/issues/637) to set file modification time
* Login via app-specific passwords (necessary for NextCloud desktop and Android clients)
* Thumbnail/preview of images and files
* Workspace notes (`README.md` displayed on top of directory listing on Android app) and workspace notes editing
## NextCloud/ownCloud compatibility ## NextCloud/ownCloud compatibility
This server should be compatible with ownCloud and NextCloud synchronization clients (desktop, mobile, CLI). This server should be compatible with ownCloud and NextCloud synchronization clients (desktop, mobile, CLI).
@ -39,14 +52,7 @@ It has been tested with:
* ownCloud Android app 2.21.2 (F-Droid) * ownCloud Android app 2.21.2 (F-Droid)
* [NextCloud CLI client](https://docs.nextcloud.com/desktop/3.5/advancedusage.html) 3.1.1 (Debian) *-- Note: make sure to pass options before parameters.* * [NextCloud CLI client](https://docs.nextcloud.com/desktop/3.5/advancedusage.html) 3.1.1 (Debian) *-- Note: make sure to pass options before parameters.*
The following NextCloud specific features are supported: Note that even though it has been tested with NC/OC clients, KaraDAV might stop working at any time with these clients.
* [Direct download](https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-api-overview.html#direct-download)
* [Chunk upload](https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/chunking.html)
* `X-OC-MTime` [header](https://gitlab.gnome.org/GNOME/gvfs/-/issues/637) to set file modification time
* Login via app-specific passwords (necessary for NextCloud desktop and Android clients)
* Thumbnail/preview of images and files
* Workspace notes (`README.md` displayed on top of directory listing on Android app) and workspace notes editing
## WebDAV clients compatibility ## WebDAV clients compatibility
@ -57,6 +63,7 @@ The following NextCloud specific features are supported:
## WOPI clients compatibility ## WOPI clients compatibility
* Tested successfully with Collabora Development Edition (see [COLLABORA.md](COLLABORA.md)) * Tested successfully with Collabora Development Edition (see [COLLABORA.md](COLLABORA.md))
## Future development ## Future development
This might get supported in future (maybe): This might get supported in future (maybe):
@ -65,7 +72,7 @@ This might get supported in future (maybe):
* [NextCloud sharing](https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-share-api.html) (maybe?) * [NextCloud sharing](https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-share-api.html) (maybe?)
* [Partial upload via PATCH](https://github.com/miquels/webdav-handler-rs/blob/master/doc/SABREDAV-partialupdate.md) * [Partial upload via PATCH](https://github.com/miquels/webdav-handler-rs/blob/master/doc/SABREDAV-partialupdate.md)
* [Resumable upload via TUS](https://tus.io/protocols/resumable-upload.html) * [Resumable upload via TUS](https://tus.io/protocols/resumable-upload.html)
* [WebDAV sharing](https://evertpot.com/webdav-caldav-carddav-sharing/) * [WebDAV sharing if it ever becomes a spec?](https://evertpot.com/webdav-caldav-carddav-sharing/)
This probably won't get supported anytime soon: This probably won't get supported anytime soon:
@ -82,10 +89,17 @@ This depends on the KD2\WebDAV and KD2\WebDAV_NextCloud classes from the [KD2FW
They are lightweight and easy to use in your own software to add support for WebDAV and NextCloud clients to your software. They are lightweight and easy to use in your own software to add support for WebDAV and NextCloud clients to your software.
## Similar software
* [Davros](https://github.com/mnutt/davros/) used to be compatible with NextCloud client [before version 2.5.0](https://github.com/owncloud/client/issues/6775)
* [FileRun](https://filerun.com) is a proprietary solution compatible with the NextCloud Android app
## Litmus compliance tests ## Litmus compliance tests
Tests were performed using litmus source code as of December 13, 2017 from [the Github repo](https://github.com/tolsen/litmus). Tests were performed using litmus source code as of December 13, 2017 from [the Github repo](https://github.com/tolsen/litmus).
We are not aiming at 100% pass, as we are mainly targeting file sharing, so we are not currently trying to fix rare `PROPPATCH` issues, but pull requests are welcome.
``` ```
-> running `http': -> running `http':
0. init.................. pass 0. init.................. pass
@ -223,7 +237,8 @@ But they mostly pass with litmus 0.13-3 supplied by Debian:
40. finish................ pass 40. finish................ pass
<- summary for `locks': of 41 tests run: 38 passed, 3 failed. 92.7% <- summary for `locks': of 41 tests run: 38 passed, 3 failed. 92.7%
-> 2 warnings were issued. -> 2 warnings were issued.
```` ```
## Author ## Author
BohwaZ. Contact me on: IRC = bohwaz@irc.libera.chat / Mastodon = https://mamot.fr/@bohwaz / Twitter = @bohwaz BohwaZ. Contact me on: IRC = bohwaz@irc.libera.chat / Mastodon = https://mamot.fr/@bohwaz / Twitter = @bohwaz