HUB
Sign inSign up
qbittorrent logo

amitie10g/qbittorrent

By amitie10g

•Updated over 7 years ago

This is a fork from the LinuxServer.io's docker-qbittorrent project, to add support for gcsfuse.

Image
0

1.6K

amitie10g/qbittorrent repository overview

⁠docker-qbittorrent (Alpine)

This branch is intended to add support for mounting Google Cloud Storage⁠ buckets via gcsfuse⁠.

This is NOT for Google Drive.

Docker image: amitie10g/qbittorrent:gcsfuse⁠.

Images used:

This is just a proof-of-concept for automatizing sharing process and storing completed torrents at Google Cloud Storage (mainly from services running at the Google Cloud Compute infraestructure). Using the Google Cloud services without setting up properly would be expensive.

⁠Differences between upstream and this project

  • /downloads volume is not longer exposed. Instead,
    • /downloads/complete is mounted via FUSE inside the container.
    • /downloads/incomplete is exposed to the host side, to keep the incomplete files across reboots and avoid unneccesary writes to the bucket.

⁠Running

⁠Before begin
  • <config path> and <watch path> refers to the local direcctories you want to expose.

  • Get your Service Account Key⁠ for your bucket, and upload to /gcsfuse-key.json. (if you're running the VM at Google Cloud, the key can be reteived as custom metadata).

  • If you're running the VM at Google Cloud,

    • You must configure your Service account⁠ accordingly.

    • You should enable OS Login⁠ and choose the proper Service account.

    • The User ID, Group ID and the $HOME directory belongs to the OS Login account. You may get those data from another instance with OS login enabled and using the same Service account, by running id and pwd.

    • In Container-optimized OS, /mnt/disks is writable, so, the config path will be stored at /mnt/disks/qbittorrent

    • Use Preemptive VM. If you don't want to watch for power downs, you may use Instance templates and Instance groups.

    • At Boot disk section When deleting instance, select "Keep disk", in order to don't get rid after power downs under preemptive VMs.

  • Don't forget to set the right permissions for your bucket.

  • If you ran out of space caused by the container rather than the downloads, just reboot the VM in order to re-crate the container (destroying it in the process).

⁠Using the Container deployment feature at Google Cloud

Google Cloud offers a feature to deploy containers in much style as docker-compose. Follow those steps:

  • Mark Deploy a container image to this VM instance, and,
    • Set amitie10g/qbittorrent:gcsfuse as the container name.
    • Mark Run as privileged
    • Fill the following environment variables:
      • PUID: Your OS login user ID
      • PGID: Your OS login group ID
      • BUCKET: the GCS bucket name
      • TZ: UTC
    • Add the following Volume mounts (absolute path):
      • /config: $HOME/config
      • /downloads/incomplete: $HOME/downloads/watch
  • Select the Container-optimized OS of you choice as boot image and set it at least 20GB standard HDD (SSD has no much benefict)
  • At Access scopes, select "Allow full access to all Cloud APIs".
  • At Automation (click in "Management, security, disks, networking, sole tenancy" to deploy):
    • Fill the Startup script with the contents of scripts/startup-gcloud.
    • Fill the following custom Metadata:
      • enable-oslogin as true (you may also enable OS Login globally). (mandatory).
      • GCS_KEY with the Service account key. (mandatory).
    • You may enable SSL by adding the following custom metadata:
      • SSL_CERT with your SSL certificate.
      • SSL_KEY with your SSL key.
⁠Command line
PUID=<PUID>
PGID=<PGID>
CONF_PATH=$HOME/config
INCOMPLETE_PATH=$HOME/downloads/incomplete
CONTAINER_NAME=qbittorrent
CONTAINER_IMAGE=amitie10g/qbittorrent:gcsfuse

docker run -t -i -d \
  --name=$CONTAINER_NAME \
  -e PUID=$PUID \
  -e PGID=$PGID \
  -e TZ=UTC \
  -e BUCKET=torrent-test \
  -v $CONF_PATH:/config \
  -v $INCOMPLETE_PATH:/downloads/incomplete \
  -p 6881:6881 \
  -p 6881:6881/udp \
  -p 8080:8080 \
  --device=/dev/fuse \
  --restart no \
  --privileged \
  $CONTAINER_IMAGE
⁠docker-compose style
version: "3.3"
services:
  qbittorrent:
    image: amitie10g/qbittorrent:gcsfuse
    container_name: qbittorrent
    environment:
      - PUID=<PUID>
      - PGID=<PGID>
      - BUCKET=<BUCKET>
      - TZ=UTC
    volumes:
      - <path to data>:/config
      - <path to incomplete folder>:/downloads/incomplete
    ports:
      - 8080:8080
      - 6881:6881
      - 6881:6881/udp
    restart: no

⁠Building locally

git clone --branch=gcsfuse https://github.com/Amitie10g/docker-qbittorrent.git
cd docker-qbittorrent
docker build \
  --no-cache \
  --pull \
  --compress \
  -t amitie10g/qbittorrent .

Follow the original README.md⁠ file for instructions for running.

Tag summary

Content type

Image

Digest

Size

71.8 MB

Last updated

over 7 years ago

docker pull amitie10g/qbittorrent