### Docker Compose Example for gsp-qbittorent-gluetun-sync-port-mod Source: https://github.com/t-anc/gsp-qbittorent-gluetun-sync-port-mod/blob/main/README.md This example demonstrates how to configure both Gluetun and qBittorrent services within a Docker Compose setup, integrating the gsp-qbittorent-gluetun-sync-port-mod. It includes essential environment variables for each service and volume mappings. ```yaml services: gluetun: image: qmcgaw/gluetun container_name: gluetun restart: always ports: - 8080:8080 # Qbt exposed webUI cap_add: - NET_ADMIN environment: - TZ=Europe/Paris - VPN_SERVICE_PROVIDER=custom - VPN_TYPE=wireguard - VPN_PORT_FORWARDING=on - VPN_PORT_FORWARDING_PROVIDER=protonvpn volumes: - "./config.toml:/gluetun/auth/config.toml:ro" qbittorrent: image: ghcr.io/linuxserver/qbittorrent container_name: qbittorrent environment: - TZ=Europe/Paris - WEBUI_PORT=8080 - DOCKER_MODS=ghcr.io/t-anc/gsp-qbittorent-gluetun-sync-port-mod:main # Of course this is an API Key example, don't use this - GSP_GTN_API_KEY=yOdKVNFEA3/BSIWhPZohxppHd9I6bHiSJ+FasGlncleveW4LvuO7ONy5w1IsEA2Pu6s= - GSP_MINIMAL_LOGS=false volumes: - "./qbittorrent/config/:/config" - "./qbittorrent/webui/:/webui" - "./downloads:/downloads" network_mode: container:gluetun depends_on: gluetun: condition: service_healthy restart: unless-stopped ``` -------------------------------- ### Qbittorrent Docker Logs Example Source: https://github.com/t-anc/gsp-qbittorent-gluetun-sync-port-mod/blob/main/README.md This log output shows the initialization process of the mod, application of the mod to the container, and successful port synchronization between qbittorrent and Gluetun. ```log [mod-init] Running Docker Modification Logic [mod-init] Adding t-anc/gsp-qbittorent-gluetun-sync-port-mod:main to container [mod-init] Downloading t-anc/gsp-qbittorent-gluetun-sync-port-mod:main from ghcr.io [mod-init] Installing t-anc/gsp-qbittorent-gluetun-sync-port-mod:main [mod-init] t-anc/gsp-qbittorent-gluetun-sync-port-mod:main applied to container [migrations] started [migrations] no migrations found usermod: no changes ─────────────────────────────────────── ██╗ ███████╗██╗ ██████╗ ██║ ██╔════╝██║██╔═══██╗ ██║ ███████╗██║██║ ██║ ██║ ╚════██║██║██║ ██║ ███████╗███████║██║╚██████╔╝ ╚══════╝╚══════╝╚═╝ ╚═════╝ Brought to you by linuxserver.io ─────────────────────────────────────── To support LSIO projects visit: https://www.linuxserver.io/donate/ ─────────────────────────────────────── GID/UID ─────────────────────────────────────── User UID: 1000 User GID: 1000 ─────────────────────────────────────── [custom-init] No custom files found, skipping... +---------------------------------------------------------+ | Gluetun sync port (GSP) mod loaded | +---------------------------------------------------------+ | Qbittorrent address : http://localhost:8080 | | Gluetun address : http://localhost:8000 | | GTN port index : 1 | +---------------------------------------------------------+ 04/10/24 01:03:49 [GSP] - Waiting for Qbittorrent WebUI ... WebUI will be started shortly after internal preparations. Please wait... ******** Information ******** To control qBittorrent, access the WebUI at: http://localhost:8080 Connection to localhost (::1) 8080 port [tcp/http-alt] succeeded! [ls.io-init] done. 04/10/24 01:03:55 [GSP] - Init checks passed. Listening for a change. 04/10/24 01:03:55 [GSP] - Ports did not change. 04/10/24 01:04:55 [GSP] - Ports changed : 04/10/24 01:04:55 [GSP] - - Old : 22684 04/10/24 01:04:55 [GSP] - - New : 38473 04/10/24 01:04:55 [GSP] - Updating qbittorrent port via API ... 04/10/24 01:04:55 [GSP] - Qbittorrent port successfully updated. 04/10/24 01:05:55 [GSP] - Ports did not change. ``` -------------------------------- ### Wait for Healthy VPN Connection in Docker Compose Source: https://github.com/t-anc/gsp-qbittorent-gluetun-sync-port-mod/blob/main/README.md Add this to your qBittorrent service in `docker-compose.yml` to ensure it starts only after a stable VPN connection is established by Gluetun. This prevents startup errors related to lack of internet access. ```yaml depends_on: gluetun: condition: service_healthy ``` -------------------------------- ### Configure Gluetun's config.toml for API Access Source: https://github.com/t-anc/gsp-qbittorent-gluetun-sync-port-mod/blob/main/README.md Add these lines to your Gluetun config.toml file to grant the mod read access to the forwarded port. Replace the example API key with your generated key. ```toml [[roles]] name = "t-anc/GSP-Qbittorent-Gluetun-sync-port-mod" routes = ["GET /v1/portforward"] auth = "apikey" # This is an example apikey, generate your own. apikey = "yOdKVNFEA3/BSIWhPZohxppHd9I6bHiSJ+FasGlncleveW4LvuO7ONy5w1IsEA2Pu6s=" ``` -------------------------------- ### Standalone Container Docker Compose Configuration Source: https://github.com/t-anc/gsp-qbittorent-gluetun-sync-port-mod/blob/main/README.md This Docker Compose configuration sets up a standalone container for the qBittorrent Gluetun sync port mod. It uses a base Alpine image and applies the mod via `DOCKER_MODS`. Ensure the `gluetun` service is healthy and running before this container starts. Replace the example API key with your actual key. ```yaml GSP_qbt_gtn_sync_port: image: ghcr.io/linuxserver/baseimage-alpine:edge container_name: GSP_qbt_gtn_sync_port environment: - DOCKER_MODS=ghcr.io/t-anc/gsp-qbittorent-gluetun-sync-port-mod:main # Of course this is an API Key example, don't use this - GSP_GTN_API_KEY=yOdKVNFEA3/BSIWhPZohxppHd9I6bHiSJ network_mode: container:gluetun depends_on: gluetun: condition: service_healthy ``` -------------------------------- ### Gluetun API response for single forwarded port Source: https://github.com/t-anc/gsp-qbittorent-gluetun-sync-port-mod/blob/main/README.md This is an example of a successful response from the Gluetun API when querying for a single forwarded port. The 'port' field indicates the active forwarded port number. ```json {"port":34981} ``` -------------------------------- ### Gluetun Docker Logs Example Source: https://github.com/t-anc/gsp-qbittorent-gluetun-sync-port-mod/blob/main/README.md This log output shows Gluetun's port forwarding status, including the external IPv4 address and the forwarded port. It also logs API requests to retrieve the forwarded port. ```log 2024-12-29T14:22:53+01:00 INFO [port forwarding] starting 2024-12-29T14:22:53+01:00 INFO [port forwarding] gateway external IPv4 address is 156.71.163.18 2024-12-29T14:22:53+01:00 INFO [port forwarding] port forwarded is 18008 2024-12-29T14:22:53+01:00 INFO [firewall] setting allowed input port 18008 through interface tun0... 2024-12-29T14:22:53+01:00 INFO [port forwarding] writing port file /tmp/gluetun/forwarded_port 2024-12-29T14:22:58+01:00 INFO [http server] 200 GET /portforwarded wrote 15B to [::1]:55008 in 79.707µs 2024-12-29T14:23:58+01:00 INFO [http server] 200 GET /portforwarded wrote 15B to [::1]:43420 in 112.741µs 2024-12-29T14:24:58+01:00 INFO [http server] 200 GET /portforwarded wrote 15B to [::1]:45958 in 88.972µs ``` -------------------------------- ### Gluetun API response for multiple forwarded ports Source: https://github.com/t-anc/gsp-qbittorent-gluetun-sync-port-mod/blob/main/README.md This is an example of a successful response from the Gluetun API when multiple ports are forwarded. The 'ports' field is an array containing all active forwarded port numbers. You can specify which port to use with the `GSP_GTN_PORT_INDEX` environment variable. ```json {"ports":[10550,20550,30550]} ``` -------------------------------- ### View qbittorrent container logs Source: https://github.com/t-anc/gsp-qbittorent-gluetun-sync-port-mod/blob/main/README.md Use this command to follow the logs of the qbittorrent container, which will include output from the mod. ```bash docker logs -f qbittorrent ``` -------------------------------- ### Generate API Key using Gluetun's internal program Source: https://github.com/t-anc/gsp-qbittorent-gluetun-sync-port-mod/blob/main/README.md Use this command to generate an API key specifically with Gluetun's utility. ```bash docker run --rm qmcgaw/gluetun genkey ``` -------------------------------- ### Generate API Key using OpenSSL Source: https://github.com/t-anc/gsp-qbittorent-gluetun-sync-port-mod/blob/main/README.md Use this command to generate a secure API key for Gluetun authentication using OpenSSL. ```bash openssl rand -base64 50 ``` -------------------------------- ### Generate API Key using GPG Source: https://github.com/t-anc/gsp-qbittorent-gluetun-sync-port-mod/blob/main/README.md Use this command to generate a secure API key for Gluetun authentication using GPG. ```bash gpg --gen-random --armor 1 50 ``` -------------------------------- ### View Gluetun container logs Source: https://github.com/t-anc/gsp-qbittorent-gluetun-sync-port-mod/blob/main/README.md Use this command to follow the logs of the Gluetun container, which can provide insights into port forwarding and API interactions. ```bash docker logs -f gluetun ``` -------------------------------- ### Retrieve forwarded port from Gluetun API Source: https://github.com/t-anc/gsp-qbittorent-gluetun-sync-port-mod/blob/main/README.md This command executes a `wget` command within the Gluetun container to fetch the currently forwarded port from its control server. Replace `` with your actual API key. ```bash docker exec gluetun wget -q --header='X-API-Key:' -O- http://localhost:8000/v1/portforward ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.