linkding
linkding copied to clipboard
Allow setting UID and GID
A lot of docker images support mapping the user in the container that writes files, to a user that owns the volumes mounted into the container. This to prevent permission issues. See linuxserver.io or navidrome.
Now I've noticed that by default linkding writes to /etc/linkding/data with UID and GID 33 (www-data if I'm not mistaken?). Whereas the user I want to map it to is UID 1000 and GID 1000. However, when I set the user for linkding with user: 1000:1000 (see docs), it seems that linkding runs into some issues. From the logs:
linkding | chown: changing ownership of '/etc/linkding/data/tasks.sqlite3': Operation not permitted
linkding | chown: changing ownership of '/etc/linkding/data/secretkey.txt': Operation not permitted
linkding | chown: changing ownership of '/etc/linkding/data/assets': Operation not permitted
linkding | chown: changing ownership of '/etc/linkding/data/favicons': Operation not permitted
linkding | chown: changing ownership of '/etc/linkding/data/previews': Operation not permitted
linkding | chown: changing ownership of '/etc/linkding/data/db.sqlite3': Operation not permitted
linkding | chown: changing ownership of '/etc/linkding/data': Operation not permitted
linkding | Error: Can't drop privilege as nonroot user
That makes sense, because now the user in the container is not a superuser. But, this does prevent me from being able to map files created in /etc/linkding/data to the user I would like it to use on the host. It would be nice if you could allow that somehow.
Actually this seems like a duplicate of https://github.com/sissbruecker/linkding/issues/623 and https://github.com/sissbruecker/linkding/issues/834
Let's keep the discussion in https://github.com/sissbruecker/linkding/issues/623