The main reference used is Havetheknowhow.com, specifically for the deluge headless setup, Havetheknowhow.com - How to install Deluge Headless. The Deluge support page is also a root source of knowledge Deluge systemd. Whatbox Deluge also has some interesting dialog.
If installing on a virtual machine (VM) it is important to also have set up the NFS to allow access to the main storage. Also, consider aligning the appropriate file system user and groups between the VM server and VM guests. (Check the local deluge directory actually exists for the user as otherwise the deluge and deluge web daemons will crash and not load. (For the Ubuntu Network Filing System, NFS, see Havetheknowhow.com - How to configure NFS Version 4, that contains configuration information for both the VM server and clients.
Unfortunately, Havetheknowhow.com does not seem to cover the alignment of user and groups between the main OS and VMs. I create a basic template machine and manual update the group and user id numbers to align, a use the basic information given in Linux: Changing UIDs and GIDs for a user. The process is tedious and takes a bit of care to complete, but once setup properly allows better operation between the server and virtual machines.
I use a dedicated VM guest for Deluge with a VPN set up on this VM. I have been using the VPN BTGuard for a few years now without any significant problems, save for BTGuard changing the IP address of their servers on occasion without informing end users, this affects the firewall software as noted below.
Recent changes not fully updated:
Setting up deluged and and deluge-web as systemd services is described in deluge docs How to create systemd services for Linux
We want to delay the start of the deluged.service to after the related drives are mounted.
First we need to check the units on on the machine. Use sudo systemctl list-units
and look for the relevant .mount
s . In mycase:
-.mount loaded active mounted Root Mount mnt-deluge.mount loaded active mounted /mnt/deluge mnt-disk2.mount loaded active mounted /mnt/disk2
Similarly, in the same listing look for the relevant .service
s:
deluge-web.service loaded active running Deluge Bittorrent Client Web Interface deluged.service loaded active running Deluge Bittorrent Client Daemon
systemd-analyze – Find System Boot-up Performance Statistics in Linux
I decided to go with PrivateVPN that seems to get reasonably good reviews at the time of change over (2020-04-18) and my old VPN provided (BTGuard) was getting very poor reviews, was up for renewal, and was becoming comparatively expensive. The following is a list of resources to help with Linux Ubuntu CLI setup:
The PrivateVPN OpenVPN Linux CLI setup and associated download script worked well and was similar to the BTGuard setup, with the following issues easily found:
sudo privatvpn
to run. The setup script creates a systemctl profile: openvpn@privatvpn.service. So the standard systemctl commands made much more sense to use! e.g. sudo systemctl start openvpn@privatvpn.service
with other standard systemctl operators: stop, status, enable, disable, etc. Similarly to get a better look at current log status: journalctl -u openvpn@privatvpn.service -xe
./etc/privatevpn.conf
to change the VPN servers, however the correct file was /etc/openvpn/privatevpn.conf
..host
.sudo vim /etc/nftables.conf
. Basically the nftables setup firewalls the system to only allow wan through the tunnel, except the pinhole address required to setup the tunnel. wget http://ipinfo.io/ip -qO -
to check my current external ip address.I decided to move away from BTGuard after many years of service. Primary reasons: 1. They were becoming more expense (in part of currency variation with USD) and 2. Their services seemed not to be very comprehensive and up to date. Basically not the best value for money.
sudo systemctl start openvpn@privatvpn.service
, was openvpn@btguard.service
journalctl -u openvpn@privatvpn.service -b 0 -xe
wget http://ipinfo.io/ip -qO -
sudo nft list table ip firewall
, not inet, specifically ip, as ip6 is disabled.sudo systemctl start nftables
journalctl -u nftables.service -b 0
enable
: to start the systemctl service at bootdisable
: to not start the systemctl service at bootstart
: to start the systemctl servicestop
: to stop the systemctl servicestatus
: to provide the status information of the systemctl service. Some of the last journal log lines are shown too, to see all the journal log use the journalctl command. Some journalctl directives:
-u service_unit
only list for service_unit-b n
Only list boot n, no number or 0 for last boot and 1 for previous and 2 for 2 previous etc.-xe
List end of file-f
Live continuous tail listing, until keyboard ^c
NFTables supersedes IPTables, although IPTables is still most common in use. I have taken the effort to learn both IPTables and NFTables and prefer the syntax of NFTables.
A problem with the OpenVPN system is should it fail then the IP connectivity falls back to the standard connection with all the VPN benefits lost. To diminish this risk, I have set up the Deluge VM with a NFtables based firewall to effectively stop external internet connection upon any failure of the VPN, that is only the VPN connectivity is allowed. I have learned from the original IPTables based configuration below. With the ease of use of NFTables I have been able to improve and optimise the firewall.
To install nftables: “sudo apt update” followed by sudo apt install nftables
sudo vim /etc/nftables.conf
sudo nft list tables
sudo nft list table ip firewall
and sudo nft list table ip6 firewall
host au-mel.pvdata.host
or ping au-mel.pvdata.host
.sudo vim /etc/openvpn/privatvpn.conf
& sudo vim /etc/nftables.conf
. sudo systemctl restart openvpn@privatvpn.service
& sudo systemctl restart nftables
wget http://ipinfo.io/ip -qO -
sudo vim /etc/nftables.conf
The use of the counter directive allows the usage to be checked. I commented out lines that were not being used.
To list the firewall: sudo nft list table ip firewall
A problem with this protection is should the OpenVPN system fail then the VPN protection will fail. To diminish this risk, I have set up the Deluge VM with an IPtables based firewall to effectively stop external internet connection upon any failure of the VPN. (The reference for the iptables filter script was AirVPN - Prevent leaks with Linux & iptables )
I have been using WD Media players around the house the past 8 years or so. Originally with individual 2.5“HD and then connecting to my home server. These units are very simple to use and setup and have played media files well. Circa 2016 I notice that some media files will not play anymore. Upon investigating the WD (Western Digital) web site I notice that these units look to be no longer sold and support is limited, perhaps already end of life. Earlier investigation of these unit indicate the internal hardware is quite limited, particularly by current standards, but as already stated good enough as a general media player.
I notice a few years ago the the web site Have the know how recommended the Kodi Overview, in fact even states, ”Kodi: The holy grail of media streamer front-ends“. I will not go over the benefits and history of Kodi, just look at the Kodi home page and Have the Know How web pages.
Kodi can be loaded on to many different types of hardware and operating systems, it even has a Linux based OS design for it, OpenELEC. Specifically it does run on MS Windows and most flavours of Linux.
Docker seems to be a reasonably recent variation based upon quite old concepts with modern aspects thrown in. The documentation seems a bit sparse. I found it difficult to find a good balanced reference. A good reference is of course the Docker Website itself: Get Started, Part 1: Orientation and setup. A good reference (pdf) was from Anthony Blair of Universit'e de Rennes, Docker Tutorial. Many of the Docker tutorials seem to focus on features that I am not interest at this time, such as Docker swarms and not enough on basic usage.
Some handy docker commands and related:
docker exec -it <name> /bin/bash
to get terminal inside container <name>sudo netstat -nlp
docker rm <name>
, to remove docker <name> container, container must be stopped docker stop <name>
docker ps
, to list running docker containers, docker ps -a
to list all docker containers, running and stoppeddocker rmi <Repository>
, list all images with docker images -a
docker logs <name>
, to see docker <name> log file, and docker logs -f <name>
, to see docker <name> log file online outputdocker port <name>
to see docker <name> port mappings to hostIt is assumed that the container has been previously created/run and is available to be started at boot.
sudo vim /etc/systemd/system/docker-kodi-headless.service
[Unit] Description=kodi-headless container Requires=docker.service After=docker.service [Service] Restart=always ExecStart=/usr/bin/docker start -a kodi-headless ExecStop=/usr/bin/docker stop -t 2 kodi-headless [Install] WantedBy=default.target
wget http://ipinfo.io/ip -qO -
sudo netfilter-persistent save
ip a
sudo systemctl start openvpn@btguard.service
sudo /mnt/shared/scripts/BTGuard_iptable_ens3.sh
sudo iptables -L -v
or simple sudo iptables -S
sudo vim /etc/openvpn/btguard.conf
sudo iptables -F
grep btguard /var/log/syslog
ps -A | grep open
sudo systemctl start deluged
sudo systemctl start deluge-web