tchapi / davis

🗓 A simple, fully translatable admin interface for sabre/dav based on Symfony 5 and Bootstrap 5, initially inspired by Baïkal.
https://github.com/users/tchapi/projects/1/views/1
MIT License
397 stars 21 forks source link

[question] what is the webdav url using WEBDAV_HOMES_DIR ? #163

Closed tikr7 closed 3 months ago

tikr7 commented 3 months ago

First of all, thank you for this project! It makes the whole WebDAV administration so much easier and also scalable having multiple users!

My Davis instance is up and running, WebDAV is configured and now I would like to use the WEBDAV_HOMES_DIR feature to separate users data.

I set:

WEBDAV_TMP_DIR='/webdav/tmp'
WEBDAV_PUBLIC_DIR='/webdav/public'
WEBDAV_HOMES_DIR='/webdav/homes'

I created a user called "TestUser". After the login, in the UI I do find the public directory under: ip:port/dav/homes

But I cant find the home directory. Where is it? Maybe it is not visible? I thought it would be under: ip:port/dav/homes/TestUser

I am using version v4.4.3

Thanks in advance!

tchapi commented 3 months ago

Hi @tikr7

Maybe a naive question, but are the folder permissions correct? Have you tried to upload a file to see if it gets correctly created on the disk (it may be that the permissions are not correct, hence why the folder is not created)?

tikr7 commented 3 months ago

Hi @tchapi

permissions look good. I did a docker exec and was able to create folders and files under /webdav/homes with user www-data. I also dont see any errors in logs.

tchapi commented 3 months ago

Ok. And did you manage to do it via webdav? (either via the web UI of sabre/dav, or via a client)?

tikr7 commented 3 months ago

How can I use UI of sabre/dev to upload something? Under which port/path is it?

I did it with a WebDAV client and used the url :9000/dav/public/ which was successful =)

I also tried with:

:9000/dav/homes/ :9000/dav/homes/TestUser/ :9000/dav/homes/testuser/ which does not work. Under :9000/dav/ I see only the following folders: addressbooks calendars principals public no homes
tikr7 commented 3 months ago

I just started from scratch and by accident I made the configs in ../.env and not in ./env. Then it created :9000/dav/home/TestUser/ (home not homes) but the public folder was missing: :9000/dav/public/

The reason was, ./env (WEBDAV=false) overwrites ../.env. @tchapi WEBDAV=false + WEBDAV_HOMES_DIR='/webdav/homes' leads to a working webdav on home_dir level. Is it maybe a security issue? If somebody wants to deactivate public behavior, it should be done via: WEBDAV_PUBLIC_DIR=I assume.

I dont know why, but WEBDAV_HOMES_DIR='/webdav/homes' has no effect within ./env (I can't see the environment variable in the docker container) and only works in ../.env which solved my issue finally =)

@tchapi thank you for your help!

I hope my solution helps somebody else in the future.