Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add torrenting port configuration support #288

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ Due to issues with CSRF and port mapping, should you require to alter the port f

For example, to set the port to 8090 you need to set -p 8090:8090 and -e WEBUI_PORT=8090

### TORRENTING_PORT

A bittorrent client can be an active or a passive node. Running your client as an active node has the advantage of being able to connect to both active and passive peers, and can potentially increase the number of incoming connections. This requires an open port on the host machine which might differ from container's internal one.

Similarly to the WEBUI_PORT, to set the port to 6887 you need to pass -p 6887:6887, -p 6887:6887/udp and -e TORRENTING_PORT=6887 arguments to Docker.

## Usage

To help you get started creating a container from this image you can either use docker-compose or the docker cli.
Expand All @@ -97,6 +103,7 @@ services:
- PGID=1000
- TZ=Etc/UTC
- WEBUI_PORT=8080
- TORRENTING_PORT=6881
volumes:
- /path/to/appdata/config:/config
- /path/to/downloads:/downloads
Expand All @@ -116,6 +123,7 @@ docker run -d \
-e PGID=1000 \
-e TZ=Etc/UTC \
-e WEBUI_PORT=8080 \
-e TORRENTING_PORT=6881 \
-p 8080:8080 \
-p 6881:6881 \
-p 6881:6881/udp \
Expand All @@ -138,6 +146,7 @@ Containers are configured using parameters passed at runtime (such as those abov
| `-e PGID=1000` | for GroupID - see below for explanation |
| `-e TZ=Etc/UTC` | specify a timezone to use, see this [list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List). |
| `-e WEBUI_PORT=8080` | for changing the port of the web UI, see below for explanation |
| `-e TORRENTING_PORT=6881` | for changing the port of tcp/udp connection, see below for explanation |
| `-v /config` | Contains all relevant configuration files. |
| `-v /downloads` | Location of downloads on disk. |

Expand Down Expand Up @@ -302,6 +311,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64

## Versions

* **10.02.24:** - Add torrenting port support.
* **31.01.24:** - Remove obsolete compat packages.
* **25.12.23:** - Only pull stable releases of qbittorrent-cli.
* **07.10.23:** - Install unrar from [linuxserver repo](https://github.com/linuxserver/docker-unrar).
Expand Down
8 changes: 8 additions & 0 deletions readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ param_ports:
param_usage_include_env: true
param_env_vars:
- { env_var: "WEBUI_PORT", env_value: "8080", desc: "for changing the port of the web UI, see below for explanation"}
- { env_var: "TORRENTING_PORT", env_value: "6881", desc: "for changing the port of tcp/udp connection, see below for explanation" }

# application setup block
app_setup_block_enabled: true
Expand All @@ -49,8 +50,15 @@ app_setup_block: |

For example, to set the port to 8090 you need to set -p 8090:8090 and -e WEBUI_PORT=8090

### TORRENTING_PORT

A bittorrent client can be an active or a passive node. Running your client as an active node has the advantage of being able to connect to both active and passive peers, and can potentially increase the number of incoming connections. This requires an open port on the host machine which might differ from container's internal one.

Similarly to the WEBUI_PORT, to set the port to 6887 you need to pass -p 6887:6887, -p 6887:6887/udp and -e TORRENTING_PORT=6887 arguments to Docker.

# changelog
changelogs:
- { date: "10.02.24:", desc: "Add torrenting port support." }
- { date: "31.01.24:", desc: "Remove obsolete compat packages."}
- { date: "25.12.23:", desc: "Only pull stable releases of qbittorrent-cli."}
- { date: "07.10.23:", desc: "Install unrar from [linuxserver repo](https://github.com/linuxserver/docker-unrar)."}
Expand Down
3 changes: 2 additions & 1 deletion root/etc/s6-overlay/s6-rc.d/svc-qbittorrent/run
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# shellcheck shell=bash

WEBUI_PORT=${WEBUI_PORT:-8080}
TORRENTING_PORT=${TORRENTING_PORT:-6881}

exec \
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost ${WEBUI_PORT}" \
s6-setuidgid abc /usr/bin/qbittorrent-nox --webui-port="${WEBUI_PORT}"
s6-setuidgid abc /usr/bin/qbittorrent-nox --webui-port="${WEBUI_PORT}" --torrenting-port="${TORRENTING_PORT}"