├── GeoIP.zip ├── README.md └── deluge_webui.sh /GeoIP.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maulvi/Deluge-WebUI-Installer/31d90768f515e885ade67fa012044b2f52e2baa8/GeoIP.zip -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Deluge WebUI Installer script 2 | 3 | For Debian 7/8 and Ubuntu 12/14/16 Based environment 4 | 5 | -tested with 18 but daemon service won't start 6 | 7 | This script install the latest version available 8 | ``` 9 | sudo bash -c "$(wget --no-check-certificate -qO - https://raw.githubusercontent.com/maulvi/Deluge-WebUI-Installer/master/deluge_webui.sh)" 10 | ``` 11 | ``` 12 | the default password is: deluge 13 | ``` 14 | ThinClient/Daemon Configuration Deluge - Daemon/ThinClient Settings 15 | 16 | This is one of the neatest features about Deluge, you can use a local GUI client instead of the WebUI to download torrents remotely onto your VPS. There are two ways to go about this, one way is to use a VPN or SSH tunnel to connect to your VPS and then connect to the Deluge daemon locally. 17 | 18 | The easier method is to check Allow Remote Connections as shown above. Now you’ll need to install Deluge on your PC. 19 | Once installed, 20 | go to Edit >> Preferences >> Interface – You need to uncheck Classic Mode Enable. 21 | Deluge will restart after you have applied this change. Now you need to add an authenticated user, you’ll do this by going to your Deluge user’s home directory. 22 | If the user you created was deluge-torrent, it would be: cd /home/deluge-torrent/ Add your new user to the auth file like so: 23 | 24 | ``` 25 | echo "username:strongpassword:10" >> ./.config/deluge/auth 26 | 27 | ## Restart Deluge ## 28 | /etc/init.d/deluge-daemon restart 29 | ``` 30 | Now go back to your desktop Deluge and setup the connection to your server, Deluge - Desktop Connection Manager 31 | 32 | If you’ve done everything correctly, you should see a green dot next to your hostname and you’ll be able to hit Connect. 33 | 34 | 35 | 36 | 37 | source: [sonicboxes](https://sonicboxes.com) 38 | -------------------------------------------------------------------------------- /deluge_webui.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ##################################################### 3 | ## Deluge BitTorrent Daemon ## 4 | ## v.1.3.15 ## 5 | ## ## 6 | ##################################################### 7 | ## setup variables ## 8 | latest="http://download.deluge-torrent.org/source/deluge-1.3.15.tar.gz" 9 | #geoip="http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz" 10 | geoip="https://github.com/maulvi/Deluge-WebUI-Installer/raw/master/GeoIP.zip" 11 | packages="curl unzip python python-twisted python-twisted-web python-openssl python-simplejson python-setuptools intltool python-xdg python-chardet geoip-database python-libtorrent python-notify python-pygame python-glade2 librsvg2-common xdg-utils python-mako" 12 | ip=$(hostname -I | awk -F ' ' '{print $2}') 13 | # Check if we're root 14 | if [ $(whoami) != "root" ]; then 15 | echo "You need to run this script as root." 16 | echo "Use 'sudo ./deluge_web.sh' then enter your password when prompted." 17 | exit 1 18 | fi 19 | clear 20 | ## get packages required to build deluge ## 21 | echo "Installing Dependencies....." 22 | apt-get update -qq 23 | apt-get upgrade -qqy 24 | apt-get install -qqy $packages 25 | 26 | ## setup install dir ## 27 | mkdir deluge_install 28 | cd deluge_install 29 | ## get deluge 30 | wget $latest 31 | tar -xf deluge-* 32 | cd deluge-* 33 | 34 | ## install deluge ## 35 | echo " Installing Deluge...." 36 | python setup.py clean -a 37 | python setup.py build 38 | python setup.py install --install-layout=deb 39 | 40 | ## cleanup install directory ## 41 | cd ../.. 42 | rm -rf deluge_install 43 | clear 44 | ## install geoip database to resolve ips ## 45 | echo " Installing GeoIP Database...." 46 | wget $geoip 47 | unzip GeoIP.zip 48 | mkdir -p /usr/share/geoip 49 | mv GeoIP/GeoIP.dat /usr/share/geoip/ 50 | 51 | ## setup deluge user 52 | echo "Now we will setup a user for Deluge" 53 | read -p "What would you like the username to be? " USERNAME 54 | adduser --gecos "" $USERNAME 55 | 56 | ####################### BEGIN INIT SETUP ############################### 57 | ## setup defaults ## 58 | 59 | cat > /etc/default/deluge-daemon << EOF 60 | # Configuration for /etc/init.d/deluge-daemon 61 | 62 | # The init.d script will only run if this variable non-empty. 63 | DELUGED_USER="$USERNAME" # !!!CHANGE THIS!!!! 64 | 65 | # Should we run at startup? 66 | RUN_AT_STARTUP="YES" 67 | EOF 68 | 69 | ## setup init script ## 70 | ## original script from http://apocryph.org/archives/601 ## 71 | cat > /etc/init.d/deluge-daemon << "EOF" 72 | #!/bin/sh 73 | ### BEGIN INIT INFO 74 | # Provides: deluge-daemon 75 | # Required-Start: $local_fs $remote_fs 76 | # Required-Stop: $local_fs $remote_fs 77 | # Should-Start: $network 78 | # Should-Stop: $network 79 | # Default-Start: 2 3 4 5 80 | # Default-Stop: 0 1 6 81 | # Short-Description: Daemonized version of deluge and webui. 82 | # Description: Starts the deluge daemon with the user specified in 83 | # /etc/default/deluge-daemon. 84 | ### END INIT INFO 85 | 86 | # Author: Adolfo R. Brandes 87 | # Updated by: Jean-Philippe "Orax" Roemer 88 | 89 | PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin 90 | DESC="Deluge Daemon" 91 | NAME1="deluged" 92 | NAME2="deluge" 93 | DAEMON1=/usr/bin/deluged 94 | DAEMON1_ARGS="-d" # Consult `man deluged` for more options 95 | DAEMON2=/usr/bin/deluge-web 96 | DAEMON2_ARGS="" # Consult `man deluge-web` for more options 97 | PIDFILE1=/var/run/$NAME1.pid 98 | PIDFILE2=/var/run/$NAME2.pid 99 | UMASK=022 # Change this to 0 if running deluged as its own user 100 | PKGNAME=deluge-daemon 101 | SCRIPTNAME=/etc/init.d/$PKGNAME 102 | 103 | # Exit if the package is not installed 104 | [ -x "$DAEMON1" -a -x "$DAEMON2" ] || exit 0 105 | 106 | # Read configuration variable file if it is present 107 | [ -r /etc/default/$PKGNAME ] && . /etc/default/$PKGNAME 108 | 109 | # Load the VERBOSE setting and other rcS variables 110 | [ -f /etc/default/rcS ] && . /etc/default/rcS 111 | 112 | # Define LSB log_* functions. 113 | # Depend on lsb-base (>= 3.0-6) to ensure that this file is present. 114 | . /lib/lsb/init-functions 115 | 116 | if [ -z "$RUN_AT_STARTUP" -o "$RUN_AT_STARTUP" != "YES" ] 117 | then 118 | log_warning_msg "Not starting $PKGNAME, edit /etc/default/$PKGNAME to start it." 119 | exit 0 120 | fi 121 | 122 | if [ -z "$DELUGED_USER" ] 123 | then 124 | log_warning_msg "Not starting $PKGNAME, DELUGED_USER not set in /etc/default/$PKGNAME." 125 | exit 0 126 | fi 127 | 128 | # 129 | # Function to verify if a pid is alive 130 | # 131 | is_alive() 132 | { 133 | pid=`cat $1` > /dev/null 2>&1 134 | kill -0 $pid > /dev/null 2>&1 135 | return $? 136 | } 137 | 138 | # 139 | # Function that starts the daemon/service 140 | # 141 | do_start() 142 | { 143 | # Return 144 | # 0 if daemon has been started 145 | # 1 if daemon was already running 146 | # 2 if daemon could not be started 147 | 148 | is_alive $PIDFILE1 149 | RETVAL1="$?" 150 | 151 | if [ $RETVAL1 != 0 ]; then 152 | rm -f $PIDFILE1 153 | start-stop-daemon --start --background --quiet --pidfile $PIDFILE1 --make-pidfile \ 154 | --exec $DAEMON1 --chuid $DELUGED_USER --user $DELUGED_USER --umask $UMASK -- $DAEMON1_ARGS 155 | RETVAL1="$?" 156 | else 157 | is_alive $PIDFILE2 158 | RETVAL2="$?" 159 | [ "$RETVAL2" = "0" -a "$RETVAL1" = "0" ] && return 1 160 | fi 161 | 162 | is_alive $PIDFILE2 163 | RETVAL2="$?" 164 | 165 | if [ $RETVAL2 != 0 ]; then 166 | sleep 2 167 | rm -f $PIDFILE2 168 | start-stop-daemon --start --background --quiet --pidfile $PIDFILE2 --make-pidfile \ 169 | --exec $DAEMON2 --chuid $DELUGED_USER --user $DELUGED_USER --umask $UMASK -- $DAEMON2_ARGS 170 | RETVAL2="$?" 171 | fi 172 | [ "$RETVAL1" = "0" -a "$RETVAL2" = "0" ] || return 2 173 | } 174 | 175 | # 176 | # Function that stops the daemon/service 177 | # 178 | do_stop() 179 | { 180 | # Return 181 | # 0 if daemon has been stopped 182 | # 1 if daemon was already stopped 183 | # 2 if daemon could not be stopped 184 | # other if a failure occurred 185 | 186 | start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --user $DELUGED_USER --pidfile $PIDFILE2 187 | RETVAL2="$?" 188 | start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --user $DELUGED_USER --pidfile $PIDFILE1 189 | RETVAL1="$?" 190 | [ "$RETVAL1" = "2" -o "$RETVAL2" = "2" ] && return 2 191 | 192 | rm -f $PIDFILE1 $PIDFILE2 193 | 194 | [ "$RETVAL1" = "0" -a "$RETVAL2" = "0" ] && return 0 || return 1 195 | } 196 | 197 | case "$1" in 198 | start) 199 | [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME1" 200 | do_start 201 | case "$?" in 202 | 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 203 | 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; 204 | esac 205 | ;; 206 | stop) 207 | [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME1" 208 | do_stop 209 | case "$?" in 210 | 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 211 | 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; 212 | esac 213 | ;; 214 | restart|force-reload) 215 | log_daemon_msg "Restarting $DESC" "$NAME1" 216 | do_stop 217 | case "$?" in 218 | 0|1) 219 | do_start 220 | case "$?" in 221 | 0) log_end_msg 0 ;; 222 | 1) log_end_msg 1 ;; # Old process is still running 223 | *) log_end_msg 1 ;; # Failed to start 224 | esac 225 | ;; 226 | *) 227 | # Failed to stop 228 | log_end_msg 1 229 | ;; 230 | esac 231 | ;; 232 | *) 233 | echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 234 | exit 3 235 | ;; 236 | esac 237 | 238 | : 239 | EOF 240 | ########################## END INIT SETUP ################################## 241 | 242 | ## setup daemon ## 243 | chmod 755 /etc/init.d/deluge-daemon 244 | update-rc.d deluge-daemon defaults 245 | ## start deluge ## 246 | invoke-rc.d deluge-daemon start 247 | 248 | ## Finish ## 249 | clear 250 | echo "#####################################################" 251 | echo "########## Install Complete ##########" 252 | echo "#####################################################" 253 | echo "If all went as planned you should be able to access" 254 | echo "the deluge web-ui at http://$ip:8112/ " 255 | echo " Default password = deluge" 256 | echo "#####################################################" 257 | echo "## Installer by SonicBoxes.com modified by maulvi ##" 258 | echo "#####################################################" 259 | echo "For FAQ and configuration options please see:" 260 | echo "http://sonicboxes.com/bittorrent-deluge-webui-install-script/" 261 | --------------------------------------------------------------------------------