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] : Permissions & Storage #169

Closed 1bl4z3r closed 1 month ago

1bl4z3r commented 1 month ago

Hi again,

I closed previous issue (#168) to not contaminate it. In this I would like to ask few questions and get clarifications. Please take your time to answer.

  1. I see that sqlite db is owned by root, is this an edge case, or is this a bug? I had to chown to www-data every time when rebooting the container.
e2867635f3e058:/data# ls -la
total 144
drwxr-xr-x    3 root     root          4096 Sep 11 12:22 .
drwxr-xr-x    1 root     root          4096 Sep 11 12:22 ..
-rw-r--r--    1 root     root        122880 Sep 11 12:22 davis-database.db

e2867635f3e058:/var/www/davis/var/log# chown -R www-data:www-data /data

e2867635f3e058:/var/www/davis/var/log# ls -la /data
total 144
drwxr-xr-x    3 www-data www-data      4096 Sep 11 12:22 .
drwxr-xr-x    1 root     root          4096 Sep 11 12:22 ..
-rw-r--r--    1 www-data www-data    122880 Sep 11 12:22 davis-database.db
  1. Can WEBDAV_PUBLIC_DIR be in same location as database (e.g. /data)? If yes or no, what should be the folder structure for WEBDAV_PUBLIC_DIR and what should be the folder permissions/ownership?

Thanks

tchapi commented 1 month ago
  1. Yes, you need to chown: there is a specific section about this in the readme (orange warning about SQLite). This could probably be improved but when I added support for SQLite, it was barely used.

  2. Can WEBDAV_PUBLIC_DIR be in same location as database (e.g. /data)?

    I don't see why not — I would try and see if it works correctly for your use case

    what should be the folder structure for WEBDAV_PUBLIC_DIR

    You don't need any specific structure. The permissions should allow the web app to read/write so www-data:www-data is generally working, but I've seen many different ways so I haven't added much details here (as various users' envs give sometimes various different solutions)

1bl4z3r commented 1 month ago

Hi again.

Sorry for being fashionably late. As I found WEBDAV_PUBLIC_DIR path should exist before spinning up the container, else it throws errors that path is not found.

Ideally if path is not present, the container should make one. Ease of use, I guess. I am closing this Issue as (for now) fix is to create the path beforehand

PS. I haven't forgot to submit PR for containers, but I am really hamstrung right now.