Set the temporary directory for the packages, as well as the site to fetch packages from (if you are installing onto a 32 bit system change “amd64″ to “i386″):
setenv PKG_TMPDIR /mnt/Data/Extensions/tmp/
setenv PACKAGESITE “http://ftp6.us.freebsd.org/pub/FreeBSD-Archive/ports/amd64/packages-9.0-release/Latest/”
Install OpenVPN:
pkg_add -rv openvpn
Move openvpn file so it does not get executed every time when system is being started, otherwise your boot process will get stopped and you will be asked for a username/password. NAS4Free executes all the files inside “rc.d” folder on startup.
mv /usr/local/etc/rc.d/openvpn /usr/local/etc/openvpn/
Install Certificates and .ovpn files.
mkdir /usr/local/etc/openvpn
Download your certificates *.crt as well as *.ovpn , rename them to *.crt->openvpn.crt and *.ovpn->openvpn.conf copy them using WinSCP to /usr/local/etc/openvpn/
Once copied edit the openvpn.conf and you should see something like that:
client
dev tun
proto udp
remote 11.170.97.173 443 # – Your server IP and OpenVPN Port
resolv-retry infinite
nobind
tun-mtu 1500
tun-mtu-extra 32
mssfix 1450
persist-key
persist-tun
ca openvpn.crt
auth-user-pass
comp-lzo
verb 3
Add the following line to openvpn.conf, so passwords aren’t stored in memory:
auth-nocache Don’t use auth-nocache, as renegotiation after timeout will fail.
Just make sure after “ca” there is openvpn.crt, also check the 2nd line if you have got dev tun or dev tap
Test OpenVPN connection:
/usr/local/etc/openvpn/openvpn onestart /usr/local/etc/openvpn/openvpn.conf
Download the following torrent to make sure your legal torrents are downloaded privately:
Edit rc.conf to enable OpenVPN. Open up your NAS’ web interface and head to System > Advanced > rc.conf and add the following variables:P
openvpn_enable with a value of YES
openvpn_if with a value of tun or tap depending on the contents of openvpn.conf
Now we need to make it autostart, so back to SSH:
pkg_add -r expect
nano /usr/local/etc/openvpn/autosignon
In the file just insert:
#!/usr/local/bin/expect -f
set force_conservative 0
spawn /usr/local/etc/openvpn/openvpn start /usr/local/etc/openvpn/openvpn.conf
match_max 100000
expect -exact “Enter Auth Username:”
send — “YOUR USERNAME!\r”
expect -exact “Enter Auth Password:”
send — “YOUR PASSWORD!\r”
expect eof
Save your changes and make that script executable by running the following command:
chmod +x autosignon
AUTOSTART OPENVPN
In NAS4Free webGUI, navigate to: “System|Advanced|Command scripts” and insert the following start-up command (PreInit):
/usr/local/etc/openvpn/autosignon
CONFIGURE FIREWALL
So this is a bit hit or miss for me, I almost feel like I am having to restart my NAS4Free box before I see the changes from the firewall applied.
My VPN provider doesn’t have a list anymore for which IPs they assign, so I just have to kinda guess.
The purpose of the firewall is to provide detection if the event of the VPN service going down, and by protection we mean – no external connection.
If you wish to test your NAS4Free box IP directly from command line, install curl.
pkg_add -rv curl
Then enter the following:
curl ifconfig.me
But you can also check your torrent client directly too!
9/15/2014 Update: CHange torrent IP tracking address.
The two applications I am going to place on my NAS4Free box are Couchpotato and Sickbeard.
Please note, this is for informational purposes only and I do not condone, or conduct illegal downloading. I actually retrieved most of the information from the following site:
…but some of the steps were slightly different because I already had MySQL installed, for example.
Important Notes:
SETTING UP FOR SICKBEARD INSTALLATION
Let’s make the appropriate directory structure first:
cd /mnt/Data
mkdir Extensions
cd Extensions
mkdir var
mkdir usr
mkdir tmp
Additionally, do the following to map the var and usr directories to the /mnt/Data partition, so as not to use up space on the OS partition (specifically with logs, and cached images):
mount_unionfs -o w /mnt/Data/Extensions/var/ /var/
mount_unionfs -o w /mnt/Data/Extensions/usr/ /usr/
Also add both these lines as Command Scripts under the advanced settings, as PostInit .
Set the temporary directory for the packages, as well as the site to fetch packages from (if you are installing onto a 32 bit system change “amd64″ to “i386″):
setenv PKG_TMPDIR /mnt/Data/Extensions/tmp/
setenv PACKAGESITE “http://ftp6.us.freebsd.org/pub/FreeBSD-Archive/ports/amd64/packages-9.0-release/Latest/”
Installed the required packages for the applications to run:
pkg_add -rv python27
pkg_add -rv unzip
pkg_add -rv py27-yenc
pkg_add -rv py27-cheetah
pkg_add -rv py27-openssl
pkg_add -rv py27-feedparser
pkg_add -rv py27-utils
pkg_add -rv unrar
pkg_add -rv par2cmdline
Now install Sickbeard:
fetch “http://github.com/midgetspy/Sick-Beard/tarball/master”
tar -xzf master
rm master
mv midgetspy-Sick-Beard-fb37d33 Sickbeard
mv Sickbeard /mnt/Data/Extensions/
chmod -R 777 /mnt/Data/Extensions/Sickbeard
Test Sickbeard :
/usr/local/bin/python2.7 /mnt/Data/Extensions/Sickbeard/SickBeard.py –quiet &
Now to configure Sickbeard to startup with your NAS4Free box
CONFIGURING SICKBEARD TO STARTUP ON BOOT
cd /mnt/Data/Extensions/Sickbeard
nano sd.sh
Paste the following code into the editor that appears, replacing your IP address on the first line, your Sick beard username on the second line, and your Sick Beard password on the third line (you can create a username and password for Sick Beard from its web interface):
#!/bin/sh
fetch “http://192.168.0.4:8081/home/shutdown/ «_EOF
yoursickbeardUSERNAMEhere
yoursickbeardPASSWORDhere
_EOF
Save your changes and make that script executable by running the following command:
chmod +x sd.sh
Lastly, head back into NAS4Free’s web interface, and go to System > Advanced > Command Scripts. Click the plus sign and add this as a “PostIinit” command:
/usr/local/bin/python2.7 /mnt/Data/Extensions/Sickbeard/SickBeard.py –quiet &
Add the following command as a “Shutdown” command as well:
/mnt/Data/Extensions/Sickbeard/sd.sh
Remember, as you set up Sick Beard, to use absolute file paths in all the settings e.g.
/mnt/Data/Downloads/Complete
SETTING UP FOR COUCHPOTATO INSTALLATION
cd /mnt/Data/Extensions/tmp
fetch “https://github.com/RuudBurger/CouchPotatoServer/tarball/master”
tar -xzf master
rm master
mv RuudBurger* CouchPotato
mv /mnt/Data/Extensions/tmp/CouchPotato /mnt/Data/Extensions/CouchPotato
Test CouchPotato
/usr/local/bin/python2.7 /mnt/Data/Extensions/CouchPotato/CouchPotato.py –quiet &
CONFIGURING COUCHPOTATO TO STARTUP ON BOOT
Head back into NAS4Free’s web interface, and go to System > Advanced > Command Scripts. Click the plus sign and add this as a “PostIinit” command:
/usr/local/bin/python2.7 /mnt/Data/Extensions/CouchPotato/CouchPotato.py –quiet &
Remember, as you set up CouchPotato, to use absolute file paths in all the settings e.g.
/mnt/Data/Downloads/Complete
Subscribe to:
Labels
Blog Archive
Links