Skip to content

Commands

Two commands inside the container report what it is doing; run them with docker exec. Two scripts in the repository resolve the versions a build uses. The test runner has its own page, Tests.

qbtvpn-healthcheck

docker exec qbittorrentvpn qbtvpn-healthcheck

Takes no arguments. Prints one line and exits with status 0 when the container is healthy and 1 when it is not. Docker’s HEALTHCHECK runs it every 30 seconds.

LineExit statusMeaning
ok: <detail>0The supervisor’s last check passed: the tunnel is up, the WebUI responds, and Privoxy runs when it is enabled
unhealthy: <detail>1The last check failed. The detail names the tunnel’s state, and adds ; WebUI not responding on port <port> or ; Privoxy not running when those failed
stale: last record <seconds> s old (<status> <detail>)1The supervisor has written no record for three VPN_CHECK_INTERVALs plus 30 seconds
starting: no health record yet1The supervisor has not finished its first check
stopped:1The container is shutting down

<detail> is one of:

DetailTypeWhen
wireguard handshake age <seconds>whole number of seconds since the last WireGuard handshakeWireGuard
openvpn <state>OpenVPN’s state name: CONNECTED, RECONNECTING, WAIT, AUTH and the others OpenVPN reports, NOSOCKET before OpenVPN opens its management socket, UNKNOWN when the socket gives no replyOpenVPN
vpn disabledfixed textVPN_ENABLED=no

From the end-to-end tests, over WireGuard and then OpenVPN:

$ docker exec qbittorrentvpn qbtvpn-healthcheck
ok: wireguard handshake age 5
$ docker exec qbittorrentvpn qbtvpn-healthcheck
ok: openvpn CONNECTED

qbtvpn-status

docker exec qbittorrentvpn qbtvpn-status

Takes no arguments. Prints these sections, each headed == <name>, in this order:

SectionLines
healthThe supervisor’s last record, <status> <unix time> <detail>: status is ok, unhealthy or stopped, the time is whole seconds since 1970, and detail is as for qbtvpn-healthcheck. no health record before the first check
buildKEY=VALUE lines: QBITTORRENT_VERSION, LIBTORRENT_VERSION, LIBTORRENT_SERIES, LIBTORRENT_CXX_STANDARD, QT_VERSION
tunnelOne <interface> <family> <address>/<prefix> line per address on tun0, tap0 or wg0. For WireGuard, the endpoint, latest handshake and transfer lines of wg show. For OpenVPN, openvpn: <state> <tunnel address> server <server address>
public address through the tunnelThe address the internet sees, from https://api.ipify.org through the tunnel, or curl’s error and unreachable
dnsThe nameserver <address> lines of /etc/resolv.conf
port forwardingforwarded port <port>, or none
firewallFor every iptables backend that holds the container’s rules, its name and then each chain’s policy (-P <chain> DROP) and the ports open on the tunnel (-A QBTVPN_TUNNEL_IN ...)
privoxyOnly with PRIVOXY_ENABLED=yes: listening on port <port> (pid <pid>), not running; it last ran as pid <pid> on port <port>, or not started: <reason>
qbittorrentqBittorrent v<version>, then the Session\Interface, Session\InterfaceName and Session\Port lines of qBittorrent.conf

This output comes from the end-to-end tests over WireGuard, which run with PRIVOXY_ENABLED=yes. Their test network has no internet access, so the public address reads unreachable.

$ docker exec qbittorrentvpn qbtvpn-status

== health
ok 1795674314 wireguard handshake age 22

== build
QBITTORRENT_VERSION=5.3.1
LIBTORRENT_VERSION=2.1.3
LIBTORRENT_SERIES=2.1
LIBTORRENT_CXX_STANDARD=20
QT_VERSION=6.11.1

== tunnel
wg0 inet 10.13.0.2/32
  endpoint: 172.31.250.2:51820
  latest handshake: 23 seconds ago
  transfer: 3.06 KiB received, 4.47 KiB sent

== public address through the tunnel
curl: (6) Could not resolve host: api.ipify.org (Timeout while contacting DNS servers)
unreachable

== dns
nameserver 10.13.0.1

== port forwarding
forwarded port 40123

== firewall
iptables-nft:
-P INPUT DROP
-P FORWARD DROP
-P OUTPUT DROP
-A QBTVPN_TUNNEL_IN -p tcp -m tcp --dport 40123 -j ACCEPT
-A QBTVPN_TUNNEL_IN -p udp -m udp --dport 40123 -j ACCEPT
ip6tables-nft:
-P INPUT DROP
-P FORWARD DROP
-P OUTPUT DROP
-A QBTVPN_TUNNEL_IN -p tcp -m tcp --dport 40123 -j ACCEPT
-A QBTVPN_TUNNEL_IN -p udp -m udp --dport 40123 -j ACCEPT

== privoxy
listening on port 8118 (pid 400)

== qbittorrent
qBittorrent v5.3.1
Session\Interface=wg0
Session\InterfaceName=wg0
Session\Port=40123

Over OpenVPN, with a test server that assigns IPv6 in the tunnel, the tunnel section reads:

== tunnel
tun0 inet 10.14.0.2/24
tun0 inet6 fd00:14::1000/64
tun0 inet6 fe80::827b:ecb5:24:813b/64
openvpn: CONNECTED 10.14.0.2 server 172.31.250.3

build/resolve-versions.sh

bash build/resolve-versions.sh

Resolves the qBittorrent and libtorrent releases a build uses, through the GitHub API, and prints two lines. It reads every page of each project’s release list, so an older libtorrent series is found however many newer releases come first.

Input variableDefaultMeaning
QBITTORRENT_VERSIONlatestlatest, the newest stable release, or an exact x.y.z
LIBTORRENT_SERIES2.12.1, 2.0 or 1.2
LIBTORRENT_VERSIONlatestlatest, the newest stable release of the series, or an exact x.y.z
GITHUB_TOKENnoneRaises the API’s rate limit
Output lineType
QBITTORRENT_VERSION=<version>release number, x.y.z
LIBTORRENT_VERSION=<version>release number, x.y.z

On a failure it prints resolve-versions: <reason> to standard error and exits with status 1. From the publish workflow:

QBITTORRENT_VERSION=5.3.1
LIBTORRENT_VERSION=2.1.3

build/resolve-qt.sh

bash build/resolve-qt.sh

Prints the qt6-qtbase version Alpine ships for the machine’s architecture, read from the Alpine branch’s package index, as one line for --build-arg. It pins the builder’s Qt; see Build arguments.

Input variableDefaultMeaning
ALPINE_VERSIONthe Dockerfile’s ALPINE_VERSIONAlpine branch
APK_ARCHfrom uname -mAlpine architecture, such as x86_64 or aarch64
Output lineType
QT_VERSION=<version>Alpine package version, x.y.z-rN

From a build on an x86_64 host:

QT_VERSION=6.11.1-r0