install DELUGE in a jail

dasti

Explorer
Joined
Jun 11, 2014
Messages
71
16/5/2016 - tested on freenas 9.10 with deluge 3.12


Deluge is a lightweight torrent client based on libtorrent

Why do I like in Deluge ?

  • it has an easy approach : in a graphical environment it can act in "classic" mode (like utorrent), it can also act in "daemon" mode, perfect for a headless server !
  • the connection manager allow you to connect on several daemons
  • It has gtk+, web and console user interfaces
  • It has a nice collection of plugins here
  • The official features' list is here
  • Here's a bittorent clients comparison is here
What are we going to do ?
  • Create a jail and prepare all the details so deluge can be installed smoothly
  • Install deluge in that jail
  • Connect to deluge (various ways to do that)
  • finally some extra configuration


step 0 - preparation

your FreeNAS box must have a fully working internet connection
you must prepare the ip address you'll allocate to the jail we're going to create together
you must be able to access your freenas box through SSH
you have a dataset named "torrentsdatas" (if not, there's an explanation later in this guide)

your pool is named "mypool"
the jail and the user name are both "deluge"


step 1 - create a jail

create a jail in freenas web interface
name it "deluge"

you can choose to configure the ip address manually or let it be assigned by your dhcp server, it's up to you, but ultimatly you'll need the ip or the hostname to connect to deluge


step 2 - create a deluge user in the freenas web interface

Go in account / users and add a new user


username : deluge
comment : deluge bit torrent client
homedirectory : /nonexistant
disable login password : checked
Keep the user ID in mind, we will need this later
upload_2015-3-29_16-40-56.png


step 3 - connect to your freenas box in ssh

from linux
- open a shell and type
Code:
ssh [YourUserName]@[IpAddressOfYourFreenasBox]


from windows
- download and install your favorite ssh client software (example superputty)
- use your client to connect to your FreeNAS box



step 4 - enter your jail


(so you'll be able to enter commands directly from inside the jail)
check how many jails you have and note the number ( jail Id = JID) or the name of your deluge jail (that should be "deluge" anyway)
Code:
jls

you'll get a list of the jail looking like this

[root@freenas] ~# jls
JID IP Address Hostname Path
1 192.168.1.10 poney /mnt/mypool/jails/poney
2 192.168.1.11 deluge /mnt/mypool/jails/deluge

now that you confirmed that your jail name is "deluge", you can enter the jail with a command of this format -> jexec [JailName] tcsh
Code:
jexec deluge tcsh


now the prompt should look like something like this -> root@deluge:/ #



step 5 - download the portstree structure
Code:
portsnap fetch extract




not necessary anymore step 6 - correct the "lib torrent rasterbar problem"
If you try to install deluge directly, you'll get this error message at the end of the installation. It's seems that there's something wrong with libtorrent rasterbar.
===> py27-libtorrent-rasterbar-0.16.19_1 depends on shared library: libtorrent-rasterbar.so - not found
===> Verifying for libtorrent-rasterbar.so in /usr/ports/net-p2p/libtorrent-rasterbar
===> Building for libtorrent-rasterbar-0.16.19_1
Making all in include/libtorrent
Making all in src
CXX escape_string.lo
CXX file_storage.lo
CXX gzip.lo
CXX http_connection.lo
CXX http_parser.lo
escape_string.cpp:546:19: error: no matching function for call to 'libiconv'
size_t retval = iconv(h, TORRENT_ICONV_ARG &in, &insize,
^~~~~
/usr/local/include/iconv.h:81:15: note: expanded from macro 'iconv'
#define iconv libiconv
^~~~~~~~
/usr/local/include/iconv.h:83:15: note: candidate function not viable: no known conversion from 'char **' to 'const char **' for 2nd
argument
extern size_t iconv (iconv_t cd, const char* * inbuf, size_t *inbytesleft, char* * outbuf, size_t *outbytesleft);
^
/usr/local/include/iconv.h:81:15: note: expanded from macro 'iconv'
#define iconv libiconv
^
1 error generated.
*** [escape_string.lo] Error code 1
1 error
*** [all-recursive] Error code 1
1 error
===> Compilation failed unexpectedly.



let's make a copy of the problematic file, and edit it
Code:
cd /usr/ports/net-p2p/libtorrent-rasterbar/work/libtorrent-rasterbar-1.0.4/include/libtorrent
cp config.hpp config.hpp.original
ee config.hpp


and replace this line
Code:
#define TORRENT_ICONV_ARG (char**)

with this line
Code:
#define TORRENT_ICONV_ARG (const char**)

step 6 - create the deluge user in the jail

make sure to replace [ID] with the user ID you noted previously
Code:
pw useradd -n deluge -u [ID] -c "Deluge BitTorrent Client" -s /sbin/nologin -w no



step 7 - create a directory to store the deluge's config files

Code:
mkdir -p /home/deluge/.config/deluge
chown -R deluge:deluge /home/deluge/



step 8 - install deluge

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



not necessary anymore step 10 - replace the port's startup scripts with the ones from deluge website
In the next steps I'll propose 3 ways of controlling deluge, and to do I need the startup script for deluged and delugew to be separated from each other. The script from Dysphunkional start everything in one script, it works great.The ones from the port also have this behavior but I still don't understand why. So my solution is to use the scripts from the deluge website. (with just a correction at the interpreter line)

save the existing startup script for the deluge webUI daemon
Code:
cd /usr/local/etc/rc.d
mv deluge_web deluge_web.original


create a new file
Code:
ee delugew


paste the content of this quote into the file
#!/bin/sh
#
# deluge-web RCng startup script
# created by: R.S.A. aka .faust
# mail: rsa dot aka dot f at gmail dot com
#

# PROVIDE: delugew
# REQUIRE: NETWORKING SERVERS DAEMON ldconfig resolv
# BEFORE: LOGIN
# KEYWORD: shutdown
# Add the following line to /etc/rc.conf.local or /etc/rc.conf to enable deluge-web at startup
# delugew_enable="YES"
#
# cfg_dir (str): Specify the full path to directory with deluge-web config files
# log (str): Specify the full path to the LOG file
# pidfile (str): Specify the full path to the PID file
# delugew_user (str): Set to user running deluge-web
#
# Warning! Rights to folders and files must be "rwx" for the user under which deluge-web is run
. /etc/rc.subr

name="delugew"
rcvar=`set_rcvar`

load_rc_config $name
delugew_enable=${delugew_enable:=NO}

cfg_dir="/home/deluge/.config/deluge/"
log="${cfg_dir}${name}.log"
pidfile="${cfg_dir}${name}.pid"
delugew_user="deluge"

required_dirs=${cfg_dir}

command_interpreter="/usr/local/bin/python2.7"
command="/usr/local/bin/deluge-web"
start_cmd="${name}_start"
start_postcmd="${name}_poststart"

delugew_start()
{
if [ ! -f "${pidfile}" ]; then
su -m ${delugew_user} -c "/usr/local/bin/deluge-web -f -c ${cfg_dir} -l ${log}"
echo "Starting ${name}."
else
GETPROCESSPID=`/bin/ps -auxw | /usr/bin/awk '/deluge-web/ && !/awk/ && !/sh/ {print $2}'`
PIDFROMFILE=`cat ${pidfile}`
if [ "$GETPROCESSPID" = "$PIDFROMFILE" ]; then
echo "${name} already running with PID: ${PIDFROMFILE} ?"
echo "Remove ${pidfile} manually if needed."
else
rm -f ${pidfile}
su -m ${delugew_user} -c "/usr/local/bin/deluge-web -f -c ${cfg_dir} -l ${log}"
echo "Starting ${name}."
fi
fi
}

delugew_poststart()
{
echo `/bin/ps -auxw | /usr/bin/awk '/deluge-web/ && !/awk/ {print $2}'` > $pidfile
}

run_rc_command "$1"

exit with [crtl + X] and answer yes to save the file

save the existing startup script for the deluge daemon
Code:
cd /usr/local/etc/rc.d
mv deluged deluged.original


create a new file
Code:
ee deluged


paste the content of this quote

#!/bin/sh
#
# deluged RCng startup script
# created by: R.S.A. aka .faust
# mail: rsa dot aka dot f at gmail dot com
#

# PROVIDE: deluged
# REQUIRE: NETWORKING SERVERS DAEMON ldconfig resolv
# BEFORE: LOGIN
# KEYWORD: shutdown

# Add the following line to /etc/rc.conf.local or /etc/rc.conf to enable deluged at startup
# deluged_enable="YES"
#
# cfg_dir (str): Specify the full path to directory with deluged config files
# log (str): Specify the full path to the LOG file
# loglevel (str): Set loglevel (Available: none, info, warning, error, critical, debug)
# pidfile (str): Specify the full path to the PID file
# deluged_user (str): Set to user running deluged
#
# Warning! Rights to folders and files must be "rwx" for the user under which deluged is run

. /etc/rc.subr

name="deluged"
rcvar=`set_rcvar`

load_rc_config $name
deluged_enable=${deluged_enable:=NO}

cfg_dir="/home/deluge/.config/deluge/"
log="${cfg_dir}${name}.log"
loglevel="error"
pidfile="${cfg_dir}${name}.pid"
deluged_user="deluge"

required_dirs=${cfg_dir}

command_interpreter="/usr/local/bin/python2.7"
command="/usr/local/bin/${name}"
start_cmd="${name}_start"

deluged_start()
{
if [ ! -f "${pidfile}" ]; then
su -m ${deluged_user} -c "/usr/local/bin/${name} -c ${cfg_dir} -L ${loglevel} -l ${log} -P ${pidfile}"
echo "Starting ${name}."
else
GETPROCESSPID=`/bin/ps -auxw | /usr/bin/awk '/deluged/ && !/awk/ && !/sh/ {print $2}'`
PIDFROMFILE=`cat ${pidfile}`
if [ "$GETPROCESSPID" = "$PIDFROMFILE" ]; then
echo "${name} already running with PID: ${PIDFROMFILE} ?"
echo "Remove ${pidfile} manually if needed."
else
rm -f ${pidfile}
su -m ${deluged_user} -c "/usr/local/bin/${name} -c ${cfg_dir} -l ${log} -P ${pidfile}"
echo "Starting ${name}."
fi
fi
}
run_rc_command "$1"

exit with [crtl + X] and answer yes to save the file

give execute rights to the created files
Code:
chmod +x delugew
chmod +x deluged

step 9 - make sure that the deluge daemon will start automatically at startup

you can edit the /etc/rc.conf file with ee or just use these commands :
Code:
echo 'deluged_enable="YES"' >> /etc/rc.conf
echo 'deluged_user="deluge"' >> /etc/rc.conf

there are more parameters that can be


step 10 - start/stop the deluge daemon to create the configuration file

Code:
service deluged start
service deluged stop



step 11 - control deluge

I'll describe 3 ways of doing it
- with the WEB user interface only
- with the GTK user interface only
- with both user interfaces


On windows
- deluged.exe is the daemon taking care of your torrents
- deluge.exe is the gtkUI

In freenas
- deluged is the daemon
- delugew or (deluge_web) is the daemon for the webUI

If you use the webUI only
- you'll need the delugew daemon to be launched to do that
- you can start/stop the deluged daemon from it, In that case you will be able to see the daemon running via
ps -aux

If you use the GTK interface only
- you'll need the deluged daemon to be launched
- you can launch the webUI from it, in that case you won't be able to see the delugew daemon in the process list via
ps -aux

choice 11.1 - with the web user interface only

11.1.1 - make sure that the deluge web daemon will start automatically at boot
Code:
echo 'deluge-web_enable="YES"' >> /etc/rc.conf


11.1.2 - start the web user interface
Code:
service deluge-web start


11.1.3 - connect to the web interface

from your favorite web browser using this url format -> http://[IpAddressOfTheJail]:8112


you should get a prompt from the connection manager, select the running daemon and connect to it

upload_2015-3-29_21-53-32.png

you will have a second prompt for the password, enter "deluge" as the default password

upload_2015-3-29_18-1-26.png

at your first login you'll get a 3rd prompt to change the default password,you can also consider activating SSL and use your key and certificates

upload_2015-3-29_21-19-44.png

choice 11.2 - use only gtk user interface

11.2.1 - create a gtk user

as described in this link, deluge support multi users authentication and rights management. To create an administrator, use this command and replace [username] and [password] with yours...(keep track of those)
Code:
echo "[username]:[password]:10" >> ~/.config/deluge/auth



11.2.2 - enable gtk remote connections


stop deluged daemon if it's running
Code:
service deluged stop


this will allow remote connection from an external gtk user interface : edit the core configuration file
Code:
ee /home/deluge/.config/deluge/core.conf

Replace
this line
Code:
 "allow_remote": false,

with this line
Code:
"allow_remote": true,

{
"file": 1,
"format": 1
}{
"info_sent": 0.0,
"lsd": true,
"max_download_speed": -1.0,
"send_info": false,
"natpmp": true,
"move_completed_path": "/root",
"peer_tos": "0x00",
"enc_in_policy": 1,
"queue_new_to_top": false,
"ignore_limits_on_local_network": true,
"rate_limit_ip_overhead": true,
"daemon_port": 58846,
"torrentfiles_location": "/root",
"max_active_limit": 8,
"geoip_db_location": "/usr/local/share/GeoIP/GeoIP.dat",
"upnp": true,
"utpex": true,
"max_active_downloading": 3,
"max_active_seeding": 5,
"allow_remote": true,
"outgoing_ports": [
0,
0
],
"enabled_plugins": [],
"max_half_open_connections": 50,
"download_location": "/root",
"compact_allocation": false,
"max_upload_speed": -1.0,
"plugins_location": "/home/deluge/.config/deluge/plugins",
"max_connections_global": 200,
"enc_prefer_rc4": true,
"cache_expiry": 60,
"dht": true,
"stop_seed_at_ratio": false,
"stop_seed_ratio": 2.0,
"max_download_speed_per_torrent": -1,
"prioritize_first_last_pieces": false,
"max_upload_speed_per_torrent": -1,
"auto_managed": true,
"enc_level": 2,
"copy_torrent_file": false,
"max_connections_per_second": 20,
"listen_ports": [
6881,
6891
],
"max_connections_per_torrent": -1,
"del_copy_torrent_file": false,
"move_completed": false,
"autoadd_enable": false,
"proxies": {
"peer": {
"username": "",
"password": "",
"hostname": "",
"type": 0,
"port": 8080
},
"web_seed": {
"username": "",
"password": "",
"hostname": "",
"type": 0,
"port": 8080
},
"tracker": {
"username": "",
"password": "",
"hostname": "",
"type": 0,
"port": 8080
},
"dht": {
"username": "",
"password": "",
"hostname": "",
"type": 0,
"port": 8080
}
},
"dont_count_slow_torrents": false,
"add_paused": false,
"random_outgoing_ports": true,
"max_upload_slots_per_torrent": -1,
"new_release_check": false,
"enc_out_policy": 1,
"seed_time_ratio_limit": 7.0,
"remove_seed_at_ratio": false,
"autoadd_location": "/root",
"max_upload_slots_global": 4,
"seed_time_limit": 180,
"cache_size": 512,
"share_ratio_limit": 2.0,
"random_port": true,
"listen_interface": ""
}

start deluged daemon
Code:
service deluged start


It's also possible to to that step with another method, using the deluge console mode

11.2.3 - install deluge on your computer

You can do that on pcbsd, linux, macOS, windows, the official documentation is pretty good



11.2.4 - activate the daemon mode

go in edit / preferences / interface and desactivate the classic mode


upload_2015-3-30_10-57-27.png



11.2.5 - connect the connection manager to your jail's deluge daemon

deluge will restart and on the next start you'll be prompted with the connection manager. In the list, your local daemon will appear as 127.0.0.1:58846 don't bother with it


upload_2015-3-30_11-2-15.png


click on "add"

hostname : ip address of the jail
username : gtk user name you just created
password : gtk user password
a new line will appear in the connection manager and the daemon should be running, just click on it


choice 11.3 - use web and gtk user interface

Just run all command from choice 13.1 and 13.2
step 12 - create a dataset and mount it into the jail

It's a good practice to separate your data from the application. The jail has already it's dataset and we'll use another for the data and mount it into the jail

Make sure that you have a dataset ready for those data, if not go in Freenas webUI in storage / volumes / mypool / create dataset and create it ! Check the official documentation for more detailled informations.


To mount your data's dataset in the jail use Freenas'webUI, go in Jails / Deluge / storage / Add storage and input the correct source and destinations directories. Check the official documentation for more detailed informations


here's the format (assuming that you'll place all in the /mnt directory)

source : /mnt/[YourPoolNameHere]/[YourData'sDatasetNameHere]

destination : /mnt/[YourPoolNameHere]/jails/[JailNameHere]/mnt/[YourData'sDatasetNameHere]
create directory is : checked
mounted is : checked

here's the example in our case

source : /mnt/mypool/torrentsdata

destination : /mnt/mypool/jails/deluge/mnt/torrentsdatas
create directory is : checked
mounted is : checked

step 13 - configure deluge to store the data in that dataset

Open deluge interface, go in preferences / downloads / folders and configure the download path in the jail -> /mnt/torrentsdatas




some defaults values for deluge

default admin password : deluge
default port for web user interface : 8112
default port for gtk user interface : 56846
configuration fle is /home/deluge/.config/deluge/core.conf

authentification file is /home/deluge/.config/deluge/core.conf

sources and credits

the documentations and tutorials that made this one possible :
https://dysphunkional.wordpress.com/freebsd/jails/deluge/
http://dev.deluge-torrent.org/wiki/Installing/FreeBSD
http://dev.deluge-torrent.org/wiki/UserGuide/ThinClient
http://dev.deluge-torrent.org/wiki/UserGuide/Service/FreeBSD

http://dev.deluge-torrent.org/wiki/Faq

Thanks to jrg on #freenas for his help to find my way in this "perl problem".
Thanks to deleted on #deluge for his help to understand the remote connections
 

Attachments

  • upload_2015-3-29_21-53-16.png
    upload_2015-3-29_21-53-16.png
    14.1 KB · Views: 785
Last edited:

mueslo

Cadet
Joined
Apr 21, 2015
Messages
5
Nice guide, but it fails on step 9 for me. While compiling libtorrent-rasterbar.so, I get:

Code:
===>   py27-libtorrent-rasterbar-0.16.19_1 depends on shared library: libtorrent-rasterbar.so - not found                      
===>    Verifying for libtorrent-rasterbar.so in /usr/ports/net-p2p/libtorrent-rasterbar                                       
===>  Building for libtorrent-rasterbar-0.16.19_1                                                                              
Making all in include/libtorrent                                                                                               
Making all in src                                                                                                              
CXX      escape_string.lo                                                                                                      
CXX      file_storage.lo                                                                                                       
CXX      gzip.lo                                                                                                               
CXX      http_connection.lo                                                                                                    
CXX      http_parser.lo                                                                                                        
escape_string.cpp:546:19: error: no matching function for call to 'libiconv'                                                   
                size_t retval = iconv(h, TORRENT_ICONV_ARG &in, &insize,                                                       
                                ^~~~~                                                                                          
/usr/local/include/iconv.h:81:15: note: expanded from macro 'iconv'                                                            
#define iconv libiconv                                                                                                         
              ^~~~~~~~                                                                                                         
/usr/local/include/iconv.h:83:15: note: candidate function not viable: no known conversion from 'char **' to 'const char **' for 2nd
argument                                                                                                                      
extern size_t iconv (iconv_t cd, const char* * inbuf, size_t *inbytesleft, char* * outbuf, size_t *outbytesleft);              
              ^                                                                                                                
/usr/local/include/iconv.h:81:15: note: expanded from macro 'iconv'                                                            
#define iconv libiconv                                                                                                         
              ^                                                                                                                
1 error generated.                                                                                                             
*** [escape_string.lo] Error code 1                                                                                            
1 error                                                                                                                        
*** [all-recursive] Error code 1                                                                                               
1 error                                                                                                                        
===> Compilation failed unexpectedly.


To resolve this, I prepended 'const' to the 'char**' in

Code:
#define TORRENT_ICONV_ARG (char**)
in
/usr/ports/net-p2p/libtorrent-rasterbar/work/libtorrent-rasterbar-0.16.19/include/libtorrent/config.hpp

Edit: on step 10 you're also missing a chmod +x for the new files
 
Last edited:

dasti

Explorer
Joined
Jun 11, 2014
Messages
71
hi Mueslo,

Edit: on step 10 you're also missing a chmod +x for the new files

ok updated !


for the other problem in the compilation, it's a bit over my head :)

you changed this line
#define TORRENT_ICONV_ARG (char**)

into this line
#define TORRENT_ICONV_ARG (char**const)

into this file ?
/usr/ports/net-p2p/libtorrent-rasterbar/work/libtorrent-rasterbar-0.16.19/include/libtorrent/config.hpp


did you installed in freenas 9.3 ?
did you get also the perl problem ?
it seems that there was an update of the port on march 10th that occured maybe after I made the tests with my guide (it took me some time to write this guide), do you think it' could be a new bug ?
 

mueslo

Cadet
Joined
Apr 21, 2015
Messages
5
Well it seems to be a problem in the libtorrent-rasterbar port source. And I changed the char** to const char** (just some C++ stuff). I'm not sure if I ran into the perl problem, because I followed your guide and reinstalled it. On my system (fresh FreeNAS 9.3, I'm new to FreeNAS), I already hat perl 5.18 installed, so maybe that's why it wasn't a problem.
 

melt7777

Cadet
Joined
May 26, 2015
Messages
3
A couple notes. I am using Stable 9.3.

In Step 6, I had to use pkg remove perl5-5.18.4_11 to remove old perl and then when I reinstalled, it installed the newer version (5.18.4_16 i believe it was.)

In Step 13.2, for enabling the remote access via GTK, which is awesome, I had to service deluged stop and then edit the core.conf file to allow_remote otherwise, the running daemon would save out current config and overwrite my changes.

Thank you folks very much for this guide and the contributions of the commenters, I really do appreciate the effort that you have all put in to this project, and look forward to seeing you on #freenas irc.

A special thank you to the ones who found #define TORRENT_ICONV_ARG (char**const), I would never have had the time or the cpp skills to find this.

Keep up the great work!

-melt7777
 

dasti

Explorer
Joined
Jun 11, 2014
Messages
71
A couple notes. I am using Stable 9.3.
In Step 6, I had to use pkg remove perl5-5.18.4_11 to remove old perl and then when I reinstalled, it installed the newer version (5.18.4_16 i believe it was.)
strange, this command is used when you install with the pkg and not the portstree

A couple notes. I am using Stable 9.3.
In Step 13.2, for enabling the remote access via GTK, which is awesome, I had to service deluged stop and then edit the core.conf file to allow_remote otherwise, the running daemon would save out current config and overwrite my changes.

thanks for the debugging, I updated the guide to prevent that !
 
Joined
Sep 13, 2014
Messages
149
I'm having problems with step 6.

When I try to input the following command, it says there's no such file or directory. It appear the "/work" directory doesn't exist.

Code:
cd /usr/ports/net-p2p/libtorrent-rasterbar/work/libtorrent-rasterbar-1.0.4/include/libtorrent


What am I missing?
 

SavageCore

Dabbler
Joined
Jun 24, 2015
Messages
17

That location changes based on version. Do the following to detect new version...

Code:
cd /usr/ports/net-p2p/libtorrent-rasterbar/work/
ls -l


You'll then see a printout of all files and folders in current dir. Look for libtorrent-rasterbar.

Code:
libtorrent-rasterbar-1.0.6


Thus the new command becomes

Code:
cd /usr/ports/net-p2p/libtorrent-rasterbar/work/libtorrent-rasterbar-1.0.6/include/libtorrent
 
Last edited:

SpaceAvenger69

Dabbler
Joined
Feb 4, 2015
Messages
20
I'm with CompuGlobalHyperMegaNet. I don't have the /work subfolder under /user/ports/net-p2p/libtorrent-rasterbar/. I've created a fresh jail and followed the instructions up to step 6 where this issue presents itself. I've tried doing a search for the config.hpp file in my jail but to no avial. What are we missing? Please advise. '

TIA :)
 

SavageCore

Dabbler
Joined
Jun 24, 2015
Messages
17
Oh sorry missed work folder being the problem, afraid I don't know, but some info I gathered when installing it myself last night:

I followed this exactly apart from there being a second instance of TORRENT_ICONV_ARG that needed changing within config.hpp and the original line (260~) had already been fixed.

Also now that I have a working Deluge jail the work folder is missing so I assume some part of the 'make' process removes it?

Hopefully that helps when you figure out where config.hpp is...
 

SpaceAvenger69

Dabbler
Joined
Feb 4, 2015
Messages
20
I was able to finally get Deluge installed and working on my machine. I also was able to bind it to OpenVPN through PIA as well. I found a couple issues with your instructions which I'm sure was a result of updated files since your original posting. I will post my findings and instructions on implementing Deluge with OpenVPN when I have more time. Thanks again for your help!! :)
 

Thor667

Cadet
Joined
Oct 19, 2015
Messages
1
I was able to finally get Deluge installed and working on my machine. I also was able to bind it to OpenVPN through PIA as well. I found a couple issues with your instructions which I'm sure was a result of updated files since your original posting. I will post my findings and instructions on implementing Deluge with OpenVPN when I have more time. Thanks again for your help!! :)

Can you explain how you got around step 6? I am finding no work folder when doing the install. This is on FreeNAS-9.3-STABLE-201509282017
 

SpaceAvenger69

Dabbler
Joined
Feb 4, 2015
Messages
20
I'm not sure if it was the most efficient or correct way to do it but, I went to the /usr/ports/net-p2p/libtorrent-rasterbar directory and ran 'make install clean'. This took awhile but after it was done I now had the rest of the 'work/...' directory. Just be aware of the version difference for libtorrent-rasterbar-1.0.6.

Other differences from the current guide includes:

  • There are TWO ' #define TORRENT_ICONV_ARG (char**)' lines that need to be changed.
  • Under step 13.2.1 - the line should read 'echo "[username]:[password]:10" >> /home/deluge/.config/deluge/auth
I've got Deluge running in the same jail as Sonarr, Couchpotato, Sabnzbd, Headphones, and Handbrake all with OpenVPN security using PIA. I'm pretty impressed with it. :) I call it my personal DVR. I'll make a guide on how I made it once I'm done remodeling my house. Priorities come first. Hope this helps.
 

BOrgIT

Cadet
Joined
Nov 3, 2015
Messages
1
First of all, thanks dasti for posting your instructions. These howtos are great in making my FREENAS build useful, and to begin learning the FreeBSD environment.

I was not able to get past the installation of libtorrent-rasterbar in number 6. I tried this a number of times. Every time except once the 'make install clean' failed. Sometimes when it fails there is a work directory left over, but usually not. The one time that I got all the way through the install, the work directory was gone. I suspect this is cleaned after the install, which makes me wonder how it would be utilizing the config.hpp file there if the directory is not supposed to be there. The one time that it failed with the work directory still there, I did finish all of the steps. Deluge worked, but I couldn't get it running again after a restart of the jail.

One curiosity I have is how the libtorrent-rasterbar install could fail at different points and once succeed when I was running it in the same environment each time. Putting that aside for the moment, I went back to the documentation that was used as a source to these instructions and tried installing everything using packages instead of the ports. I got through it without any errors and it runs well. It's also a much quicker install, as one would expect using the binaries.

I would be interested to know if there's an argument against installing Deluge using this approach.

Here's what I did:

Code:
pkg update
pkg upgrade
pkg install nano


I created the 'deluge' user, but I used the 'adduser' command instead. I ran into a problem once using the 'pw' command that was here. Anyway, I don't really understand the difference, except using the adduser command appears to create a symbolic link with 'home' pointing to '/usr/home', and the command doesn't. Don't know how that's significant, but it works.

Then:

Code:
mkdir -p /home/deluge/.config/deluge
chown -R deluge:deluge /home/deluge/
pkg install libtorrent-rasterbar
pkg install deluge


The rest was the same as the instructions. I'm only using the web interface, but it has been working great.

Thanks again to dasti and the rest of you for the instructions and comments, and I'd be interested in getting feedback on this.
 
Last edited:

dasti

Explorer
Joined
Jun 11, 2014
Messages
71
I have to admit that this rasterbar problem is also a bit over my head, first it was a perl version problem than it turns out into that rasterbar install.
I also figured out that the source directory name changes with the version of software so this line in the step 6 is also a problem

cd /usr/ports/net-p2p/libtorrent-rasterbar/work/libtorrent-rasterbar-1.0.4/include/libtorrent

I will try the installation again to update the guide or at least explain how to workaround this


for the installation methot with pkg instead of port

My first reaction to your post was that "whaou this method is actually much better !! Let's just erase that long tutorial !!" but ...
in fact remembered I did this way because it's the only way you can install deluge "headless" ( = x11 components). In 2015 download 1gb of X11 is not really a big deal, but ( it's personnal point of view) it's not in the "spirit"of what you can see in freebsd.

Second but, I contacted the maintainer of the package and I hope he can produce a new deluge-cli package that would be what we need : a simple pkg install command and no X11 !!
this would make this guide completely useless, which is a good thing !
 

nattan

Explorer
Joined
May 19, 2013
Messages
57
Can anyone suggest how to do this? I am currently:
Running the GTK + webui

On torrent completion I would like to have the file permission changed to 775, and have the torrent extracted if it is .zip or .rar

I have tried enabling the auto extract feature/plugin on deluge via the windows client and it shows up and enables the option. I cant get any of the "default" plugins to work. I have also tried using the execute plugin with a python unrar script ( never runs the script )

any ideas?
 
Last edited:

i3luefire

Explorer
Joined
Jan 4, 2014
Messages
69
in fact remembered I did this way because it's the only way you can install deluge "headless" ( = x11 components). In 2015 download 1gb of X11 is not really a big deal, but ( it's personnal point of view) it's not in the "spirit"of what you can see in freebsd.
maybe you could just update it to show installation with pkgs for all but deluge itself. ... anyway i tried both methods and a mixed method and i cannot get it working. on the original method i ran into an issue with something(not rasterbar) i don't remember now. but then i installed what ever thing that was with pkg and proceeded. then from there on out i just used pkg to install what ever hung up until i got to twistedCore which could not install with pkg or ports. so i gave up on ports deluge. i then tried pkg install deluge and it had a problem with "package fontconfig-2.11.1_1,1: size mismatch, cannot continue"... anyway. i am waiting on another solution
 

