Skip to content

Instantly share code, notes, and snippets.

@timothyandrew
Last active December 16, 2023 17:05
Show Gist options
  • Save timothyandrew/6162351 to your computer and use it in GitHub Desktop.
Save timothyandrew/6162351 to your computer and use it in GitHub Desktop.
Set up a seedbox (on DigitalOcean – Ubuntu) really quick

Introduction

  • This script lets you set up and use a temporary DigitalOcean droplet to download torrent files.
  • Once downloaded, they can be streamed down to your local machine.
  • This uses transmission-cli for the torrent client, and nginx to serve files.

Setup on Local Machine

  • This assumes that you have a DigitalOcean account and tugboat set up, as well as seedbox-setup.sh present in the current directory.
# Create a droplet on DigitalOcean

$ tugboat create seedbox
$ tugboat wait seedbox
$ tugboat info seedbox
  • Copy the IP address of the droplet, and use it for the following commands:
$ scp seedbox-setup.sh [email protected]:/tmp/

Setup on Remote Machine

$ sh /tmp/seedbox-setup.sh
  • When the first config file (for transmission) opens in Vim, change the values for these keys:
Key Value
download-dir "/usr/share/nginx/www"
rpc-authentication-required "false"
rpc-whitelist-enabled "false"
  • Type <esc>:wq to quit Vim.
  • The next config file that opens is the nginx config. Inside the http block, add autoindex on;
  • Type <esc>:wq to quit Vim.

Using the seedbox

  • To add/manage torrents, go to http://my.ip.address.here:9091/
  • To view/download files, go to http://my.ip.address.here/

Destroying the seedbox

  • After the download is done, run tugboat destroy seedbox locally.
sudo apt-get -y install python-software-properties vim
sudo add-apt-repository -y ppa:transmissionbt/ppa
sudo apt-get -y update
sudo apt-get -y install transmission-cli transmission-common transmission-daemon nginx
sudo vim /etc/transmission-daemon/settings.json
sudo vim /etc/nginx/nginx.conf
sudo chmod 777 /usr/share/nginx/www
sudo rm /usr/share/nginx/www/index.html
sudo /etc/init.d/transmission-daemon reload
sudo /etc/init.d/nginx restart
@paulgault
Copy link

Thank you for this.
I was having trouble getting the autoindex function to work on nginx. I just kept getting a welcome page saying further configuration is required even after index.html had been removed from /usr/share/nginx/html.
either I was putting autoindex on; in the wrong place or way nginx is configured has changed. I found this on Stackoverflow that kinda suggests autoindex on; should go in /etc/nginx/sites-available/default but I gave up and used apache2 instead

the following worked for me on an Ubuntu 16.04 droplet

add-apt-repository -y ppa:transmissionbt/ppa
apt-get -y update
apt-get -y install transmission-cli transmission-common transmission-daemon apache2

nano /etc/apache2/apache2.conf
add to the bottom of file "ServerName" then the droplet IP address
e.g. ServerName 8.8.8.8

apache2ctl configtest
systemctl restart apache2

Updated the firewall with the two below. not actually sure if this is necessary but it was in my notes from a different server setup so I left it in here, just in case it is actually needed
ufw app list
ufw allow in "Apache Full"

service transmission-daemon stop
nano /etc/transmission-daemon/settings.json
set rpc-authentication-required as false
set rpc-whitelist-enabled as false
change download-dir to /var/www/html
service transmission-daemon start

chmod 777 /var/www/html/
rm /var/www/html/index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment