Difference between revisions of "Deluge"

From ArchWiki
Jump to: navigation, search
(Downloads Don't Start)
(37 intermediate revisions by 10 users not shown)
Line 3: Line 3:
 
[[ko:Deluge]]
 
[[ko:Deluge]]
 
[[Category:Internet Applications]]
 
[[Category:Internet Applications]]
 +
{{Article summary start}}
 +
{{Article summary text|Deluge is a lightweight, BitTorrent client written in python that offers users a powerful client/server architecture.  Once a headless daemon has been setup, user can interact with it in three ways including a WebUI, GTK-UI, and console interface.}}
 +
{{Article summary heading|Related Articles}}
 +
{{Article summary wiki|PeerGuardian Linux}}
 +
{{Article summary wiki|Ufw}}
 +
{{Article summary heading|External Links}}
 +
{{Article summary wiki|http://dev.deluge-torrent.org/wiki Official Deluge Wiki}}
 +
{{Article summary end}}
  
 
+
==Installation==
 
+
{{Pkg|deluge}} is available from the [[official repositories]].
This article will show you how to set up Deluge also for daemon-based torrenting.
+
 
+
==Base Install==
+
Deluge is available in the official repositories:
+
 
  # pacman -S deluge
 
  # pacman -S deluge
  
==Graphical Clients==
+
The gtk UI requires additional dependencies as does the webui.  Inspect the pacman output to determine which are right for the intended application.
===Web ui===
+
python2-notify: libnotify notifications
The Web-ui runs on the server and the clients only need a Web-Browser.
+
pygtk: needed for gtk ui
You need to install '''python2-mako''' on the server:
+
librsvg: needed for gtk ui
  # pacman -S python2-mako
+
  python2-mako: needed for web ui
  
===Gtk ui===
+
==Daemon Setup==  
The Gtk ui needs to have '''pygtk''' and '''librsvg''' installed on the clients:
+
Deluge can run as a system daemon which is accessible to any system user or it can run in a non-daemon mode.  The focus of this article is on the daemon mode of operation. Users wishing a more simplistic setup, i.e. running {{ic|/usr/bin/deluged}} as them-self should be able to read on and simply substitute the systemctl commands for the live files on the system.
  # pacman -S pygtk librsvg
+
  
==Configuration==
+
{{Note|Advanced users are free to edit the configuration files in the deluge daemon home directory {{ic|/srv/deluge/.config/}} manually or from the {{ic|/usr/bin/deluge-console}}. The rest of this guide is written using the gtk client to do this from convenience of a GUI.}}
If You want to run Deluge as user just run:
+
# deluge -u [gtk|web|console]
+
  
===daemon===
+
Start the deluge backend daemon like any other systemd service:
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.
+
# systemd start deluged
  
The rest of this guide will assume you use the default "deluge" user. This user's default home dir 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.
+
=== Create a User ===
 +
To allow interaction with the daemon, create a user:password:level in {{ic|/srv/deluge/.config/deluge/auth}}.
 +
For example:
 +
# echo "delugeuser:p422WoRd:10" >> /srv/deluge/.config/deluge/auth
 +
{{Note|The user/password created does not have to match any system users... and to maintain good security practices it should NOT!}}
  
Next, start the daemon to generate its default configuration in its homedir:
+
The number '''10''' corresponds to a level of 'Admin.'  Refer to the following table for additional values:
# rc.d start deluged
+
  
And add it to Your {{ic|/etc/rc.conf}}, so it gets convieniently autostarted:
+
{| class="wikitable" align="center"
DAEMONS=( ... network '''deluged''' ... )
+
|-
 +
! Level Name !! Level Value
 +
|-
 +
| None || 0
 +
|-
 +
|Read Only || 1
 +
|-
 +
| Normal || 5
 +
|-
 +
| Admin || 10
 +
|}
  
===Gtk ui===
+
{{Note|In Deluge 1.35, these values have no effect, but multiuser options are under development.}}
Stop the Deluge daemon:
+
# rc.d stop deluged
+
  
If You want to connect remotely via the Gtk ui, there should be something like this in {{ic|/srv/deluge/.config/deluge/core.conf}}:
+
=== Define Options ===
"allow_remote": true,
+
#Load the gtk client {{ic|/usr/bin/deluge-gtk}}  
 +
#Disable '''classic mode''' from the Edit>Preferences>Interface.
  
Now add yourself to the authentification file:
+
A restart of the client is required for these changes to take effect. Exit the client and reload it.
  # echo "yourusername:yourpassword:10" >> /srv/deluge/.config/deluge/auth
+
  
'''10''', the authentification level is not used at this time. Read [http://dev.deluge-torrent.org/wiki/UserGuide/Authentication more] about that.
+
#Setup the client to point to the daemon from Edit>Connection Manager.
 +
#Delete the dummy server by hightlighting it and clicking the "Remove" button.
 +
#Create an entry to the daemon via the "Add" button populating the resulting dialog with either the IP address or the word "localhost" as the hostname. Populate the "Username" and "Password" fields with the username and password used in the daemons setup. and then click the "+ Add" button.
  
Start the Deluge daemon again.
+
Hostname: localhost
 +
Username: delugeuser
 +
Password: p422WoRd:10
  
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.
+
If the correct credentials were populated, a green light should appear options for interaction  adjacent to the name of the server. To connect, hit the "Connect" button.
  
Look for '''classic mode''' and disable it. Have You seen an icon just pop up? Hit it! If not go to Edit -> Connection Manager and add Your daemon.
+
Users can now configure their server from the GUI.  Most of the options are self explanatory and intuitive. More details are available on the official [http://dev.deluge-torrent.org/wiki/UserGuide/BandwidthTweaking Deluge wiki] for details.
  
===Web ui===
+
{{Note|When defining paths under Preferences>Downloads make sure that the the '''deluge''' user has read/write access to whatever is defined.  Remember that the daemon is running as system user '''deluge''' in system group '''deluge'''!}}
First, start the web ui daemon:
+
{{Note|If the expectation exists to allow access from other machines, be sure to enable Preferences>Daemon>Connections>Allow Remote Connections.}}
# 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.
+
== Interacting with the Daemon ==
 +
As previously mentioned, users have three options to connect to the daemon:
 +
#Deluge-GTK
 +
#Deluge-Web
 +
#Deluge-console
  
The preferences in the web ui should be rather self explanatory and the first obvious thing to do is to change your password.
+
=== Deluge-Gtk ===
 +
The gtk client has already been covered in the previous section.  Users should now have a fully functional client.
  
As usual, you should add the daemons to your {{ic|/etc/rc.conf}}:
+
===Deluge-Web (Optional) ===
DAEMONS=( ... network deluged '''deluge-web''' ... )
+
{{Warning|Running the web client without encryption can be a bad idea.  It is therefore recommended that users enable https.}}
 +
To enable encrypted connections to/from the daemon, simply edit the '''https''' variable in {{ic|/srv/deluge/.config/deluge/web.conf}} changing the default value of '''false''' to '''true''' as shown:
 +
"https": true,
  
Just make sure your network connection is up at the time you start either of those Deluge daemons.
+
Take note of the doublequotes and the trailing comma!
  
{{Note|In the current version of Deluge (1.3.1) the WebUI will not work in Google Chrome unless system time is configured properly. The WebUI will load, but upon entry of 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}}.}}
+
Users wishing to regenerate self-signed certificates can refer to [http://httpd.apache.org/docs/2.0/ssl/ssl_faq.html#selfcert this link].
  
As of this writing, it is possible to use ProxyPass and ProxyPassReverse with Apache to run your deluge webUI with a web server.
+
To run the web ui, simply start the web-daemon:
to do so, install mod_proxy_html from the AUR. Then add the following lines to your httpd.conf.
+
# systemctl start deluge-web
  
In the modules section add.  
+
Point a browser to {{ic|https://localhost:8112}}.  Substitute the word '''localhost''' with an IP address if the server is elsewhere.
 +
When asked for a password, enter "deluge" as it is the default password.
  
{{Ic|LoadModule proxy_html_module modules/mod_proxy_html.so}}
+
The preferences in the web UI is ''highly'' similar to the gtk UI.  As explained in the previous section, edit the connection manager and define an entry to the daemon using the same credentials used in the setup step.  Once finished, users are free to remove the dummy server entry.
  
At the end of the file, in the Supplemental Configuration section, add the following two lines.
+
Hostname: localhost
 +
Username: delugeuser
 +
Password: p422WoRd:10
  
{{Ic|# Custom proxy html configuration <br> Include conf/extra/httpd-proxy-html.conf}}
+
=== Deluge-Console (Optional) ===
 +
The CLI client {{ic|/usr/bin/deluge-consle}} can also be used to connect to a running daemon.  Invoke it from a shell.  To connect, simply type:
 +
connect localhost delugeuser p422WoRd:10
  
Also uncomment the Virtual Hosts line.
+
==Troubleshooting==
 +
=== Magnet Links Are Broken with Chromium ===
 +
The following command should return "deluge.desktop":
 +
$ xdg-mime query default "x-scheme-handler/magnet"
  
{{Ic|Include conf/extra/httpd-vhosts.conf}}
+
If it returns a null, run this command:
 +
$ xdg-mime default deluge.desktop application/x-bittorrent x-scheme-handler/magnet
  
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.
+
Reference: https://bugs.archlinux.org/task/28011
  
{{Bc|<VirtualHost *:80> <br>
+
=== Downloads Don't Start ===
<br>
+
As of libtorrent-rasterbar version 0.16, Deluge will not download torrents that are added by a magnet link.
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>
+
        ProxyPassReverse / <br>
+
        ProxyPassReverseCookiePath / /deluge/ <br>
+
        SetOutputFilter INFLATE;proxy-html;DEFLATE <br>
+
        ProxyHTMLURLMap / /deluge/ ec <br>
+
        ProxyHTMLURLMap /deluge /deluge ec <br>
+
        ProxyHTMLURLMap ([^*])(\/[^*].*) $1/deluge$2 hRxL <br>
+
        #ProxyHTMLLogVerbose On <br>
+
        Order allow,deny <br>
+
        Allow from all <br>
+
</Location> <br>
+
<br>
+
</VirtualHost> <br>
+
}}
+
  
See http://blog.stoked-security.com/2011/03/deluge-bittorrent-webui-behind-reverse.html for the source and more information.
+
* https://bugs.archlinux.org/task/29414
 +
* https://bbs.archlinux.org/viewtopic.php?id=151249
  
==Automatically Connect To Daemon==
+
Downgrading libtorrent-rasterbar to 1:0.16.3-1 should fix it.
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:
+
 
+
# rc.d stop deluge-web
+
 
+
then go to ''/srv/deluge/.config/deluge/ssl/'' and issue:
+
 
+
# openssl req -new -x509 -nodes -out deluge.cert.pem -keyout deluge.key.pem
+
 
+
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,
+
 
+
Afterwards just start the web ui again and you should be good to go:
+
 
+
# rc.d start deluge-web
+
 
+
==Troubleshooting==
+
=== WebUI 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.
+
  
{{hc|/srv/deluge/.config/deluge/core.conf|...
+
<nowiki># pacman -U http://arm.konnichi.com/extra/os/$(uname -m)/libtorrent-rasterbar-1:0.16.3-1-$(uname -m).pkg.tar.xz</nowiki>
"enc_prefer_rc4": true,
+
"listen_ports": [
+
  49160,
+
  49249
+
],
+
"dht": false,
+
...}}
+
  
==Resources==
+
Remember to add '''libtorrent-rasterbar''' to an IgnorePkg line in {{ic|/etc/pacman.conf}} to keep it from being updated until a fix is completed.
[http://deluge-torrent.org/ Deluge Homepage]
+

Revision as of 17:20, 1 January 2013

Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary wiki Template:Article summary heading Template:Article summary wiki Template:Article summary end

Installation

deluge is available from the official repositories.

# pacman -S deluge

The gtk UI requires additional dependencies as does the webui. Inspect the pacman output to determine which are right for the intended application.

python2-notify: libnotify notifications
pygtk: needed for gtk ui
librsvg: needed for gtk ui
python2-mako: needed for web ui

Daemon Setup

Deluge can run as a system daemon which is accessible to any system user or it can run in a non-daemon mode. The focus of this article is on the daemon mode of operation. Users wishing a more simplistic setup, i.e. running /usr/bin/deluged as them-self should be able to read on and simply substitute the systemctl commands for the live files on the system.

Note: Advanced users are free to edit the configuration files in the deluge daemon home directory /srv/deluge/.config/ manually or from the /usr/bin/deluge-console. The rest of this guide is written using the gtk client to do this from convenience of a GUI.

Start the deluge backend daemon like any other systemd service:

# systemd start deluged

Create a User

To allow interaction with the daemon, create a user:password:level in /srv/deluge/.config/deluge/auth. For example:

# echo "delugeuser:p422WoRd:10" >> /srv/deluge/.config/deluge/auth
Note: The user/password created does not have to match any system users... and to maintain good security practices it should NOT!

The number 10 corresponds to a level of 'Admin.' Refer to the following table for additional values:

Level Name Level Value
None 0
Read Only 1
Normal 5
Admin 10
Note: In Deluge 1.35, these values have no effect, but multiuser options are under development.

Define Options

  1. Load the gtk client /usr/bin/deluge-gtk
  2. Disable classic mode from the Edit>Preferences>Interface.

A restart of the client is required for these changes to take effect. Exit the client and reload it.

  1. Setup the client to point to the daemon from Edit>Connection Manager.
  2. Delete the dummy server by hightlighting it and clicking the "Remove" button.
  3. Create an entry to the daemon via the "Add" button populating the resulting dialog with either the IP address or the word "localhost" as the hostname. Populate the "Username" and "Password" fields with the username and password used in the daemons setup. and then click the "+ Add" button.
Hostname: localhost
Username: delugeuser
Password: p422WoRd:10

If the correct credentials were populated, a green light should appear options for interaction adjacent to the name of the server. To connect, hit the "Connect" button.

Users can now configure their server from the GUI. Most of the options are self explanatory and intuitive. More details are available on the official Deluge wiki for details.

Note: When defining paths under Preferences>Downloads make sure that the the deluge user has read/write access to whatever is defined. Remember that the daemon is running as system user deluge in system group deluge!
Note: If the expectation exists to allow access from other machines, be sure to enable Preferences>Daemon>Connections>Allow Remote Connections.

Interacting with the Daemon

As previously mentioned, users have three options to connect to the daemon:

  1. Deluge-GTK
  2. Deluge-Web
  3. Deluge-console

Deluge-Gtk

The gtk client has already been covered in the previous section. Users should now have a fully functional client.

Deluge-Web (Optional)

Warning: Running the web client without encryption can be a bad idea. It is therefore recommended that users enable https.

To enable encrypted connections to/from the daemon, simply edit the https variable in /srv/deluge/.config/deluge/web.conf changing the default value of false to true as shown:

"https": true,

Take note of the doublequotes and the trailing comma!

Users wishing to regenerate self-signed certificates can refer to this link.

To run the web ui, simply start the web-daemon:

# systemctl start deluge-web

Point a browser to https://localhost:8112. Substitute the word localhost with an IP address if the server is elsewhere. When asked for a password, enter "deluge" as it is the default password.

The preferences in the web UI is highly similar to the gtk UI. As explained in the previous section, edit the connection manager and define an entry to the daemon using the same credentials used in the setup step. Once finished, users are free to remove the dummy server entry.

Hostname: localhost
Username: delugeuser
Password: p422WoRd:10

Deluge-Console (Optional)

The CLI client /usr/bin/deluge-consle can also be used to connect to a running daemon. Invoke it from a shell. To connect, simply type:

connect localhost delugeuser p422WoRd:10

Troubleshooting

Magnet Links Are Broken with Chromium

The following command should return "deluge.desktop":

$ xdg-mime query default "x-scheme-handler/magnet"

If it returns a null, run this command:

$ xdg-mime default deluge.desktop application/x-bittorrent x-scheme-handler/magnet

Reference: https://bugs.archlinux.org/task/28011

Downloads Don't Start

As of libtorrent-rasterbar version 0.16, Deluge will not download torrents that are added by a magnet link.

Downgrading libtorrent-rasterbar to 1:0.16.3-1 should fix it.

# pacman -U http://arm.konnichi.com/extra/os/$(uname -m)/libtorrent-rasterbar-1:0.16.3-1-$(uname -m).pkg.tar.xz

Remember to add libtorrent-rasterbar to an IgnorePkg line in /etc/pacman.conf to keep it from being updated until a fix is completed.