[Support] binhex - rTorrentVPN


Recommended Posts

Here you go. I changed the extension to txt because of upload restrictions and removed the username and password in lines 47 and 50.

 

thanks for that, it def is permissions on the log that is causing issues, the thing thats frying my brain is that i do a chown and chmod on that folder, AND the fact it works without a hitch on my two test boxes. im thinking its related in some way to the user and group your specifying, so im going to dig into that a bit more, i will report back hopefully by the end of today.

Link to comment

Here you go. I changed the extension to txt because of upload restrictions and removed the username and password in lines 47 and 50.

 

thanks for that, it def is permissions on the log that is causing issues, the thing thats frying my brain is that i do a chown and chmod on that folder, AND the fact it works without a hitch on my two test boxes. im thinking its related in some way to the user and group your specifying, so im going to dig into that a bit more, i will report back hopefully by the end of today.

 

so ive just created an account on my unraid host, issued the id command to find out uid and gid and issued a docker run command with these values to make sure these are passed correctly, which indeed they do, and the webui is accessible and the tunnel is up, so not sure whats going on here.

 

ok so just incase ive missed anything, can you please repost your latest docker run command (minus username and password), also can you confirm the uid and gid your specifying do indeed exist on the host, im assuming your issuing a "id <username>" in order to get the correct values yes?.

 

one thing you can also try is set the puid and guid to "0", this should then run as root/root and see if it wll start

Link to comment

I'm pretty sure permissions are good on my end:

 

 ? root@nas ? ~ ? id rtorrent
uid=1005(rtorrent) gid=100(users) groups=100(users),1000(dockeruser)

 

? root@nas ? ~ ? docker run -d \
    --privileged=true \
    -p 9080:9080 \
    -p 9443:9443 \
    -p 8118:8118 \
    --name=rtorrent \
    -v /docker/rutorrent/data:/data \
    -v /docker/rutorrent/config:/config \
    -v /etc/localtime:/etc/localtime:ro \
    -e VPN_ENABLED=yes \
    -e VPN_USER=(removed) \
    -e VPN_PASS=(removed) \
    -e VPN_REMOTE=ca-toronto.privateinternetaccess.com \
    -e VPN_PORT=1194 \
    -e VPN_PROTOCOL=udp \
    -e VPN_PROV=pia \
    -e ENABLE_PRIVOXY=no \
    -e LAN_NETWORK=10.1.3.0/24 \
    -e DEBUG=false \
    -e PUID=1005 \
    -e PGID=1000 \
    binhex/arch-rtorrentvpn

 

 ? root@nas ? /docker/rutorrent ? l
total 16K
drwxrwxr-x 4 rtorrent dockeruser 4.0K Apr  5 17:54 .
drwxrwxr-x 3 rtorrent dockeruser 4.0K Apr  1 13:10 ..
drwxrwxr-x 6 rtorrent dockeruser 4.0K Apr  5 18:23 config
drwxrwxr-x 4 rtorrent dockeruser 4.0K Apr  6 14:52 data

Link to comment

I'm pretty sure permissions are good on my end:

 

 ? root@nas ? ~ ? id rtorrent
uid=1005(rtorrent) gid=100(users) groups=100(users),1000(dockeruser)

 

? root@nas ? ~ ? docker run -d \
    --privileged=true \
    -p 9080:9080 \
    -p 9443:9443 \
    -p 8118:8118 \
    --name=rtorrent \
    -v /docker/rutorrent/data:/data \
    -v /docker/rutorrent/config:/config \
    -v /etc/localtime:/etc/localtime:ro \
    -e VPN_ENABLED=yes \
    -e VPN_USER=(removed) \
    -e VPN_PASS=(removed) \
    -e VPN_REMOTE=ca-toronto.privateinternetaccess.com \
    -e VPN_PORT=1194 \
    -e VPN_PROTOCOL=udp \
    -e VPN_PROV=pia \
    -e ENABLE_PRIVOXY=no \
    -e LAN_NETWORK=10.1.3.0/24 \
    -e DEBUG=false \
    -e PUID=1005 \
    -e PGID=1000 \
    binhex/arch-rtorrentvpn

 

 ? root@nas ? /docker/rutorrent ? l
