Improve docs on Synology NAS setup

This commit is contained in:
Kevin Dong
2019-07-23 23:01:28 -04:00
parent 138d6630fe
commit 5adcbb9431

View File

@@ -4,23 +4,23 @@ Here are the steps to run it on a Synology NAS (Tested on DSM 6) :
- Switch to root with command `sudo su -` - Switch to root with command `sudo su -`
- Enter your _admin_ password when prompted - Enter your _admin_ password when prompted
- Create a TUN.sh file anywhere in your synology file system by typing `vim /volume1/foldername/TUN.sh` - Create a TUN.sh file anywhere in your synology file system by typing `vim /volume1/foldername/TUN.sh`
replacing _foldername_ with any folder you created on your Synology replacing _foldername_ with any folder you created on your Synology. You will also need to replace `foldername` for the commands in the remainder of this guide.
- Paste @timkelty 's script : - Paste @timkelty 's script :
``` ```
#!/bin/sh #!/bin/sh
# Create the necessary file structure for /dev/net/tun # Create the necessary file structure for /dev/net/tun
if ( [ ! -c /dev/net/tun ] ); then if ( [ ! -c /dev/net/tun ] ); then
if ( [ ! -d /dev/net ] ); then if ( [ ! -d /dev/net ] ); then
mkdir -m 755 /dev/net mkdir -m 755 /dev/net
fi fi
mknod /dev/net/tun c 10 200 mknod /dev/net/tun c 10 200
chmod 0755 /dev/net/tun chmod 0755 /dev/net/tun
fi fi
# Load the tun module if not already loaded # Load the tun module if not already loaded
if ( !(lsmod | grep -q "^tun\s") ); then if ( !(lsmod | grep -q "^tun\s") ); then
insmod /lib/modules/tun.ko insmod /lib/modules/tun.ko
fi fi
``` ```
- Save the file with [escape] + `:wq!` - Save the file with [escape] + `:wq!`
@@ -35,27 +35,30 @@ nameserver 8.8.8.8
nameserver 8.8.4.4 nameserver 8.8.4.4
``` ```
- Save the file with [escape] + `:wq!` - Save the file with [escape] + `:wq!`
- Create your docker container with a the following command line: - Create your Docker container with the following command. Note the following things you should change or may want to consider changing:
- If you'd like any Transmission options (for instance, stop seeding once a certain ratio has been reached) to persist across container restarts, now is the time to enter them by modifying the command below. See [here](https://haugene.github.io/docker-transmission-openvpn/arguments/#transmission_configuration_options) for details.
# Tested on DSM 6.1.4-15217 Update 1, Docker Package 17.05.0-0349 - You must change the folder paths for the paths listed in the following command.
docker run \ - You must also specify the UID and GID of the user Transmission should run. The placeholder provided below almost certainly will not work on your system without modification.
--cap-add=NET_ADMIN \ ```
--device=/dev/net/tun \ # Tested on DSM 6.1.4-15217 Update 1, Docker Package 17.05.0-0349
-d \ docker run \
-v /volume1/foldername/resolv.conf:/etc/resolv.conf \ --cap-add=NET_ADMIN \
-v /volume1/yourpath/:/data \ --device=/dev/net/tun \
-e "OPENVPN_PROVIDER=PIA" \ -d \
-e "OPENVPN_CONFIG=CA\ Toronto" \ -v /volume1/foldername/resolv.conf:/etc/resolv.conf \
-e "OPENVPN_USERNAME=XXXXX" \ -v /volume1/yourpath/:/data \
-e "OPENVPN_PASSWORD=XXXXX" \ -e "OPENVPN_PROVIDER=PIA" \
-e "LOCAL_NETWORK=192.168.0.0/24" \ -e "OPENVPN_CONFIG=CA\ Toronto" \
-e "OPENVPN_OPTS=--inactive 3600 --ping 10 --ping-exit 60" \ -e "OPENVPN_USERNAME=XXXXX" \
-e "PGID=100" \ -e "OPENVPN_PASSWORD=XXXXX" \
-e "PUID=1234" \ -e "LOCAL_NETWORK=192.168.0.0/24" \
-p 9091:9091 \ -e "OPENVPN_OPTS=--inactive 3600 --ping 10 --ping-exit 60" \
--sysctl net.ipv6.conf.all.disable_ipv6=0 \ -e "PGID=100" \
--name "transmission-openvpn-syno" \ -e "PUID=1234" \
haugene/transmission-openvpn:latest -p 9091:9091 \
--sysctl net.ipv6.conf.all.disable_ipv6=0 \
--name "transmission-openvpn-syno" \
haugene/transmission-openvpn:latest
```
- To make it work after a nas restart, create an automated task in your synology web interface : go to **Settings Panel > Task Scheduler ** create a new task that run `/volume1/foldername/TUN.sh` as root (select '_root_' in 'user' selectbox). This task will start module that permit the container to run, you can make a task that run on startup. These kind of task doesn't work on my nas so I just made a task that run every minute. - To make it work after a nas restart, create an automated task in your synology web interface : go to **Settings Panel > Task Scheduler ** create a new task that run `/volume1/foldername/TUN.sh` as root (select '_root_' in 'user' selectbox). This task will start module that permit the container to run, you can make a task that run on startup. These kind of task doesn't work on my nas so I just made a task that run every minute.
- Enjoy - Enjoy