Setup 10TB media server/seedbox for less than 70 euro per year

  1. Find and order cheap vps

2. Signup for Hubic

3. Install prerequisites onvps

sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install transmission-cli transmission-common transmission-daemon  python-cheetah unrar git  nano  screen linux-image-extra -y

4. Install docker

add key for docker repo:

sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D

add repo

sudo nano /etc/apt/sources.list.d/docker.list

Add the following line for ubuntu 14.04, (more distros might be found here)

deb https://apt.dockerproject.org/repo ubuntu-trusty main

Save and exit using CTRL-X

update repos:

sudo apt-get update && sudo apt-get upgrade -y

install docker

sudo apt-get install docker-engine

start docker

sudo service docker start

run test app

sudo docker run hello-world

5. install hubic2swiftgate docker image

sudo git clone https://github.com/jkaberg/docker-hubic2swiftgate

cd docker-hubic2swiftgate

Add hubic key to  config.php file

nano config/config.php

 

Build docker image

docker build -t hubic2swiftgate .

Start docker image

sudo docker run -d -p 9443:443 --name hubic2swiftgate --restart always hubic2swiftgate

6. Registering client with you hubic account and mounting voulme

Visit: https://yourserver.com/register/?client=hubic&password=mypassword

and login with your hubic email and password

Create directory for mounting hubic

sudo mkdir /mnt/hubic

Mount hubic with s3ql

sudo mount.s3ql --allow-other swift://localhost:9443/foldernamehere  /mnt/hubic/

7. Configure Transmission-daemon

cd /var/lib/
sudo mkdir transmission
cd transmission
sudo mkdir completed incomplete torrents

Add the current user to debian-transmission group:
sudo usermod -a -G debian-transmission user
sudo chgrp -R debian-transmission /var/lib/transmission
sudo chmod -R 775 /var/lib/transmission

sudo nano /etc/transmission-daemon/settings.json

Update/add the following lines:

"download-dir": "/var/lib/trasmission/completed",
...
"incomplete-dir": "/var/lib/trasmission/incomplete",
"incomplete-dir-enabled": true,
...
"rpc-authentication-required": true,
"rpc-bind-address": "0.0.0.0",
"rpc-enabled": true,
"rpc-password": "password",
"rpc-port": 9091,
"rpc-username": "username",
"rpc-whitelist": "127.0.0.1,*.*.*.*",
"rpc-whitelist-enabled": true,
...
"umask": 2,
...
"watch-dir": "/media/datadrive/downloads",
"watch-dir-enabled": true

8. Install sickrage

Clone the SickRage project from github
sudo git clone http://github.com/SiCKRAGETV/SickRage.git /opt/sickrage

Change ownership to your username
sudo chown username:username -R /opt/sickrage

Test to see if you can run SickRage
python /opt/sickrage/SickBeard.py -d

You may get this error about handlers
No handlers could be found for logger “sickbeard”. We’ll fix that.

You may also see this error.
Datadir must be writeable '/opt/sickrage'

The upstart script below solves this error too

You should be able to access SickRage at http://ip.address:8081 after running the upstart script.

Autostart SickRage

Choose either the init.d script or upstart script. Upstart can have some issues so it’s advised to try the init.d script first.

SickRage init.d Script

Create the SickRage default file for Ubuntu

sudo nano /etc/default/sickbeard
Paste this code, change username to the user you want to run SickRage as:

SB_USER=username
SB_HOME=/opt/sickrage
SB_DATA=/opt/sickrage
SB_PIDFILE=/home/username/.sickbeard.pid

Copy the default SickRage init.d script
# sudo cp /opt/sickrage/runscripts/init.ubuntu /etc/init.d/sickbeard

If you get an error the sickrage script may have moved in their git repo, find it with this command:
# sudo find / -name init.ubuntu

It told me it was here:
/opt/sickrage/runscripts/init.ubuntu

So the new copy command to get the init script is this, source location is first
# sudo cp /opt/sickrage/runscripts/init.ubuntu /etc/init.d/sickbeard

Make the SickRage init.d script executable:
# sudo chmod +x /etc/init.d/sickbeard

Update the SickRage init.d script defaults
# sudo update-rc.d sickbeard defaults

SickRage Upstart Script

Install upstart even though it should be included on Ubuntu

sudo apt-get install upstart
Create the Sickrage upstart file

sudo nano /etc/init/sickrage.conf
Paste this in and replace username with your username.

#Upstart Script to run SickRage as a service on Ubuntu/Debian based distros"

#Set username for the process. Should probably be what you use for logging in
setuid username

start on runlevel [2345]
stop on runlevel [016]

respawn

exec /opt/sickrage/SickBeard.py
Run the service to see if it works

sudo service sickrage start
You should see a message like this
sickrage start/running, process 14827

See if it still boots on restart

sudo reboot
SickRage is now installed on Ubuntu and will start on boot. If you encounter any bugs, do go report them on the SickRage forum so that the developers can work to resolve them.

9. Configure folder permissions
(https://forum.transmissionbt.com/viewtopic.php?t=14836)

# sudo service transmission-daemon stop

# sudo nano /etc/init/transmission-daemon.conf
# setuid USER
# setgid USER

# sudo chown USER:GROUP /etc/transmission-daemon/settings.json

# sudo chown -R USER:GROUP /var/lib/transmission-daemon/

# sudo chown -R USER:GROUP /var/lib/transmission/

Make sure (via WinSCP) that the permissions are correct and SGUID is set

# sudo service transmission-daemon start

10.Sickrage folder configuration

You can now acces sickrage on the follwing url:

http://ip.address:8081

Please do not forget to configure a user+passwords in settings>general.

After this you need to find the torrent search provider  settings (to set download folder) and the post processing setting(to point it to your hubic store) and there configure the correct folders.

The next tutorial will be about installing and configuring plex so you can also stream all media from hubic trough your vps!

sjaak