Skip to content

Migration Guide

Rémi Marseault edited this page Sep 19, 2024 · 7 revisions

2.0 Upgrade

2.0 version introduced a BIG rework to allow for better security regarding users using the backend with a reverse proxy, see #13.

To mitigate this issue, vuetorrent-backend now acts as an intermediary between qBittorrent and your browser. This change isn't effortless and thus needs small adjustments from 1.0 architecture.

Simple example

Before

Let's assume 2 containers:

  • The first one for qBittorrent which has a VueTorrent mount.
  • The second one for vuetorrent-backend which only stores data.
services:
  qbit:
    container_name: qbit
    image: linuxserver/qbittorrent:latest
    restart: unless-stopped
    volumes:
      - "./docker/config:/config"
      - "./docker/downloads:/downloads"
      - "./vuetorrent:/vuetorrent"
    environment:
      - WEBUI_PORT=8080
    ports:
      - "8080:8080"
      - "6881:6881"
      - "6881:6881/udp"

  vt-backend:
    image: ghcr.io/vuetorrent/vuetorrent-backend:latest
    container_name: vuetorrent-backend
    restart: unless-stopped
    ports:
      - "3000:3000"
    environment:
      - QBIT_BASE=http://qbit:8080
    volumes:
      - "./docker/vuetorrent-backend:/app/data"

After

The new architecture forces us to handle all requests inside the backend. To fix this issue and to provide auto-update feature inside the backend,the volume mount isn't needed anymore, as the backend manages its own installation inside the container.

Some more environment variables has also been added.

services:
  qbit:
    container_name: qbit
    image: lscr.io/linuxserver/qbittorrent:latest
    restart: unless-stopped
    volumes:
      - "./docker/config:/config"
      - "./docker/downloads:/downloads"
      # - "./vuetorrent:/vuetorrent"    # This mount can be removed safely
    environment:
      - WEBUI_PORT=8080
    ports:
      # qBittorrent don't need to be accessed from the outside anymore
      # only port-forwarded ports can be kept
      # - "8080:8080"
      - "6881:6881"
      - "6881:6881/udp"

  vt-backend:
    image: ghcr.io/vuetorrent/vuetorrent-backend:latest
    container_name: vuetorrent-backend
    restart: unless-stopped
    environment:
      # This controls the location of VueTorrent's synced configuration
      # MUST match the 1st volume mount (only the right part)
      - CONFIG_PATH=/config
      # Backend port needs to match qbit one to avoid "Host header validation" issues
      - PORT=8080
      - QBIT_BASE=http://qbit:8080
      # Managed VueTorrent release type
      # Either "stable" for latest or "dev" for nightly
      - RELEASE_TYPE=stable
      # Only enable if using self-signed certificates for qBittorrent's API
      # - USE_INSECURE_SSL=true
    ports:
      # Every WebUI requests will now go through the backend
      - "8080:8080"
    volumes:
      # This volume mount has changed from "/app/data" to the CONFIG_PATH environment variable
      - "./docker/vuetorrent-backend:/config"

Tip

When using a reverse proxy, it may be wise to change your host rules according to this rework.

The qBittorrent rule can be moved to the backend if using the container name in the QBIT_BASE env. This change should be transparent as all api requests are forwarded to qBittorrent.

Clone this wiki locally