qbittorrent

> creating docs
This commit is contained in:
Eugene Amos 2023-11-28 00:37:00 -08:00
parent e024b8dc6b
commit 2eb979012d
2 changed files with 92 additions and 12 deletions

View File

@ -1,19 +1,101 @@
# :information_source: assign_category.py info <h1 align="center">qBittorrent</h1>
<p align="center">
A docker container that will use a VPN connection as its network connection.</br>
If the VPN drops or disconnects, the container will stop.
<br />
<br />
<br />
<br />
</p>
# :clipboard: assign_category.py info
<details> <details>
<summary>assign_category.py notes</summary> <summary>assign_category.py notes</summary>
</details> </details>
# :information_source: docker-compose-qbittorrent.yml info # :clipboard: docker-compose-qbittorrent.yml info
<details> <details>
<summary>docker-compose-qbittorrent.yml notes</summary> <summary>docker-compose-qbittorrent.yml notes</summary>
This docker-compose file is traditionally used to create and start a container from the command line. For Portainer we can just copy and paste this script into the web editor field.
This will create two services or container called **qbittorrent** and **qbittorrent-openvpn**.
### `qbittorrent` container
Key parts to this container are:
- **image:**
- <a href="https://docs.linuxserver.io/images/docker-qbittorrent" target="blank">linuxserver/qbittorrent:latest</a>: &nbsp; P2P bittorrent client specially built by the linuxserver.io team.
- **volumes:**
- `/home/<USERNAME>/docker/qbittorrent/custom_scripts:/custom-cont-init.d:ro`
</br></br>
This will be the location where the **linuxserver.io** image looks for custom scripts to run at the start of the container. Our custom script `extra_packages.sh` will need to go in this folder.</br></br>
For more info you can see the <a href="https://docs.linuxserver.io/general/container-customization/#custom-scripts" target="blank">documentation</a>.
- **ports:**
- The port section will not be used if we are using **qbittorrent-openvpn** container. All web traffic will be diverted threw that container.
- **healthcheck:**
- A feature of Docker that will check to see if the container is healthy or exited (bad). You will need to change `<SERVER IP ADDRESS>` to home server IP address.
</br></br>
In this configuration it will check to see if the container has a healthy network connection every 60 seconds. On 3 failed attempts it the container will get labeled as `exited`.</br></br>
It is multiple ways or reasons to use **healthcheck** but for our purposes it will be used by the `inspector_qb.py` script which will reboot the container when needed.
- **labels:**
- `com.centurylinklabs.watchtower.depends-on: "qbittorrent-openvpn"` - Used by watchtower to for starting and stopping containers. This container will not be rebooted before `qbittorrent-openvpn` has already done so.
- **network_mode:**
- Tells Docker that the all network activity to container `qbittorrent` will go threw `qbittorrent-openvpn` container.
- **depends_on:**
- Tells Docker that the container `qbittorrent` can only be run/started if `qbittorrent-openvpn` has a healthy healthcheck status.
### `qbittorrent-openvpn` container
The only function of this container is to establish a VPN network connection.</br>
Key parts to this container are:
- **image:**
- <a href="https://haugene.github.io/docker-transmission-openvpn" target="blank">haugene/transmission-openvpn</a>: &nbsp; A Docker container used as an OpenVPN network tunnel.
- **cap_add:**
- Since we are connecting to a VPN, this container will need admin access to network related functions.
- **ports:**
- This will open up ports that `qbittorrent` container will need for networking.
</br></br>
The web port for all `linuxserver.io` images are different in that both the `<external>:<internal>` ports have to be the same. Usually for most Docker containers your `<external>` port can change to whatever you want it to be BUT the `<internal>` port will have to stay the same.</br></br>
I will be using port **8124** as indicated in the code below. The port can be changed, just remember that both port numbers will need to be the same for the `qbittorrent` container to get a network connection.
</br></br>
``` yaml
8124:8124/tcp # qbittorrent web port
6881:6881/tcp # qbittorrent tcp connection port
6881:6881/udp # qbittorrent udp connection port
```
- **environment**
- **OpenVPN Provider Info:** This is where you will enter your credentials from your VPN provider.</BR></BR>
I am using `Privado` for my VPN connection. You can use any provider that uses OpenVPN connections. For a list of supported providers that this container can use <a href="https://haugene.github.io/docker-transmission-openvpn/supported-providers" target="blank">go here</a>. You can also find the correct name to put in the `OPENVPN_PROVIDER` section on the same part of the website.
</BR></BR>
``` yaml
OPENVPN_PROVIDER=<PROVIDER NAME>
OPENVPN_USERNAME=<PROVIDER USERNAME>
OPENVPN_PASSWORD=<PROVIDER PASSWORD>
OPENVPN_CONFIG=default
```
- **Local Network:** When the VPN has a successful connection, you wont be able to get to `qbittorrent` web gui. By setting this to your local network IP address range you will be able to access the gui from any IP address on your side of the router. To access the gui outside of your house, you will need to set up a reverse proxy in Synology NAS or similar.
</details> </details>
# extra_packages.sh info # :clipboard: extra_packages.sh info
<details> <details>
<summary>extra_packages.sh notes</summary> <summary>extra_packages.sh notes</summary>
This script goes in the `/custom_script` volume folder for **qbittorrent** container. It will install three programs. This script goes in the `/custom_script` volume folder for **qbittorrent** container. It will install three programs.
- **python3:** This is the dependant programming language needed. - **python3:** This is the dependant programming language needed.

View File

@ -39,7 +39,7 @@ services:
healthcheck: healthcheck:
# change this ip addrss to match your server. Mine is below as an example # change this ip addrss to match your server. Mine is below as an example
#test: curl -sf http://192.168.1.59:8124 || exit 1 #test: curl -sf http://192.168.1.59:8124 || exit 1
test: curl -sf http://192.168.1.59:8124 || exit 1 test: curl -sf http://<SERVER IP ADDRESS>:8124 || exit 1
interval: 60s interval: 60s
timeout: 30s timeout: 30s
retries: 3 retries: 3
@ -88,15 +88,13 @@ services:
# Checks google every 5 min to see if container is active. # Checks google every 5 min to see if container is active.
- HEALTH_CHECK_HOST=https://google.com - HEALTH_CHECK_HOST=https://google.com
# OpenVPN Provider Info
- OPENVPN_PROVIDER=<PROVIDER NAME>
- OPENVPN_PROVIDER=PRIVADO - OPENVPN_USERNAME=<PROVIDER USERNAME>
- OPENVPN_USERNAME=nhbcimfitlzu - OPENVPN_PASSWORD=<PROVIDER PASSWORD>
- OPENVPN_PASSWORD=oMky&z%xpDX3#
- OPENVPN_CONFIG=default - OPENVPN_CONFIG=default
- LOCAL_NETWORK=192.168.1.0/24 - LOCAL_NETWORK=192.168.1.0/24
#- LOCAL_NETWORK=192.168.1.59