VueTorrent / vuetorrent-backend

Simple backend service to store configuration server-side
GNU General Public License v3.0
10 stars 2 forks source link

431 Error when using the backend with gluetun as the exit container #62

Open markgyoni opened 2 days ago

markgyoni commented 2 days ago

Hey, I'm trying to use the rewritten backend with gluetun but I'm getting the 431 Request Header Fields Too Large error but only on the "version" and "login requests" in the browser,

gluetun:
    image: qmcgaw/gluetun:latest
    container_name: gluetun
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun:/dev/net/tun
    ports:
      - 8000:8000/tcp
      - 51820:51820/udp
      - 51821:51821/tcp
      - 6881:6881
      - 6881:6881/udp
      - 8080:8080  # For vuetorrent-backend
    restart: unless-stopped
    volumes:
      - ./config/gluetun:/gluetun
    labels:
      - traefik, etc
    environment:
      - VPN_SERVICE_PROVIDER=mullvad
      - VPN_TYPE=wireguard
      - WIREGUARD_PRIVATE_KEY=
      - WIREGUARD_ADDRESSES=
      - SERVER_CITIES=
      - PUID=0
      - PGID=0

  qbittorrent:
    container_name: qbittorrent
    image: lscr.io/linuxserver/qbittorrent
    restart: unless-stopped
    network_mode: service:gluetun
    volumes:
      - ./config/qbittorrent:/config
      - ./storage/downloads:/downloads
      - ./vuetorrent:/ui
    environment:
      - PUID=0
      - PGID=0
    depends_on:
      - gluetun
      - vuetorrent-backend

  vuetorrent-backend:
    image: ghcr.io/vuetorrent/vuetorrent-backend:latest
    container_name: vuetorrent-backend
    network_mode: service:gluetun
    restart: unless-stopped
    environment:
      - QBIT_BASE=http://localhost:8080
      - PORT=8080
      - RELEASE_TYPE=stable
      - UPDATE_VT_CRON=0 * * * *
      - CONFIG_PATH=/config
    volumes:
      - ./config/vuetorrent-backend:/config
    labels:
      - traefik.enable=true
      - traefik.http.routers.vuetorrent-backend.entrypoints=web
      - traefik.http.routers.vuetorrent-backend.rule=Host(`qbt.media.markgyoni.dev`) && PathPrefix(`/server`)
    depends_on:
      - gluetun

Using nginx as top level reverse proxy and traefik between containers. I tried this in nginx with no results: large_client_header_buffers 4 32k;

Thanks in advance!

Larsluph commented 1 day ago

This is usually caused by having too many cookies, the only one that should matter is the one qbit uses for authenticating.

Try clearing site data and try again.

markgyoni commented 1 day ago

I tried clearing browser data earlier and I'm trying it in a different browser too.

The request with the headers: Untitled

If you want I can also send the link to contact@larsluph.dev

Larsluph commented 1 day ago

You can send everything to my email so that I can check this.

It isn't something I've seen before with VueTorrent...

markgyoni commented 1 day ago

Thanks, sent!

Larsluph commented 22 hours ago

I tried sending a basic request to those endpoints and it looks like any requests with the /api/v2 endpoint (those reaching qBittorrent's API) are failing with a 431 error code, even by disabling all headers and only leaving the default ones.

I'm not aware of any limitation in qBittorrent, we can still try to display those headers to see if any headers may be long enough to break everything.

I've created a special tag for this: ghcr.io/vuetorrent/vuetorrent-backend:log_headers. Again if you find sensitive information inside them you can send these by mail.