binhex / arch-rtorrentvpn

Docker build script for Arch Linux base with ruTorrent, rTorrent, autodl-irssi, Privoxy and OpenVPN
GNU General Public License v3.0
239 stars 36 forks source link

Permissions issues after moving container to new PC #196

Closed W3AXL closed 2 years ago

W3AXL commented 2 years ago

I recently transferred my torrents, config files, etc to a new PC. As far as I can tell all external folders I'm sharing with the container have the correct permissions for the PUID and PGID I'm specifying. However, I cannot add any torrents and the following is logged whenever the web UI starts:

[17.08.2022 21:06:37] WebUI started.
[17.08.2022 21:06:47] Webserver user doesn't have read/write/execute access to the torrents directory. You cannot add torrents via ruTorrent. (/usr/share/webapps/rutorrent/share/users/<user>/torrents)
[17.08.2022 21:06:47] rTorrent user must have read/execute access to the torrents directory. You cannot add torrents via ruTorrent. (/usr/share/webapps/rutorrent/share/users/<user>/torrents)

It appears that those are folders inside the container and are not being mapped externally, so I'm not sure how the permissions issue is occurring. This is on a freshly pulled image of the container.

Here's the startup script I'm using:

docker run -d \
    --restart unless-stopped \
    --sysctl="net.ipv4.conf.all.src_valid_mark=1" \
    --privileged=true \
    -p 7080:9080 \
    -p 7443:9443 \
    -p 8118:8118 \
    --name=tdrs-rt \
    -v /mnt/tdrs:/data \ (user/group 1001 has full RW access to these directories)
    -v /home/<user>/docker-seedbox/rtorrent/config:/config \
    -v /home/<user>/docker-seedbox/rtorrent/themes:/usr/share/webapps/rutorrent/plugins/theme/themes \
    -v /etc/localtime:/etc/localtime:ro \
    -e VPN_ENABLED=yes \
    -e VPN_PROV=custom \
    -e VPN_CLIENT=wireguard \
    -e STRICT_PORT_FORWARD=yes \
    -e ENABLE_PRIVOXY=no \
    -e ENABLE_AUTODL_IRSSI=no \
    -e ENABLE_RPC2=yes \
    -e ENABLE_RPC2_AUTH=yes \
    -e ENABLE_WEBUI_AUTH=yes \
    -e RPC2_USER=<user> \
    -e RPC2_PASS=<pass> \
    -e WEBUI_USER=<user> \
    -e WEBUI_PASS=<pass> \
    -e LAN_NETWORK=<network> \
    -e NAME_SERVERS=1.1.1.1,1.0.0.1 \
    -e PHP_TZ=America/Indiana/Indianapolis \
    -e UMASK=002 \
    -e PUID=1001 \ (a dedicated user for the container)
    -e PGID=1001 \ (a dedicated group for the container)
    binhex/arch-rtorrentvpn

I also tried removing the perms.txt file in the config folder to get the container to re-apply permissions, but that didn't work either. The issue remains. I've tried changing the user which runs the container from the dedicated user/group I created, to my personal user/group, with no change in results.

W3AXL commented 2 years ago

Further investigation reveals that there is no torrents folder in /usr/share/webapps/rutorrent/share/users/<user>/. The only folder there is settings.

W3AXL commented 2 years ago

PEBCAK on my part, that directory is indeed part of the shared config folder. The relative path was throwing me off. torrents folder was not properly copied over to new PC, and now all is well.