total 16K
drwxrwxr-x 4 rtorrent dockeruser 4.0K Apr  5 17:54 .
drwxrwxr-x 3 rtorrent dockeruser 4.0K Apr  1 13:10 ..
drwxrwxr-x 6 rtorrent dockeruser 4.0K Apr  5 18:23 config
drwxrwxr-x 4 rtorrent dockeruser 4.0K Apr  6 14:52 data

 

well the permissions issue the log is reporting is to do with permissions INSIDE the docker container, so what we really need to do is to perform an ls -al on /var/log/nginx for the running container, can you give the following a go:-

 

docker exec -it rtorrent /bin/bash -c "ls -al /var/log/nginx"

 

it will be interesting to see what the permissions are for the above. you may need to restart the container and issue this command fairly quickly before the container gets shut down, although i think supervisor should keep the container active so i think you probably will be ok.

Link to comment

Ahhh, I really want so switch. To bad sonarr can not remove torrents after they have finished seeding if you use rTorrent  :(

 

Well, nothing to do about it, I just stick to deluge.

 

Good job on the docker binhex!  ;)

 

just revisiting this comment, this is possible actually, all you need to do is configure your ratio group correctly and then use the "ratio rules" plugin to say any url with a period in its name (i.e. everything) use the defined ratio group below, and voila you can have it seed for as long or as short (as in dont seed) as you want.

Link to comment

? root@nas ? ~ ? docker exec -it rtorrent /bin/bash -c "ls -al /var/log/nginx"
total 8
drwxrwxr-x 2 nobody users 4096 Jan 26 12:22 .
drwxr-xr-x 8 root   root  4096 Apr  7 11:21 ..

 

No file ever shows up, are you mapping the PGID to 'users'?

Link to comment

ok thats not a problem there arent any files, i wasnt really expecting any, as its failing to write to the folder, looking at the output though it looks like the chown isnt working:-

 

drwxrwxr-x 2 nobody users 4096 Jan 26 12:22 .

 

so its still set to user nobody, group users, so lets issue the chown again manually and see what we get, so do the following:-

 

docker exec -it rtorrent /bin/bash -c "chown -R 1005:1000 /var/log/nginx/"  

 

then re-issue the ls -al again to see if anything has changed:-

 

docker exec -it rtorrent /bin/bash -c "ls -al /var/log/nginx"

 

and post the output.

Link to comment

It doesn't seem to do anything, I even tried it running it separately inside the container:

 

[root@fd072eedb8b3 /]# chown -R 1005:1000 /var/log/nginx/
[root@fd072eedb8b3 /]# ls -la /var/log/nginx/
total 8
drwxrwxr-x 2 nobody users 4096 Jan 26 12:22 .
drwxr-xr-x 8 root   root  4096 Apr  7 11:54 ..

Link to comment

It doesn't seem to do anything, I even tried it running it separately inside the container:

 

[root@fd072eedb8b3 /]# chown -R 1005:1000 /var/log/nginx/
[root@fd072eedb8b3 /]# ls -la /var/log/nginx/
total 8
drwxrwxr-x 2 nobody users 4096 Jan 26 12:22 .
drwxr-xr-x 8 root   root  4096 Apr  7 11:54 ..

 

actually thats probably ok, because i change the uid and gid for user nobody, group users, so the permissions will still show up as nobody/users,

 

ok lets try creating a file and see what happens:-

 

docker exec -it binhex-rtorrentvpn /bin/bash -c "su -c 'touch /var/log/nginx/test.log' - nobody"

 

then lets double check that user nobody has the correct uid:-

 

docker exec -it binhex-rtorrentvpn /bin/bash -c "id nobody"

 

