From 9e1934b7f6f55c7ba2a3200253f2fb0108ef4675 Mon Sep 17 00:00:00 2001 From: theo Date: Fri, 13 Mar 2026 17:38:58 +0000 Subject: [PATCH] feat: new service --- qbit/docker-compose.yaml | 47 +++++++++++++++++++++++++++++++++++ qbit/scripts/post_download.sh | 24 ++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 qbit/docker-compose.yaml create mode 100755 qbit/scripts/post_download.sh diff --git a/qbit/docker-compose.yaml b/qbit/docker-compose.yaml new file mode 100644 index 0000000..06016da --- /dev/null +++ b/qbit/docker-compose.yaml @@ -0,0 +1,47 @@ +--- +services: +############# +#QBITTORRENT +############# + qbittorrent: + image: lscr.io/linuxserver/qbittorrent:latest + container_name: qbittorrent + network_mode: "service:gluetun" + environment: + - PUID=1000 + - PGID=1000 + - TZ=Etc/UTC + - WEBUI_PORT=8181 + - TORRENTING_PORT=6881 + volumes: + - media-automation_qbit_config:/config + - qbit_downloads:/downloads + restart: unless-stopped + +############ +#GLUETUN +############ + gluetun: + container_name: gluetun + image: qmcgaw/gluetun + cap_add: + - NET_ADMIN + devices: + - /dev/net/tun:/dev/net/tun + ports: + - 8181:8181 #qbittorent + - 6881:6881 #qbittorent + - 6881:6881/udp #qbittorent + environment: + - VPN_SERVICE_PROVIDER=mullvad + - VPN_TYPE=wireguard + - WIREGUARD_PRIVATE_KEY=25M80NgTTbnKmuSBfjmiHiuTlMpp1tCZz8uTrFoE838= + - WIREGUARD_ADDRESSES=10.70.11.21/32 + - SERVER_CITIES=Berlin + restart: unless-stopped + +volumes: + media-automation_qbit_config: + external: True + qbit_downloads: + external: True diff --git a/qbit/scripts/post_download.sh b/qbit/scripts/post_download.sh new file mode 100755 index 0000000..ee1956c --- /dev/null +++ b/qbit/scripts/post_download.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# qBittorrent Post-Download Script +# Verschiebt fertige Downloads von /downloads nach /games + +TORRENT_NAME="$1" +CONTENT_PATH="$2" +SAVE_PATH="$3" + +TARGET_DIR="/games" + +# Nur verschieben wenn aus /downloads +if [[ "$SAVE_PATH" == /downloads* ]]; then + mkdir -p "$TARGET_DIR" + + if [ -d "$CONTENT_PATH" ]; then + # Ordner verschieben + mv "$CONTENT_PATH" "$TARGET_DIR/" + elif [ -f "$CONTENT_PATH" ]; then + # Datei verschieben + mv "$CONTENT_PATH" "$TARGET_DIR/" + fi + + echo "$(date): Moved '$TORRENT_NAME' to $TARGET_DIR" >> /scripts/post_download.log +fi