crazy-max / docker-rtorrent-rutorrent

rTorrent and ruTorrent Docker image
MIT License
503 stars 112 forks source link

"Remove" torrent now deletes data #319

Closed dstyp closed 7 months ago

dstyp commented 10 months ago

Support guidelines

I've found a bug and checked that ...

Description

Initially reported in the official rutorrent repo. But @stickz was kind enough to inform this apparently is a docker issue.

Copypasta report from there:


Please complete the following tasks.

Web browser cache cleared
Link provided to install script if applicable
Not using broken rtinst install script
Web browser, ruTorrent, PHP and OS version provided

Tell us about your environment

Web Browser: Tested on macOS 14.2.1 - Firefox 121.0.1 & Chrome 120.0.6099.234 ruTorrent: 4.2.9 PHP: PHP 8.2.7 OS: Debian 12 Tell us how you installed ruTorrent

Docker - https://github.com/crazy-max/docker-rtorrent-rutorrent/ Describe the bug

Right-click a torrent in list and choosing "Remove" will now delete all data. No prompt or warning. This all while rendering the remaining file still present but with 0b. This is what I assume is the same behavior that "Remove And... - Delete Data" should do.

Change in behavior that seems like a bug but am not sure if I missed some update where this behavior changed? If so - what is the option "Remove And... - Delete Data" supposed to do? Steps to reproduce

Open rutorrent and have a completed torrent in the list
Choose "Remove"
Torrent data will be deleted

Expected behavior

Remove torrent from rutorrent (list) but keep all data intact.

Expected behaviour

Remove torrent from rutorrent (list) but keep all data intact.

Actual behaviour

Deleting data (but not files).

Steps to reproduce

  1. Open rutorrent and have a completed torrent in the list
  2. Choose "Remove"
  3. Torrent data will be deleted

Docker info

Client: Docker Engine - Community
 Version:    25.0.0
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.12.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.24.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 8
  Running: 7
  Paused: 0
  Stopped: 1
 Images: 88
 Server Version: 25.0.0
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: a1496014c916f9e62104b33d1bb5bd03b0858e59
 runc version: v1.1.11-0-g4bccb38
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.1.0-17-amd64
 Operating System: Debian GNU/Linux 12 (bookworm)
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 31.2GiB
 Name: <REDACTED>
 ID: <REDACTED>
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Docker Compose config

