Plex+SickChill+Transimission(+OpenVPN) guide?

zimon

Contributor
Joined
Jan 8, 2016
Messages
134
I was using FreeNAS 9.3 for a very very long time together with Plex, SickChill (former sickrage) and Transmission which only downloads when there is a running VPN connection.
Back in the day there was a very good guide which helped me alot to set up all the configuration and the handling between those plugins.

I recently decided to start fresh with TrueNAS 13 and I was wondering if there are similar guide(s) which can help me to setup everything. The problem is that FreeNAS was basically running without any issues there was no need to fix much - so I almost forgot everything on the setup part ;)

It would be really helpful to have some guides to help me with the setup.
 

gb123

Dabbler
Joined
Oct 12, 2018
Messages
10
I wrote a guide awhile back for setting up a transmission jail using PIA with killswitch. It should still work just fine, maybe with small changes. Setting up Plex is easy enough, but I’d ditch the sickchill and get on the -arr programs. Here’s the guide.

VPN TORRENT TRUENAS JAIL SETUP
CREATE A NEW JAIL AND ENTER THE JAIL SHELL

pkg install nano wget

nano /etc/pkg/FreeBSD.conf

EDIT THIS LINE url: “pkg+http://pkg.FreeBSD.org/$(ABI)/quarterly”,
TO LOOK LIKE THIS url: “pkg+http://pkg.FreeBSD.org/$(ABI)/latest”,

pkg install openvpn

mkdir /usr/local/etc/openvpn

touch /usr/local/etc/openvpn/auth.txt

echo USERNAME > /usr/local/etc/openvpn/auth.txt
echo PASSWORD >> /usr/local/etc/openvpn/auth.txt

chmod 0600 /usr/local/etc/openvpn/auth.txt

mkdir /usr/local/etc/openvpn/download

cd /usr/local/etc/openvpn/download

wget https://www.privateinternetaccess.com/openvpn/openvpn.zip

unzip openvpn.zip

touch /usr/local/etc/openvpn/openvpn.conf

CHANGE "LOCATION" TO YOUR DESIRED OVPN LOCATION FILE

cp LOCATION.ovpn /usr/local/etc/openvpn/openvpn.conf

nano /usr/local/etc/openvpn/openvpn.conf

ADD THE FOLLOWING LINE TO THE BOTTOM OF THE FILE:

auth-user-pass /usr/local/etc/openvpn/auth.txt
auth-nocache

sysrc openvpn_enable="YES"
sysrc openvpn_if="tun"

EXIT THE JAIL CONSOLE, ENTER THE MAIN TRUENAS/FREENAS CONSOLE

iocage set allow_tun=1 JAILNAME

REBOOT THE TRUENAS/FREENAS SERVER

FROM THE JAIL CONSOLE, TEST OPENVPN

wget -qO - http://wtfismyip.com/text

DISPLAY PUBLIC IP ON JAIL SHELL LOGIN

nano /etc/ipcheck.sh

#!/bin/bash
printf "\\33[0;34mYour public IP address is:\033[0;31m\n"
wget -qO - http://wtfismyip.com/text
printf "\\033[0m"

chmod +x /etc/ipcheck.sh

nano ~/.login

/bin/sh /etc/ipcheck.sh

SETUP KILLSWITCH

nano /usr/local/etc/openvpn/ipfw.rules

THE FILE SHOULD LOOK AS FOLLOWS:

#!/bin/sh
##
# OpenVPN Kill Switch Configuration.
#
# From:
# https://github.com/danjacques/freenasdocs
##

. /etc/network.subr

RULE_NO=1000
fwcmd="/sbin/ipfw"
add_fw() {
${fwcmd} add ${RULE_NO} $*
RULE_NO=$((${RULE_NO}+1))
}

# Flush all current rules before we start.
${fwcmd} -f flush

# Enable loopback.
add_fw allow ip from any to any via lo0

# Enable VPN traffic.
add_fw allow ip from any to any via tun*

# Internal Routing
#
# Change these addresses accordingly for your internal network and netmask.
add_fw allow log ip from any to 192.168.1.0/24 keep-state

# Allow DNS traffic.
#
# OpenVPN configs may use host names, and we'll need to look these up.
# Default route.
add_fw allow log udp from any to any dst-port 53 keep-state

# Allow traffic on OpenVPN UDP port.
#
# If you're using TCP VPN and/or a different port, update accordingly. Consult
# your OpenVPN config for details.
add_fw allow log udp from any to any dst-port 1198 keep-state

# Cleanup rules.
RULE_NO=4000
add_fw allow ip from 127.0.0.1 to any

# VPN Network Access.
RULE_NO=5000
add_fw allow ip from 10.0.0.0/7 to any
add_fw allow ip from any to 10.0.0.0/7

# Block everything else.
RULE_NO=65534
add_fw deny log ip from any to any

nano /etc/rc.conf

ADD THE FOLLOWING LINES

firewall_enable="YES"
firewall_script="/usr/local/etc/openvpn/ipfw.rules"

/etc/rc.d/ipfw start

TEST YOUR FIREWALL

/usr/local/etc/rc.d/openvpn stop

ping 8.8.8.8
SHOULD NOT WORK

/usr/local/etc/rc.d/openvpn start
ping 8.8.8.8
SHOULD WORK

KILLSWITCH IS WORKING

INSTALL/CONFIGURE TRANSMISSION

pkg install transmission

sysrc transmission_enable="YES"
sysrc transmission_user="root"
sysrc transmission_group="wheel"

service transmission stop

nano /usr/local/etc/transmission/home/settings.json

CHANGE
"rpc-whitelist-enabled": true,
TO
"rpc-whitelist-enabled": false,

CHANGE
"umask": 18,
TO
"umask": 7,

CHANGE DOWNLOAD DIRECTORY (IF DESIRED)

sysrc transmission_download_dir="/path/to/download/dir"

service transmission start
 

zimon

Contributor
Joined
Jan 8, 2016
Messages
134
Thank you, that helps alot!

but I’d ditch the sickchill and get on the -arr programs
What exactly do you mean with -arr programs? Is there a reason why you wanna ditch sickchill? I had actually quite good xperience in the past years.
 

gb123

Dabbler
Joined
Oct 12, 2018
Messages
10
What exactly do you mean with -arr programs? Is there a reason why you wanna ditch sickchill? I had actually quite good xperience in the past years.
I was using couchpotato/sickrage/sickchill in the beginning. Once I got sonarr and radarr (and other programs that end in -arr) I never looked back. They seem to integrate with all my other programs better and just work. They also work well with user request programs like Ombi.
 

zimon

Contributor
Joined
Jan 8, 2016
Messages
134
thank you, I think I will follow your advice. I already ditched plex since I really don't like the licensing model and replaced it with jellyfin which works fine so far. To be fair I had some issues with sickchill but I blamed it always on old versions since I could not upgrade at some point because of my old FreeNAS 9.10.

This is really great input thanks!
 
Last edited:
Top