sabre-io / Baikal

Baïkal is a Calendar+Contacts server
https://sabre.io/baikal/
GNU General Public License v3.0
2.53k stars 290 forks source link

WebDAV with Baikal? #1295

Open rafael-alcantara opened 3 weeks ago

rafael-alcantara commented 3 weeks ago

Baikal version: 0.9.5

Expected behaviour:
After installing Baikal, have it serving files over WebDAV (not only calendars over CalDAV and adressbooks over CardDAV). As Baikal uses sabre and sabre is a WebDAV server, I expected Baikal to offer this functionality.

Current behaviour:
I can connect and login to the Baikal server, but I cannot find a way to create a collection over WebDAV.
In my WebDAV client (Joplin for android) I get this error:

Last error: Error: MKCOL locks/: Permission denied to create directory (Exception Sabre\DAV\Exception\Forbidden)(403)

In the server (html/error_log) I get this:

[27-Oct-2024 11:32:09 Europe/London] Sabre\DAV\Exception\NotFound: File not found: info.json in 'root' in /xx/xx/xx/xx/vendor/sabre/dav/lib/DAV/SimpleCollection.php:97
Stack trace:
#0 /xx/xx/xx/xx/vendor/sabre/dav/lib/DAV/Tree.php(83): Sabre\DAV\SimpleCollection->getChild()
#1 /xx/xx/xx/xx/vendor/sabre/dav/lib/DAV/CorePlugin.php(76): Sabre\DAV\Tree->getNodeForPath()
#2 /xx/xx/xx/xx/vendor/sabre/event/lib/WildcardEmitterTrait.php(89): Sabre\DAV\CorePlugin->httpGet()
#3 /xx/xx/xx/xx/vendor/sabre/dav/lib/DAV/Server.php(472): Sabre\DAV\Server->emit()
#4 /xx/xx/xx/xx/vendor/sabre/dav/lib/DAV/Server.php(253): Sabre\DAV\Server->invokeMethod()
#5 /xx/xx/xx/xx/vendor/sabre/dav/lib/DAV/Server.php(321): Sabre\DAV\Server->start()
#6 /xx/xx/xx/xx/Core/Frameworks/Baikal/Core/Server.php(118): Sabre\DAV\Server->exec()
#7 /xx/xx/xx/xx/html/dav.php(69): Baikal\Core\Server->start()
#8 {main}
[27-Oct-2024 11:32:09 Europe/London] Sabre\DAV\Exception\NotFound: File not found: .sync in 'root' in /xx/xx/xx/xx/vendor/sabre/dav/lib/DAV/SimpleCollection.php:97
Stack trace:
#0 /xx/xx/xx/xx/vendor/sabre/dav/lib/DAV/Tree.php(83): Sabre\DAV\SimpleCollection->getChild()
#1 /xx/xx/xx/xx/vendor/sabre/dav/lib/DAV/CorePlugin.php(76): Sabre\DAV\Tree->getNodeForPath()
#2 /xx/xx/xx/xx/vendor/sabre/event/lib/WildcardEmitterTrait.php(89): Sabre\DAV\CorePlugin->httpGet()
#3 /xx/xx/xx/xx/vendor/sabre/dav/lib/DAV/Server.php(472): Sabre\DAV\Server->emit()
#4 /xx/xx/xx/xx/vendor/sabre/dav/lib/DAV/Server.php(253): Sabre\DAV\Server->invokeMethod()
#5 /xx/xx/xx/xx/vendor/sabre/dav/lib/DAV/Server.php(321): Sabre\DAV\Server->start()
#6 /xx/xx/xx/xx/Core/Frameworks/Baikal/Core/Server.php(118): Sabre\DAV\Server->exec()
#7 /xx/xx/xx/xx/html/dav.php(69): Baikal\Core\Server->start()
#8 {main}
[27-Oct-2024 11:32:09 Europe/London] Sabre\DAV\Exception\Forbidden: Permission denied to create directory in /xx/xx/xx/xx/vendor/sabre/dav/lib/DAV/Collection.php:104
Stack trace:
#0 /xx/xx/xx/xx/vendor/sabre/dav/lib/DAV/Server.php(1210): Sabre\DAV\Collection->createDirectory()
#1 /xx/xx/xx/xx/vendor/sabre/dav/lib/DAV/CorePlugin.php(560): Sabre\DAV\Server->createCollection()
#2 /xx/xx/xx/xx/vendor/sabre/event/lib/WildcardEmitterTrait.php(89): Sabre\DAV\CorePlugin->httpMkcol()
#3 /xx/xx/xx/xx/vendor/sabre/dav/lib/DAV/Server.php(472): Sabre\DAV\Server->emit()
#4 /xx/xx/xx/xx/vendor/sabre/dav/lib/DAV/Server.php(253): Sabre\DAV\Server->invokeMethod()
#5 /xx/xx/xx/xx/vendor/sabre/dav/lib/DAV/Server.php(321): Sabre\DAV\Server->start()
#6 /xx/xx/xx/xx/Core/Frameworks/Baikal/Core/Server.php(118): Sabre\DAV\Server->exec()
#7 /xx/xx/xx/xx/html/dav.php(69): Baikal\Core\Server->start()
#8 {main}

Steps to reproduce:

  1. Install Baikal from the distribution zip file (v0.9.5) and configure it to use sqlite and Apache or Basic authentication (Joplin does not seem to send digest headers and fails with Digest).
  2. Set directory Specifics (supposed to be closed, but it is the one containing data) completely open to anyone to read/write. (I did this after getting the error with a closed configuration, trying to rule this out).
  3. Create a user in Baikal. The user can access and use calendars and addressbooks using android apps, and also login using Baikal's web interface.
  4. Configure a profile in Joplin (mobile) to use baikal as the backing webdav server for notes, with the URL https://server/path/to/baikal/dir/html/dav.php/, user and password created in the previous step (the configuration check is successful).
  5. Try to synchronise the notes in the mobile.
  6. Get the errors.