and finally lets see if it created the test.log file:-

 

docker exec -it rtorrent /bin/bash -c "ls -al /var/log/nginx"

 

if you can give me output for all the above it should give us a clue as to whats going on.

Link to comment

 ? root@nas ? ~ ? docker exec -it rtorrent /bin/bash -c "su -c 'touch /var/log/nginx/test.log' - nobody"
touch: cannot touch '/var/log/nginx/test.log': Permission denied

 

 ? root@nas ? ~ ? docker exec -it rtorrent /bin/bash -c "id nobody"
uid=1005(nobody) gid=1000(users) groups=1000(users),99(nobody)

 

 ? root@nas ? ~ ? docker exec -it rtorrent /bin/bash -c "ls -al /var/log/nginx"
total 8
drwxrwxr-x 2 nobody users 4096 Jan 26 12:22 .
drwxr-xr-x 8 root   root  4096 Apr  7 11:54 ..

Link to comment

 ? root@nas ? ~ ? docker exec -it rtorrent /bin/bash -c "su -c 'touch /var/log/nginx/test.log' - nobody"
touch: cannot touch '/var/log/nginx/test.log': Permission denied

 

 ? root@nas ? ~ ? docker exec -it rtorrent /bin/bash -c "id nobody"
uid=1005(nobody) gid=1000(users) groups=1000(users),99(nobody)

 

 ? root@nas ? ~ ? docker exec -it rtorrent /bin/bash -c "ls -al /var/log/nginx"
total 8
drwxrwxr-x 2 nobody users 4096 Jan 26 12:22 .
drwxr-xr-x 8 root   root  4096 Apr  7 11:54 ..

 

hm, ok so the user cant write to the folder but the folder is owned by the correct user and group and the uid and gid is set correctly too, im kinda stumped for now. one last thing i want to rule out is the slash at the end of the path for the chown and also try using the name not the uid and gid, can you try this:-

 

docker exec -it rtorrent /bin/bash -c "chown -R nobody:users /var/log/nginx"

 

and then try again to issue the touch:-

 

docker exec -it binhex-rtorrentvpn /bin/bash -c "su -c 'touch /var/log/nginx/test.log' - nobody"

Link to comment

 ? root@nas ? ~ ? docker exec -it rtorrent /bin/bash -c "chown -R nobody:users /var/log/nginx"
? root@nas ? ~ ?
? root@nas ? ~ ?
? root@nas ? ~ ?
? root@nas ? ~ ? docker exec -it rtorrent /bin/bash -c "su -c 'touch /var/log/nginx/test.log' - nobody"
touch: cannot touch '/var/log/nginx/test.log': Permission denied

 

no dice

Link to comment

 ? root@nas ? ~ ? docker exec -it rtorrent /bin/bash -c "chown -R nobody:users /var/log/nginx"
? root@nas ? ~ ?
? root@nas ? ~ ?
? root@nas ? ~ ?
? root@nas ? ~ ? docker exec -it rtorrent /bin/bash -c "su -c 'touch /var/log/nginx/test.log' - nobody"
touch: cannot touch '/var/log/nginx/test.log': Permission denied

 

no dice

 

ok grasping at straws now, i see your command prompt looks a little unusual, it looks like your using user root but it doesnt look to be a superuser, normally denoted by hash symbol in the command prompt, do you know if the user your issuing the docker run commands with is a superuser or not?.

 

also if you do have sudo on your host can you try issuing the command again prefixed with sudo.

Link to comment

It's my powerline font for zsh, it doesn't copy and paste well into the forum. It shouldn't matter since inside the container we're running bash.

 

we are running bash inside the docker, this is true but if the docker daemon isnt running with superuser privileges then you may not be able to do certain actions inside the container, it is a bit odd and like i say it is a grasping of straws, but i really have come to end of any meaningful tests i can run.

 

2016-04-04 19:59:19,055 DEBG 'webui-script' stderr output:
2016/04/04 19:59:19 [emerg] 671#0: open() "/var/log/nginx/access.log" failed (13: Permission denied)

 

