crazy-max / docker-rtorrent-rutorrent

rTorrent and ruTorrent Docker image
MIT License
483 stars 107 forks source link

Wrong permission on new folders #78

Closed the-lazy-fox closed 3 years ago

the-lazy-fox commented 3 years ago

Behaviour

Steps to reproduce this issue

Try to create a new folder through volume mount for several purpose (watch folder for autotools, post downloads scripts, ...)

Expected behaviour

The folder should be accessible from inside the container

Actual behaviour

The folder is not accessible because the permission remains the one from the user running the container and not the user inside the container. I didn't had this issue with the lsio's one or even this one in the past

Configuration

Logs

image

the-lazy-fox commented 3 years ago

Same behavior if I mount it as a sub folder of the default "data" folder...

lilws commented 3 years ago

It is very strict in create folder inside container. FYI, there is already watch folder in /data/rtorrent/watch. Because of these things I found that create any folder inside /downloads will works better. Otherwise you will need to edit /etc/cont-init.d/03-config.sh inside the container for granting permission at each start which is not recommended since it is shell script that make the container works.

the-lazy-fox commented 3 years ago

Thanks for your contribution. The existing watchfolder is the one used by rtorrent which doesn’t support recursive detection like rutorrent autotools does. To avoid confusion, I would like to use another one like in the Linuxserver former image. In addition, my request is going above watch folder, the same purpose could be used for post download scripts for example. rtorrent is design for that and there is no place for such scripts in this image. For all that reasons, I made a PR to make the chown, on the data folder, recursive to ensure the container can interact with everything which is inside. Best

lilws commented 3 years ago

when first use this image, there is intructions to chown these folder:

chown ${PUID}:${PGID} data downloads passwd

you might want to do the same with your own folder if it is not inside those folder I think.

crazy-max commented 3 years ago

@the-lazy-fox

The folder is not accessible because the permission remains the one from the user running the container and not the user inside the container.

That's the purpose of a rootless image using specific a PUID/PGID. Also it's clearly specified in the README:

Note that the volumes should be owned by the user/group with the specified PUID and PGID. If you don't give the volumes correct permissions, the container may not start.

I therefore suggest that you adapt the PUID/PGID.