crazy-max / docker-rtorrent-rutorrent

rTorrent and ruTorrent Docker image
MIT License
498 stars 110 forks source link

Value in rutorrent config.php from env variable RU_SAVE_UPLOADED_TORRENTS causes error #134

Closed SeeTwoArrr closed 2 years ago

SeeTwoArrr commented 2 years ago

Hi,

If I provide a container of image version 3.10-0.9.8-0.13.8 with the env var RU_SAVE_UPLOADED_TORRENTS and give it the value: /downloads/torrentfiles, the following gets put in the rutorrent config.php file:

$saveUploadedTorrents = /downloads/torrentfiles;

This causes the rutorrent web interface to not function: 2021/11/29 21:11:48 [error] 545#545: *4 FastCGI sent in stderr: "PHP message: PHP Parse error: syntax error, unexpected '/' in /var/www/rutorrent/conf/config.php on line 25" while reading response header from upstream, client: <cut>, server: , request: "GET /php/getplugins.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm7.sock:", host: "<cut>", referrer: "https://<cut>/"

The solution (for me at least) is to enclose the value in config.php in quotes like so: $saveUploadedTorrents = '/downloads/torrentfiles';

A temporary workaround for me is to either manually edit the file after container launch, or mount the file as volume. But this would make all the values static.

Thanks!

crazy-max commented 2 years ago

@SeeTwoArrr RU_SAVE_UPLOADED_TORRENTS is a boolean value that specifies if yes or no you want to save torrents files to /data/rutorrent/share/torrents (default true). That being said, we should add a validity check on this var.

SeeTwoArrr commented 2 years ago

Ahhh wow that made me look quite dumb...

I think I was under the impression a path should go there based on the information on the README. However the default: true should have told me it was a boolean value.

Thank you.