install DELUGE in a jail

cbrherms

Dabbler
Joined
Jan 23, 2016
Messages
10
For anyone else viewing this guide, if you want webui plugins to install correctly in the deluge jail you'll have to create the .python-eggs folder (for plugin extraction) as for some reason it's not created in the py install.

Code:
mkdir /.python-eggs
chmod 777 /.python-eggs


Also to make webui auto connect to daemon do the following
Code:
service deluge_web stop

edit the following line in /home/deluge/.config/deluge/web.conf from
Code:
 "default_daemon": "",

to
Code:
 "default_daemon": "127.0.0.1:58846",


then re-enable webui
Code:
service deluge_web start


@dasti could you please update the guide to show my previous posts' changes?
 
Last edited:

i3luefire

Explorer
Joined
Jan 4, 2014
Messages
69
For anyone else viewing this guide, if you want webui plugins to install correctly in the deluge jail you'll have to create the .python-eggs folder (for plugin extraction) as for some reason it's not created in the py install.
Code:
mkdir /.python-eggs
chmod 777 /.python-eggs
I had permissions issues when i set 777 on the plugin folder. i had to set to 755 then it all worked.
 
Last edited:

i3luefire

Explorer
Joined
Jan 4, 2014
Messages
69
except the execute plugin. it still unchecks itself every time i check it.

EDIT: the execute plugin requires a restart of the deluged and deluge-web services
 
Last edited:

YodaDaCoda

Dabbler
Joined
Sep 30, 2014
Messages
13
The latest version of Deluge 1.3.12 has a bug in the scheduler plugin that causes it to not turn off (i.e. torrents locked into slow mode at all times).

Thread on Deluge's forums: http://forum.deluge-torrent.org/viewtopic.php?t=52553

Commit on Deluge's git to fix the issue: http://git.deluge-torrent.org/delug...e&id=cdf301601fe71bd697f3796cf0a5656d437d140e

I don't know much about portsnap, but I put together a patch file which you can put in /usr/ports/net-p2p/deluge/files before compilation to fix the issue.

Code:
This patch fixes scheduler plugin getting stuck in slow mode discussed here:
http://forum.deluge-torrent.org/viewtopic.php?t=52553

--- deluge/plugins/scheduler/scheduler/core.py.orig   2016-06-14 19:29:50 UTC
+++ deluge/plugins/scheduler/scheduler/core.py
@@ -127,7 +127,7 @@ class Core(CorePluginBase):
        """
        core_config = deluge.configmanager.ConfigManager("core.conf")
        for setting in CONTROLLED_SETTINGS:
-            component.get("PreferencesManager").do_config_set_func(setting, core_config[setting])
+            core_config.apply_set_functions(setting)
        # Resume the session if necessary
        component.get("Core").session.resume()
 
Joined
Mar 6, 2014
Messages
686
Version 1.3.13,1 has a bug that it won't start if you upgrade your jail and libtorrent-rasterbar and py27-libtorrent-rasterbar are upgraded from version 1.0.9 to 1.1.0
According to the Deluge forum, this will not be solved in the 1.3.x version and we might even have to wait for version 2.

I tried to instal portdowngrade, but that results in another error:
Code:
"/usr/ports/Mk/bsd.port.mk", line 1148: UNAME_r (10.3-STABLE) and OSVERSION (903
000) do not agree on major version number.
since the jail is still on version 9,3
Guess i have to build this jail again with a newer template.
 
Last edited:
Joined
Mar 6, 2014
Messages
686
When you'll be prompted, make sure that GTK2 option is NOT installed, for the other compilations options, I just leave everything by default
Code:
cd /usr/ports/net-p2p/deluge && make WITHOUT_X11=yes install clean
This should be replaced with:
Code:
cd /usr/ports/net-p2p/deluge && make WITH="" WITHOUT="X11" install clean
since WITHOUT_X11 is a deprecated option now.

EDIT: I found out that when you try to update/upgrade the jail, it upgraded with default options, and it will install all the X11 stuff (which is a lot!). A better option is to set the option OPTIONS_UNSET=X11 in /etc/make.conf since you won't ever need to have X11 stuff in this jail anyway.
 
Last edited:

SpaceAvenger69

Dabbler
Joined
Feb 4, 2015
Messages
20
This is probably a newb question but how do you downgrade the libtorrent-rasterbar from 1.1.0 to 1.0.9? Rilo - did you ever get Deluge working with the downgraded version of libtorrent and if so, can you provide the steps pertinent to it?
 
Joined
Mar 6, 2014
Messages
686
This is probably a newb question but how do you downgrade the libtorrent-rasterbar from 1.1.0 to 1.0.9? Rilo - did you ever get Deluge working with the downgraded version of libtorrent and if so, can you provide the steps pertinent to it?
Nope, i can't get portdowngrade to work. Not just for this one, but for any port i try. I can get it to install, but i can't get it to downgrade any port.
 
Last edited:

swess

Cadet
Joined
May 12, 2016
Messages
6
I've never managed to get deluge working following this guide, and i've tried it like 5 times with reading the comments here and such. I'm stuck at 11.2.1 - create a gtk user and not being able to connect in the "Connection Manager" in WebUI. How would I go about if I want to use Deluge to seed the torrents that are in my "Media" dataset using gtk. That's all I want. If anyone could lead the way that would be highly appricated. I'm also really new to FreeNAS.

Thanks
 

BillCardiff

Explorer
Joined
May 13, 2014
Messages
59
libtorrent-rasterbar AND deluge were both updated.
One today (October 26th) and the other yesterday I believe.

checking with freshports.org says one of the updates is due to realizing how badly they didn't work together anymore. Try again.
 
Joined
Mar 6, 2014
Messages
686
I'm giving up on Deluge. The server side (the FreeNAS jail) is far too heavy/bloated. It pulls so many dependencies that aren't needed on a server side, its insane. I'm going to look for a better alternative.
 

BillCardiff

Explorer
Joined
May 13, 2014
Messages
59
I really like my deluge jail. I copied over and edited deluged and deluge_web into a couple of other versions --- delugemusic, delugesonarr, delugecouch for examples. My one jail has 5 variations of deluge running. I can then delegate where various downloads end up, what programs control what options, scripts and logs. My rc.conf reads like a small essay...

portmap_enable="NO"
sshd_enable="NO"
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
hostname="Delugeses"
devfs_enable="YES"
devfs_system_ruleset="devfsrules_common"
inet6_enable="YES"
ip6addrctl_enable="YES"
# deluged
deluged_enable="YES"
deluged_user="deluged"
deluged_confdir="/usr/local/deluges/deluged/"
deluged_logfile="/logs/deluged.log"
# delugesonarr
delugesonarrd_enable="YES"
delugesonarrd_user="delugesonarr"
delugesonarrd_confdir="/usr/local/deluges/delugesonarr/"
delugesonarrd_logfile="/logs/delugesonarr.log"
# delugecouch
delugecouchd_enable="YES"
delugecouchd_user="delugecouch"
delugecouchd_confdir="/usr/local/deluges/delugecouch/"
delugecouchd_logfile="/logs/delugecouch.log"
# delugekids
delugekidsd_enable="YES"
delugekidsd_user="delugekids"
delugekidsd_confdir="/usr/local/deluges/delugekids/"
delugekidsd_logfile="/logs/delugekids.log"
# delugemusic
delugemusicd_enable="YES"
delugemusicd_user="delugemusic"
delugemusicd_confdir="/usr/local/deluges/delugemusic/"
delugemusicd_logfile="/logs/delugemusic.log"

Setting different ports for webgui and gtk lets me control the bandwidth, directories, and plugins separately, so for instance the delugekids maxes out at 800 down, while delugesonarr can go up to 1800, with the others somewhere in between.
 
Last edited:
Joined
Mar 6, 2014
Messages
686
I tried some stuff again and came up with a super simple guide.

Assuming the dataset you want to use for downloads is the 'media' dataset and is owned by a group named 'media' with group ID 2000
Assuming you are only installing the no-gtk version in the jail, so you are going to use the GTK client (and/or the web version --> see remark at the bottom of this post).
  • Create the jail (and add the 'media' dataset as storage, mounted at /mnt/media), and in that jail, do this:
  • pkg update
  • pkg upgrade
  • pkg install deluge-cli (this doesn't include web version --> see bottom of this post for different package to use for web version)
  • pw useradd -n deluge -u 1001 -c "Deluge BitTorrent Client" -s /sbin/nologin -w no
  • echo 'deluged_enable="YES"' >> /etc/rc.conf
  • echo 'deluged_user="deluge"' >> /etc/rc.conf
  • mkdir -p /home/deluge/.config/deluge
  • chown -R deluge:deluge /home/deluge/
  • ee /etc/group
    • in that file, add or modify the line to make the deluge user member of the media group:
      • media:*:2000:deluge
      • [Esc], [a], [a] to save and close the file
  • /usr/local/etc/rc.d/deluged start
  • /usr/local/etc/rc.d/deluged stop
  • If you want to use the gtk-client:
    • ee /home/deluge/.config/deluge/core.conf
      • in that file, change the line:
        • “allow_remote”: true
        • [Esc], [a], [a] to save and close the file
    • echo "[username]:[password]:10" >> /home/deluge/.config/deluge/auth
      (of course replace [username] and [password] with your credentials.
    • chmod 555 /home/deluge/.config/deluge/auth
  • /usr/local/etc/rc.d/deluged start
That's it. Everything is working again :)

Connect with your Deluge gtk client application to hostname <your jail ip>, port 58846, and your user credentials

If you want to use the web version, then instead of installing deluge-cli, you have to install the deluge package in step 4, since it is not included in the cli version. To enable the web version, also run this command once after installation:
  • echo 'deluge-web_enable="YES"' >> /etc/rc.conf
  • echo 'deluge-web_user="deluge"' >> /etc/rc.conf
And to start it:
  • /usr/local/etc/rc.d/deluge-web start
Then go with your web browser to: http://<your jail ip>:8112 (default pw is "deluge" without the quotes)

NOTE: All users that are members of the 'media' group (both in FreeNAS - Account section in GUI, not the jail) will have read access with this setup (since the guide assumes the 'media' group is the dataset owner), and the owner user of the dataset will have write access to the files created by the processes in the jail (deluge). This is the way I like it, since I only want members of the 'media' group to have read access (i.e. the Plex user), and only my own user (owner of the dataset) write access.
If you want all the FreeNAS users that are members of the 'media' group to have write access too:
  • Go into your jail
  • ee /.cshrc
  • Change the line umask 22 to umask 2
  • [Esc], [a], [a] to save and close the file
  • Restart the jail
Edit: adjusted for web version
Edit added note and instructions for file permissions. Thanks to @JKman for the info.
 
Last edited:

swess

Cadet
Joined
May 12, 2016
Messages
6
I tried some stuff again and came up with a super simple guide.

Assuming the dataset you want to use for downloads it the 'media' dataset is owned by a group named 'media' with group ID 2000
Assuming you are only installing the no-gtk version in the jail, so you are going to use the GTK client and/or the web version.
  • Create the jail (and add the 'media' dataset as storage, mounted at /mnt/media), and in that jail, do this:
  • pkg update
  • pkg upgrade
  • pkg install deluge-cli
  • pw useradd -n deluge -u 1001 -c "Deluge BitTorrent Client" -s /sbin/nologin -w no
  • echo 'deluged_enable="YES"' >> /etc/rc.conf
  • echo 'deluged_user="deluge"' >> /etc/rc.conf
  • mkdir -p /home/deluge/.config/deluge
  • chown -R deluge:deluge /home/deluge/
  • ee /etc/group
    • in that file, add or modify the line to make the deluge user member of the media group:
      • media:*:2000:deluge
      • [Esc], [a], [a] to save and close the file
  • /usr/local/etc/rc.d/deluged start
  • /usr/local/etc/rc.d/deluged stop
  • If you want to use the gtk-client:
    • ee /home/deluge/.config/deluge/core.conf
      • in that file, change the line:
        • “allow_remote”: true
        • [Esc], [a], [a] to save and close the file
    • echo "[username]:[password]:10" >> ~/.config/deluge/auth
      (of course replace [username] and [password] with your credentials.
    • chmod 555 /home/deluge/.config/deluge/auth
  • If you want to use the web version:
    • echo 'deluge-web_enable="YES"' >> /etc/rc.conf
  • /usr/local/etc/rc.d/deluged start
That's it. Everything is working again :)

Connect with your Deluge gtk client application to hostname <your jail ip>, port 58846, and your user credentials
Or if you use the web version: Go with your web browser to: http://<your jail ip>:8112 (default pw is "deluge" without the quotes)

Oooh, this sounds promising since i've tried and tried to get this to work. So if I want to follow you guide but I don't have a group named 'media' with group ID 2000, I only have a dataset which looks like this https://i.gyazo.com/248215258ae487a16a7c901ea7fe6966.png.
 
Joined
Mar 6, 2014
Messages
686
Well, you need to read up on (dataset) permissions. You can use any dataset, owned by any group and create the same group with the same ID in the jail and add the deluge user to that group. Pretty straightforward, just replace the group name and ID in my guide with yours.

The way you've set up your dataset, any user and any group can do anything on your dataset. So you can skip the part of adding the deluge user to a group. It's not recommended and not at all secure, but it should work.
 

swess

Cadet
Joined
May 12, 2016
Messages
6
Well, you need to read up on (dataset) permissions. You can use any dataset, owned by any group and create the same group with the same ID in the jail and add the deluge user to that group. Pretty straightforward, just replace the group name and ID in my guide with yours.

The way you've set up your dataset, any user and any group can do anything on your dataset. So you can skip the part of adding the deluge user to a group. It's not recommended and not at all secure, but it should work.

I get this error "/root/.config/deluge/auth: No such file or directory" at this step "echo "[username]:[password]:10" >> ~/.config/deluge/auth"
 
Joined
Mar 6, 2014
Messages
686
I get this error "/root/.config/deluge/auth: No such file or directory" at this step "echo "[username]:[password]:10" >> ~/.config/deluge/auth"
Look at the next step and change the path accordingly. Thus ~ becomes /home/deluge
 
Joined
Mar 6, 2014
Messages
686

John Bernard

Cadet
Joined
Oct 4, 2016
Messages
1
I tried some stuff again and came up with a super simple guide.

Assuming the dataset you want to use for downloads it the 'media' dataset is owned by a group named 'media' with group ID 2000
Assuming you are only installing the no-gtk version in the jail, so you are going to use the GTK client and/or the web version.
  • Create the jail (and add the 'media' dataset as storage, mounted at /mnt/media), and in that jail, do this:
  • pkg update
  • pkg upgrade
  • pkg install deluge-cli
  • pw useradd -n deluge -u 1001 -c "Deluge BitTorrent Client" -s /sbin/nologin -w no
  • echo 'deluged_enable="YES"' >> /etc/rc.conf
  • echo 'deluged_user="deluge"' >> /etc/rc.conf
  • mkdir -p /home/deluge/.config/deluge
  • chown -R deluge:deluge /home/deluge/
  • ee /etc/group
    • in that file, add or modify the line to make the deluge user member of the media group:
      • media:*:2000:deluge
      • [Esc], [a], [a] to save and close the file
  • /usr/local/etc/rc.d/deluged start
  • /usr/local/etc/rc.d/deluged stop
  • If you want to use the gtk-client:
    • ee /home/deluge/.config/deluge/core.conf
      • in that file, change the line:
        • “allow_remote”: true
        • [Esc], [a], [a] to save and close the file
    • echo "[username]:[password]:10" >> /home/deluge/.config/deluge/auth
      (of course replace [username] and [password] with your credentials.
    • chmod 555 /home/deluge/.config/deluge/auth
  • If you want to use the web version:
    • echo 'deluge-web_enable="YES"' >> /etc/rc.conf
  • /usr/local/etc/rc.d/deluged start
That's it. Everything is working again :)

Connect with your Deluge gtk client application to hostname <your jail ip>, port 58846, and your user credentials
Or if you use the web version: Go with your web browser to: http://<your jail ip>:8112 (default pw is "deluge" without the quotes)

I followed this guide step by step and getting the following error:
root@deluge:/home/deluge/.config/deluge # service deluged start
/etc/rc.conf: deluge-web_enable=YES: not found
/etc/rc.conf: deluge-web_enable=YES: not found
Starting deluged.
root@deluge:/home/deluge/.config/deluge # /usr/local/lib/python2.7/site-packages/deluge/_libtorrent.py:59: RuntimeWarning: to-Python converter for boost::shared_ptr<libtorrent::alert> already registered; second conversion method ignored.
import libtorrent as lt

Any ideas?
Freenas 9.10 latest
Brand new jail deluge
 
Top