@anybody - does anyone else see the issue above?, i certainly cannot replicate it at present on unraid 6.1.9

 

one thing im going to do tomorrow is fire up a ubuntu vm and create an account, and then run the docker container as that user and see what happens. If this works ok and then it must be some quirkiness with the way docker is running on OMV, if possible can you try running this again on unraid 6.2, i know you did this previously but i would assume it now works ok on this platform.

Link to comment

Hi binhex,

 

Thanks for more great work.

 

I am just giving this a try, I was using rtorrent\rutorrent on a custom machine before I moved to unRAID, I am currently using delugeVPN but I like the idea of going back to rtorrent if it includes your lovely VPN build. There are a few plugins I am missing since going to deluge.

 

Just a couple of small things.

 

1. The diskspace plugin - By default this looks at $topDirectory variable as defined in the config.php, this is currently set to "/" so we are seeing the space free in the docker image file. I think it would be better defined as "/data/" or whatever your download folder is. Since the system config.php is located in /etc/webapps/rutorrent/conf/ I thought it best not to change that, and to try and set it in the user settings, I created a config.php in my user file, but it does seem to effect the plugin. Any advice? I first only had the topDirectory variable defined, but I also tried copying the current global config.php and just changing that line, neither worked. I placed the file in /mnt/cache/appdata/rTorrent/rutorrent/share/users/username/ and also the settings folder under that. Still no effect.

 

Update: a little reading in the docs, it states that you can only have differences to the main config.php in user config.php, so that may be my issue. I have attached to the docker, but no vi or nano, how can I edit the global config file inside the docker?

 

2. Reverse Proxy, I did this in a similar fashion to deluge, with the following lines in my apache reverse proxy.

    <Location /rutorrent>

        RequestHeader append X-Deluge-Base "/rutorrent/"

        ProxyPass https://192.168.0.250:9443

        ProxyPassReverse https://192.168.0.250:9443

    </Location>

 

This works fine, but just wondering if it would be better to modify the base url of this docker to include /rutorrent/, and is it possible to do that via a user variable, or would I have to modify the nginx.conf file, I did change the location / to location /rutorrent but it reverted back when I restarted the docker.

 

Thanks,

Wob

 

Link to comment

Just playing a little more, has anyone been able to get sickrage to talk to rtorrent? I have the same settings in couchpotato and it is working, but sickrage gives me "Error: Unable to connect to rTorrent". I would rather not go back to blackhole if I can avoid it.

 

Thanks,

Wob

Link to comment

hi wob76, replies as follows:-

The diskspace plugin - By default this looks at $topDirectory variable as defined in the config.php, this is currently set to "/" so we are seeing the space free in the docker image file. I think it would be better defined as "/data/"

 

i agree this is looking at the wrong place, i can alter this during the build of the image.

 

...would I have to modify the nginx.conf file, I did change the location / to location /rutorrent but it reverted back when I restarted the docker.

 

ok so i originally was specifying the connection to php-fpm via a unix socket, i later found out this causes issues with some people running docker on later versions, i switched to the higher performance and less clunky version of tcp/ip connection. the issue is because this info is stored in the nginx config file which is copied to /config for persistence i loose control over making this change, so for the last version i put in a temporary hack to force the overwrite of this file, with the idea that after a period of time i can remove this hack as hopefully most/all people will of upgraded and thus be using the newer tcp/ip connection. so in short thats why your seeing it revert back, if you want to make your change persistent then do the following:-

 

docker exec inside the container (i see you know how to do this already), then install a text editor, i like nano, but yeah whatever you want:-

 

pacman -S nano

 

once installed then edit the bash script which does the copying and soft linking:-

 

nano /home/nobody/webui.sh

 

look for the following line, and comment the next line below it:-

 

# force overwrite for now, changed from socket to tcp/ip for php-fpm - remove later

 