name: rtorrent-rutorrent
services:
  geoip-updater:
    container_name: geoip-updater
    environment:
      DOWNLOAD_PATH: /data
      EDITION_IDS: GeoLite2-City,GeoLite2-Country
      LICENSE_KEY: ""
      LOG_JSON: "false"
      LOG_LEVEL: info
      SCHEDULE: 0 0 * * 0
      TZ: Europe/Berlin
    image: crazymax/geoip-updater:latest
    networks:
      rtorrent-rutorrent: null
    restart: always
    volumes:
      - type: bind
        source: /opt/rtorrent-rutorrent/data/geoip
        target: /data
        bind:
          create_host_path: true
  rtorrent-logs:
    command:
      - bash
      - -c
      - tail -f /log/*.log
    container_name: rtorrent-rutorrent-logs
    depends_on:
      rtorrent-rutorrent:
        condition: service_started
        required: true
    image: bash
    network_mode: none
    restart: always
    volumes:
      - type: bind
        source: /opt/rtorrent-rutorrent/data/rtorrent/log
        target: /log
        bind:
          create_host_path: true
  rtorrent-rutorrent:
    container_name: rtorrent-rutorrent
    environment:
      AUTH_DELAY: 0s
      LOG_ACCESS: "true"
      LOG_IP_VAR: remote_addr
      MAX_FILE_UPLOADS: "50"
      MEMORY_LIMIT: 1024M
      OPCACHE_MEM_SIZE: "128"
      PGID: "1001"
      PUID: "1001"
      REAL_IP_FROM: 0.0.0.0/32
      REAL_IP_HEADER: X-Forwarded-For
      RT_DHT_PORT: "6881"
      RT_INC_PORT: "50000"
      RT_LOG_EXECUTE: "false"
      RT_LOG_LEVEL: info
      RT_LOG_XMLRPC: "false"
      RU_DO_DIAGNOSTIC: "true"
      RU_FORBID_USER_SETTINGS: "false"
      RU_HTTP_TIME_OUT: "30"
      RU_HTTP_USE_GZIP: "true"
      RU_HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0
      RU_LOCALE: UTF8
      RU_LOG_FILE: /data/rutorrent/rutorrent.log
      RU_LOG_RPC_CALLS: "false"
      RU_LOG_RPC_FAULTS: "true"
      RU_OVERWRITE_UPLOADED_TORRENTS: "false"
      RU_PHP_GZIP_LEVEL: "2"
      RU_PHP_USE_GZIP: "false"
      RU_REMOVE_CORE_PLUGINS: httprpc
      RU_RPC_TIME_OUT: "5"
      RU_SAVE_UPLOADED_TORRENTS: "true"
      RU_SCHEDULE_RAND: "10"
      RUTORRENT_AUTHBASIC_STRING: ruTorrent restricted access
      RUTORRENT_PORT: "8080"
      TZ: Europe/Berlin
      UPLOAD_MAX_SIZE: 16M
      WAN_IP_CMD: "false"
      WEBDAV_AUTHBASIC_STRING: WebDAV restricted access
      WEBDAV_PORT: "9000"
      XMLRPC_AUTHBASIC_STRING: rTorrent XMLRPC restricted access
      XMLRPC_PORT: "8000"
    expose:
      - 6881/udp
      - "8000"
      - "8080"
      - "9000"
      - "50000"
    image: crazymax/rtorrent-rutorrent:latest
    networks:
      rtorrent-rutorrent: null
    ports:
      - target: 6881
        published: "6881"
        protocol: udp
      - target: 8080
        published: "8080"
        protocol: tcp
      - target: 9000
        published: "9000"
        protocol: tcp
      - target: 50000
        published: "50000"
        protocol: tcp
    restart: always
    ulimits:
      nofile:
        soft: 32000
        hard: 40000
      nproc: 65535
    volumes:
      - type: bind
        source: /opt/rtorrent-rutorrent/data
        target: /data
        bind:
          create_host_path: true
      - type: bind
        source: /opt/rtorrent-rutorrent/passwd
        target: /passwd
        bind:
          create_host_path: true
      - type: bind
        source: /media/
        target: /media
        bind:
          create_host_path: true
networks:
  rtorrent-rutorrent:
    name: rtorrent-rutorrent

Logs

not applicable

Additional info

thanks :)

stickz commented 10 months ago

Your configuration files are most likely outdated with the latest version of the docker container. I would recommend checking your .rtorrent.rc file and comment out this line. ruTorrent has since improved. It's no longer required.

# Erase data when torrent deleted (no need erasedata plugin on ruTorrent)
method.set_key = event.download.erased,delete_erased,"execute=rm,-rf,--,$d.data_path="
dstyp commented 10 months ago

Your configuration files are most likely outdated with the latest version of the docker container. I would recommend checking your .rtorrent.rc file and comment out this line. ruTorrent has since improved. It's no longer required.

# Erase data when torrent deleted (no need erasedata plugin on ruTorrent)
method.set_key = event.download.erased,delete_erased,"execute=rm,-rf,--,$d.data_path="

Thanks, works fine!

Would you recommend grabbing the latest .rtorrent.rc and remake any customizations?

stickz commented 10 months ago

The remaining changes are in .rtlocal.rc. They were pulled automatically. This file is derived from your environment variables and executes before .rtorrent.rc. I don't see anything else wrong with your docker container looking at the diagnostics.

I do plan to submit a pull request to adjust the send and receive buffers on rTorrent. We can improve throughput overriding the operating system values for the tcp rmem/wmem. This needs to go in .rtlocal.rc, so it's not required to remake .rtorrent.rc.