i3luefire

Explorer
Joined
Jan 4, 2014
Messages
69
maybe you could just update it to show installation with pkgs for all but deluge itself. ... anyway i tried both methods and a mixed method and i cannot get it working. on the original method i ran into an issue with something(not rasterbar) i don't remember now. but then i installed what ever thing that was with pkg and proceeded. then from there on out i just used pkg to install what ever hung up until i got to twistedCore which could not install with pkg or ports. so i gave up on ports deluge. i then tried pkg install deluge and it had a problem with "package fontconfig-2.11.1_1,1: size mismatch, cannot continue"... anyway. i am waiting on another solution
okay. i guess i am a dumbass because i tried it again in a fresh jail and the port worked. it even worked without editing anything. i just hopped in the jail made portsnap fetch
Code:
root@deluge:~ # history 100
     1  18:32   pkg update
     2  18:33   pkg upgrade
     3  18:38   pkg install nano
     4  18:39   portsnap fetch extract
     5  18:43   adduser
     6  18:44   mkdir -p /home/deluge/.config/deluge
     7  18:44   chown -R deluge:deluge /home/deluge/
     8  18:44   cd /usr/ports/net-p2p/deluge && make WITHOUT_X11=yes WITHOUT_GTK2=yes install clean

and voila it was installed.
Thanks for the tutorial! ;)
 
Last edited:

i3luefire

Explorer
Joined
Jan 4, 2014
Messages
69
okay... i thought it was easy enough that i wanted to document exactly how i did it and... i could not get it to work again. lol. i installed the pkg of deluge FTW. i may try again when i install FN10
 

icsy7867

Contributor
Joined
Dec 31, 2015
Messages
167
I just used pkg install deluge, and followed the rest of the instruction. It has installed great, and the web interface is running but for the life of me I cannot get the port to open. It is correctly forwarded in my router, but canyouseeme.org is still reporting the port as closed.

I tried running a:
service ipfw onestop

to see if it was a FW issue and it does not appear to be. Does anyone have any suggestions?

*EDIT*

I'm an idiot. I use policy based routing in my router through a vpn connection, and I forgot to add the correct iptables lines
 
Last edited:
Top