Difference between revisions of "Deluge"

From ArchWiki
Jump to: navigation, search
(More consistancy (Previously: 50 different ways to type web ui).)
(completely rearranged , removed code referring to daemon control)
Line 4: Line 4:
 
[[Category:Internet Applications]]
 
[[Category:Internet Applications]]
  
 
+
[http://deluge-torrent.org/ Deluge] is a full-featured  BitTorrent client for Linux, OS X, Unix and Windows. It uses  libtorrent in its backend and features multiple user-interfaces including: GTK+, web and console. It has been designed using the client server model with a daemon process that handles all the bittorrent activity. The Deluge daemon is able to run on headless machines with the user-interfaces being able to connect remotely from any platform. Deluge is not designed for any one desktop environment and will work just fine in GNOME, KDE, XFCE and others. Deluge is  Free Software and is licensed under the  GNU General Public License.
 
 
This article will show you how to set up Deluge also for daemon-based torrenting.
 
  
 
==Base Install==
 
==Base Install==
Deluge is available in the official repositories:
+
[[pacman| Install]] {{Pkg|deluge}} from the [[official repositories]].
# pacman -S deluge
 
 
 
==Graphical Clients==
 
===Web UI===
 
The web UI runs on the server and the clients only need a web browser.
 
You need to install '''python2-mako''' on the server:
 
# pacman -S python2-mako
 
 
 
===GTK UI===
 
The GTK UI needs to have '''pygtk''' and '''librsvg''' installed on the clients:
 
# pacman -S pygtk librsvg
 
  
 
==Configuration==
 
==Configuration==
Line 27: Line 14:
  
 
===daemon===
 
===daemon===
Please note, deluge works perfectly fine without its daemon running.
+
Please note, deluge works perfectly fine without its daemon running. The default user for the Deluge daemon, is '''deluge''', which is created upon package installation. You can change this in {{ic|/etc/conf.d/deluged}}. Of course, the user needs to exist.
The default user for deluged, the Deluge daemon, is "deluge". You can change this in {{ic|/etc/conf.d/deluged}}. Of course, the user needs to exist. In the case of the default "deluge" user, no manual user creation is necessary as the package script has done that for you.
 
  
The rest of this guide will assume you use the default "deluge" user. This is that user's default home directory and therefore its configuration location is in ''/srv/deluge''. This should be fine under most circumstances. Note that this is NOT the default download location, it only holds its configuration and ssl certificates. You will be able to change all other options later on once you get a client working.
+
The rest of this guide will assume you use the default '''deluge''' user. This is that user's default home directory and therefore its configuration location is in {{ic|/srv/deluge}}. This should be fine under most circumstances. Note that this is NOT the default download location, it only holds its configuration and ssl certificates. You will be able to change all other options later on once you get a client working.
  
Next, start the daemon to generate its default configuration in its home directory:
+
Next, start the [[daemon]] to generate its default configuration in its home directory:
# rc.d start deluged
 
  
And add it to your {{ic|/etc/rc.conf}}, so it gets convieniently autostarted:
+
==Graphical Clients==
DAEMONS=( ... network '''deluged''' ... )
 
  
===GTK UI===
+
===Web UI===
Stop the Deluge daemon:
+
The web UI daemon runs on the server and the clients only need a web browser. You need to install {{Pkg|python2-mako}} on the server.
# rc.d stop deluged
+
 
 +
First, start the web UI [[daemon]], named ''deluge-web'', and login at {{ic|http://''ip-address'':8112}}. Where ''ip-address'' is the name of your Deluge server or its private or public IP address. When asked for a password, enter "deluge" as it is the default password.
 +
 
 +
The preferences in the web UI should be rather self explanatory and the first obvious thing to do is to change your password.
  
If You want to connect remotely via the GTK UI, there should be something like this in {{ic|/srv/deluge/.config/deluge/core.conf}}:
+
====Automatically Connect To Daemon====
  "allow_remote": true,
+
If you want to avoid clicking "connect" everytime you start the Deluge web UI, edit the {{ic|web.conf}} file in your configuration directory (usually {{ic|/srv/deluge/.config/deluge}}). 
 +
It should have a line like this towards the bottom:
 +
'''
 +
  "default_daemon": ""
  
Now add yourself to the authentification file:
+
Change it to:
  # echo "yourusername:yourpassword:10" >> /srv/deluge/.config/deluge/auth
+
  '''
 +
"default_daemon": "127.0.0.1:58846"  
  
'''10''', the authentification level is not used at this time. Read [http://dev.deluge-torrent.org/wiki/UserGuide/Authentication more] about that.
+
This assumes that your Deluge port is the default 58846.
  
Start the Deluge daemon again.
+
====SSL====
 +
In case you want SSL for the web UI, you need to generate a new cert/key set. To do this, first stop the web UI daemon and then append to {{ic|/srv/deluge/.config/deluge/ssl/}}:
  
Now start the GTK UI. If You prefer, You can edit the preferences in {{ic|~/.config/deluge/gtkui.conf}}, but there's also a nice configuration tool in the UI.
+
# openssl req -new -x509 -nodes -out deluge.cert.pem -keyout deluge.key.pem
  
Look for '''classic mode''' and disable it. Then go to Edit -> Connection Manager and add your daemon.
+
Next you need to edit {{ic|/srv/deluge/.config/deluge/web.conf}} and change the '''pkey''' and '''cert''' configuration directives to use your new self-signed certificates and also enable SSL:
 +
...
 +
"pkey": "ssl/deluge.key.pem",
 +
...
 +
"cert": "ssl/deluge.cert.pem",
 +
...
 +
"https": true,
  
===Web UI===
+
Afterwards just start the web UI daemon again.
First, start the web UI daemon:
 
# rc.d start deluge-web
 
  
and login in on ''http://deluge-machine:8112''. Where 'deluge-machine' is name of your Deluge server or its private or public IP address. When asked for a password, enter "deluge" as it's the default password.
+
====Apache configuration====
  
The preferences in the web UI should be rather self explanatory and the first obvious thing to do is to change your password.
+
As of this writing, it is possible to use ProxyPass and ProxyPassReverse with Apache to run your Deluge web UI with a web server. To do so, install {{AUR|mod_proxy_html}} from the [[AUR]]. Then add the following lines to your {{ic|httpd.conf}}.
  
As usual, you should add the daemons to your {{ic|/etc/rc.conf}}:
+
In the modules section add:
DAEMONS=( ... network deluged '''deluge-web''' ... )
 
  
Just make sure your network connection is up at the time you start either of those Deluge daemons.
+
LoadModule proxy_html_module modules/mod_proxy_html.so
  
{{Note|In the current version of Deluge (1.3.1) the web UI will not work in Google Chrome unless system time is configured properly. The web UI will load, but upon entry of your password on the password prompt, it will return as if nothing had been entered. This is Chrome thinking the session has expired. The quick and easy way of solving this issue is to install the [[Network Time Protocol daemon|ntp]] package and add ''ntpd'' to your DAEMONS in {{ic|/etc/rc.conf}}.}}
+
At the end of the file, in the Supplemental Configuration section, add the following two lines:
  
As of this writing, it is possible to use ProxyPass and ProxyPassReverse with Apache to run your Deluge web UI with a web server. To do so, install mod_proxy_html from the AUR. Then add the following lines to your httpd.conf.
+
# Custom proxy html configuration
 +
Include conf/extra/httpd-proxy-html.conf
  
In the modules section add:
+
Also uncomment the Virtual Hosts line:
  
{{Ic|LoadModule proxy_html_module modules/mod_proxy_html.so}}
+
Include conf/extra/httpd-vhosts.conf
  
At the end of the file, in the Supplemental Configuration section, add the following two lines.
+
That is all the editing that needs to be done for the {{ic|httpd.conf}}. Next, navigate to the {{ic|extra/}} folder and edit the {{ic|httpd-vhosts.conf}} file. Append to the file, the following:
  
{{Ic|# Custom proxy html configuration <br> Include conf/extra/httpd-proxy-html.conf}}
+
{{bc|<VirtualHost *:80>
  
Also uncomment the Virtual Hosts line.
+
Servername dmz
  
{{Ic|Include conf/extra/httpd-vhosts.conf}}
+
ProxyRequests off
 +
ProxyHTMLExtended on
 +
ProxyPass /deluge http://127.0.0.1:8112/
 +
ProxyHTMLURLMap http://127.0.0.1:8112 /deluge
  
That is all the editing that needs to be done for the httpd.conf. Next, navigate to the extra/ folder and edit the httpd-vhosts.conf file. Append to the file, the following.
+
Header unset Server
  
{{Bc|<VirtualHost *:80> <br>
 
<br>
 
Servername dmz <br>
 
<br>
 
ProxyRequests off <br>
 
ProxyHTMLExtended on <br>
 
ProxyPass /deluge http://127.0.0.1:8112/ <br>
 
ProxyHTMLURLMap http://127.0.0.1:8112 /deluge <br>
 
<br>
 
Header unset Server <br>
 
<br>
 
 
<location /deluge>  
 
<location /deluge>  
         ProxyPassReverse / <br>
+
         ProxyPassReverse /  
         ProxyPassReverseCookiePath / /deluge/ <br>
+
         ProxyPassReverseCookiePath / /deluge/
         SetOutputFilter INFLATE;proxy-html;DEFLATE <br>
+
         SetOutputFilter INFLATE;proxy-html;DEFLATE
 
         ProxyHTMLURLMap / /deluge/ ec <br>
 
         ProxyHTMLURLMap / /deluge/ ec <br>
 
         ProxyHTMLURLMap /deluge /deluge ec <br>
 
         ProxyHTMLURLMap /deluge /deluge ec <br>
         ProxyHTMLURLMap ([^*])(\/[^*].*) $1/deluge$2 hRxL <br>
+
         ProxyHTMLURLMap ([^*])(\/[^*].*) $1/deluge$2 hRxL
         #ProxyHTMLLogVerbose On <br>
+
         #ProxyHTMLLogVerbose On
         Order allow,deny <br>
+
         Order allow,deny
         Allow from all <br>
+
         Allow from all
</Location> <br>
+
</Location>
<br>
+
 
</VirtualHost> <br>
+
</VirtualHost>
 
}}
 
}}
  
 
See http://blog.stoked-security.com/2011/03/deluge-bittorrent-webui-behind-reverse.html for the source and more information.
 
See http://blog.stoked-security.com/2011/03/deluge-bittorrent-webui-behind-reverse.html for the source and more information.
  
==Automatically Connect To Daemon==
+
===GTK UI===
If you want to avoid clicking "connect" everytime you start the Deluge web UI, edit the web.conf file in your configuration directory (usually /srv/deluge/.config/deluge). 
+
The GTK UI needs to have {{Pkg|pygtk}} and {{Pkg|librsvg}} installed on the clients.
It should have a line like this towards the bottom:
+
If the deluge daemon is running stop it.
'''
 
"default_daemon": ""
 
  
Change it to:
+
In order to connect remotely via the GTK UI, there should be something like this in {{ic|/srv/deluge/.config/deluge/core.conf}}:
  '''
+
  "allow_remote": true,
"default_daemon": "127.0.0.1:58846"
 
  
This assumes that your Deluge port is the default 58846.
+
Now add yourself to the authentification file:
 +
# echo "yourusername:yourpassword:10" >> /srv/deluge/.config/deluge/auth
  
====SSL====
+
The authentification level is not used at this time. Read [http://dev.deluge-torrent.org/wiki/UserGuide/Authentication more] about that.
In case you want SSL for the web UI, you need to generate a new cert/key set. To do this, first stop the web UI:
 
  
# rc.d stop deluge-web
+
Start the Deluge daemon again.
  
then go to ''/srv/deluge/.config/deluge/ssl/'' and issue:
+
Now start the GTK UI. If you prefer, you can edit the preferences in {{ic|~/.config/deluge/gtkui.conf}}, but there's also a nice configuration tool in the UI.
  
# openssl req -new -x509 -nodes -out deluge.cert.pem -keyout deluge.key.pem
+
Look for '''classic mode''' and disable it. Then go to Edit -> Connection Manager and add your daemon.
  
Next you need to edit {{ic|/srv/deluge/.config/deluge/web.conf}} and change the '''pkey''' and '''cert''' configuration directives to use your new self-signed certificates and also enable SSL:
+
==Troubleshooting==
...
 
"pkey": "ssl/deluge.key.pem",
 
...
 
"cert": "ssl/deluge.cert.pem",
 
...
 
"https": true,
 
 
 
Afterwards just start the web UI again and you should be good to go:
 
 
 
# rc.d start deluge-web
 
  
==Troubleshooting==
 
 
=== Web UI doesn't store settings ===
 
=== Web UI doesn't store settings ===
 
For some yet unknown reason, the web interface with Deluge 1.3.3 refuses to properly store the incoming (listen) ports configuration. This can manually be edited in core.conf. The Deluge bugtracker mentions this is fixed, it is not in 1.3.3.
 
For some yet unknown reason, the web interface with Deluge 1.3.3 refuses to properly store the incoming (listen) ports configuration. This can manually be edited in core.conf. The Deluge bugtracker mentions this is fixed, it is not in 1.3.3.
Line 161: Line 135:
 
  ...}}
 
  ...}}
  
==Resources==
+
==See also==
 
[http://deluge-torrent.org/ Deluge Homepage]
 
[http://deluge-torrent.org/ Deluge Homepage]

Revision as of 21:35, 9 September 2012


Deluge is a full-featured BitTorrent client for Linux, OS X, Unix and Windows. It uses libtorrent in its backend and features multiple user-interfaces including: GTK+, web and console. It has been designed using the client server model with a daemon process that handles all the bittorrent activity. The Deluge daemon is able to run on headless machines with the user-interfaces being able to connect remotely from any platform. Deluge is not designed for any one desktop environment and will work just fine in GNOME, KDE, XFCE and others. Deluge is Free Software and is licensed under the GNU General Public License.

Base Install

Install deluge from the official repositories.

Configuration

If you want to run Deluge as user just run:

# deluge -u [gtk|web|console]

daemon

Please note, deluge works perfectly fine without its daemon running. The default user for the Deluge daemon, is deluge, which is created upon package installation. You can change this in /etc/conf.d/deluged. Of course, the user needs to exist.

The rest of this guide will assume you use the default deluge user. This is that user's default home directory and therefore its configuration location is in /srv/deluge. This should be fine under most circumstances. Note that this is NOT the default download location, it only holds its configuration and ssl certificates. You will be able to change all other options later on once you get a client working.

Next, start the daemon to generate its default configuration in its home directory:

Graphical Clients

Web UI

The web UI daemon runs on the server and the clients only need a web browser. You need to install python2-mako on the server.

First, start the web UI daemon, named deluge-web, and login at http://ip-address:8112. Where ip-address is the name of your Deluge server or its private or public IP address. When asked for a password, enter "deluge" as it is the default password.

The preferences in the web UI should be rather self explanatory and the first obvious thing to do is to change your password.

Automatically Connect To Daemon

If you want to avoid clicking "connect" everytime you start the Deluge web UI, edit the web.conf file in your configuration directory (usually /srv/deluge/.config/deluge). It should have a line like this towards the bottom:

"default_daemon": "" 

Change it to:

"default_daemon": "127.0.0.1:58846" 

This assumes that your Deluge port is the default 58846.

SSL

In case you want SSL for the web UI, you need to generate a new cert/key set. To do this, first stop the web UI daemon and then append to /srv/deluge/.config/deluge/ssl/:

# openssl req -new -x509 -nodes -out deluge.cert.pem -keyout deluge.key.pem

Next you need to edit /srv/deluge/.config/deluge/web.conf and change the pkey and cert configuration directives to use your new self-signed certificates and also enable SSL:

...
"pkey": "ssl/deluge.key.pem",
...
"cert": "ssl/deluge.cert.pem",
...
"https": true,

Afterwards just start the web UI daemon again.

Apache configuration

As of this writing, it is possible to use ProxyPass and ProxyPassReverse with Apache to run your Deluge web UI with a web server. To do so, install mod_proxy_htmlAUR from the AUR. Then add the following lines to your httpd.conf.

In the modules section add:

LoadModule proxy_html_module modules/mod_proxy_html.so

At the end of the file, in the Supplemental Configuration section, add the following two lines:

# Custom proxy html configuration
Include conf/extra/httpd-proxy-html.conf

Also uncomment the Virtual Hosts line:

Include conf/extra/httpd-vhosts.conf

That is all the editing that needs to be done for the httpd.conf. Next, navigate to the extra/ folder and edit the httpd-vhosts.conf file. Append to the file, the following:

<VirtualHost *:80>

Servername dmz

ProxyRequests off
ProxyHTMLExtended on
ProxyPass /deluge http://127.0.0.1:8112/
ProxyHTMLURLMap http://127.0.0.1:8112 /deluge

Header unset Server 

<location /deluge> 
        ProxyPassReverse / 
        ProxyPassReverseCookiePath / /deluge/
        SetOutputFilter INFLATE;proxy-html;DEFLATE
        ProxyHTMLURLMap / /deluge/ ec 
ProxyHTMLURLMap /deluge /deluge ec
ProxyHTMLURLMap ([^*])(\/[^*].*) $1/deluge$2 hRxL #ProxyHTMLLogVerbose On Order allow,deny Allow from all </Location> </VirtualHost>

See http://blog.stoked-security.com/2011/03/deluge-bittorrent-webui-behind-reverse.html for the source and more information.

GTK UI

The GTK UI needs to have pygtk and librsvg installed on the clients. If the deluge daemon is running stop it.

In order to connect remotely via the GTK UI, there should be something like this in /srv/deluge/.config/deluge/core.conf:

"allow_remote": true,

Now add yourself to the authentification file:

# echo "yourusername:yourpassword:10" >> /srv/deluge/.config/deluge/auth

The authentification level is not used at this time. Read more about that.

Start the Deluge daemon again.

Now start the GTK UI. If you prefer, you can edit the preferences in ~/.config/deluge/gtkui.conf, but there's also a nice configuration tool in the UI.

Look for classic mode and disable it. Then go to Edit -> Connection Manager and add your daemon.

Troubleshooting

Web UI doesn't store settings

For some yet unknown reason, the web interface with Deluge 1.3.3 refuses to properly store the incoming (listen) ports configuration. This can manually be edited in core.conf. The Deluge bugtracker mentions this is fixed, it is not in 1.3.3.

/srv/deluge/.config/deluge/core.conf
...
 "enc_prefer_rc4": true, 
 "listen_ports": [
   49160, 
   49249
 ], 
 "dht": false, 
 ...

See also

Deluge Homepage