exit the container, make your change to your nginx config file and restart the container, the change should now stick.

 

as anyone been able to get sickrage to talk to rtorrent?

 

yep, i have :-), see screenshot below for how to configure sickrage to rtorrent:-

 

https://raw.githubusercontent.com/binhex/docker-templates/master/binhex/screenshots/sickrage-rtorrent.png

Link to comment

It's my powerline font for zsh, it doesn't copy and paste well into the forum. It shouldn't matter since inside the container we're running bash.

 

we are running bash inside the docker, this is true but if the docker daemon isnt running with superuser privileges then you may not be able to do certain actions inside the container, it is a bit odd and like i say it is a grasping of straws, but i really have come to end of any meaningful tests i can run.

 

2016-04-04 19:59:19,055 DEBG 'webui-script' stderr output:
2016/04/04 19:59:19 [emerg] 671#0: open() "/var/log/nginx/access.log" failed (13: Permission denied)

 

@anybody - does anyone else see the issue above?, i certainly cannot replicate it at present on unraid 6.1.9

 

one thing im going to do tomorrow is fire up a ubuntu vm and create an account, and then run the docker container as that user and see what happens. If this works ok and then it must be some quirkiness with the way docker is running on OMV, if possible can you try running this again on unraid 6.2, i know you did this previously but i would assume it now works ok on this platform.

 

I have the same issue in Synology DSM 5.2.  I will be happy to provide logs if needed.

Link to comment

Hoping to get this working for a speed increase from deluge... currently capped at 1.2-1.3 MB/s in deluge, internet is 100mbps and speed tests show full speed...

 

Anyways, I got it all setup but when i navigate to the webui on port 9080 i get the webui but it says no connection to rtorrent yet and never connects.

 

the docker log has this:

2016-04-08 17:24:42,141 DEBG 'webui-script' stderr output:
2016/04/08 17:24:42 [error] 636#0: *4 FastCGI sent in stderr: "PHP message: PHP Parse error: syntax error, unexpected 'be' (T_STRING), expecting ')' in /etc/webapps/rutorrent/conf/config.php on line 44" while reading response header from upstream, client: 192.168.1.123, server: localhost, request: "GET /php/getplugins.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:7777", host: "192.168.1.2:9080", referrer: "http://192.168.1.2:9080/"

 

binhex, did you accidentally fat finger something??? 8)

Link to comment

Thanks for the reply binhex,

 

I'll just wait for your fix re diskspace.

 

Happy with how rutorrent is working with my redirect using a header append, so I'll just leave it at that, but thanks for the info, should help me in future.

 

Not sure what changed, but sickrage and rutorrent are working now. I tired the setting exactly like you have (and I now have) before and it didn't work, tried very combination I could find for both scgi and http(s) and nothing worked, resorted to black hole, then tried again when I read your message and it worked. Maybe I needed to save the config before hitting test, not sure, but it is working now thanks.

 

Wob

Link to comment

Hoping to get this working for a speed increase from deluge... currently capped at 1.2-1.3 MB/s in deluge, internet is 100mbps and speed tests show full speed...

 

Anyways, I got it all setup but when i navigate to the webui on port 9080 i get the webui but it says no connection to rtorrent yet and never connects.

 

the docker log has this:

2016-04-08 17:24:42,141 DEBG 'webui-script' stderr output:
2016/04/08 17:24:42 [error] 636#0: *4 FastCGI sent in stderr: "PHP message: PHP Parse error: syntax error, unexpected 'be' (T_STRING), expecting ')' in /etc/webapps/rutorrent/conf/config.php on line 44" while reading response header from upstream, client: 192.168.1.123, server: localhost, request: "GET /php/getplugins.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:7777", host: "192.168.1.2:9080", referrer: "http://192.168.1.2:9080/"

 

binhex, did you accidentally fat finger something??? 8)

 

Bad regex, will fix this today, watch out for an update

Link to comment
  • binhex locked this topic
Guest
This topic is now closed to further replies.