Coder Social home page Coder Social logo

rtorrent's Introduction

RTorrent BitTorrent Client

rTorrent is a stable, high-performance and low resource consumption BitTorrent client.

This distribution focuses on additional user-facing features, optimizations and better integrations with modern users of RPC interfaces. One of the long-term goal of this project is to switch from antique XML-RPC to modern protocols with bidirectional capabilities such as gRPC, JSON-RPC over WebSocket or GraphQL, which allows real-time events, less serialization/transfer overheads, better security, etc.

There is NO CHANGE in consensus-layer (BitTorrent protocol). As such, this distribution will behave exactly the same as vanilla rTorrent in the swarm, and there will not be any compatibility issue with certain trackers, if rTorrent 0.9.8 is supported.

Getting started

Installation

Fully static binaries are available at Releases.

# Install rTorrent to /usr/local/bin/rtorrent
# rtorrent-linux-amd64 and rtorrent-linux-arm64 are available
sudo wget https://github.com/jesec/rtorrent/releases/latest/download/rtorrent-linux-amd64 -O /usr/local/bin/rtorrent

# Make it executable
sudo chmod +x /usr/local/bin/rtorrent

# Default configuration
sudo mkdir -p /etc/rtorrent
sudo wget https://github.com/jesec/rtorrent/releases/latest/download/rtorrent.rc -O /etc/rtorrent/rtorrent.rc

# Install as a systemd service (optional)
# This example uses "download" user. Replace it with the an existing user that rTorrent should run with.
sudo wget https://github.com/jesec/rtorrent/releases/latest/download/[email protected] -O /etc/systemd/system/[email protected]
sudo systemctl daemon-reload
sudo systemctl enable rtorrent@download
sudo systemctl start rtorrent@download

Or install with APT repository

Or run with Docker

Or build from source

Use

Run rtorrent

You can execute rTorrent commands to set port, set announced IP, etc.

For example, to launch rTorrent with port 6881 and DHT disabled, rtorrent -o network.port_range.set=6881-6881,dht.mode.set=disable.

Checkout Flood, a modern Web UI for rTorrent.

To learn how to use rTorrent visit the Wiki.

Configuration

Default configuration file is available at doc/rtorrent.rc. It is often installed to /etc/rtorrent/rtorrent.rc.

You may modify the configuration file to fit your needs. Alternatively, use -o, as documented above, to override some configurations but keep using the loaded configuration file.

It is recommended to expand upon the default configuration if user-specific config files (usually placed to $HOME/.rtorrent.rc) are used:

## Import default configurations
import = /etc/rtorrent/rtorrent.rc

## Your configurations
...

rTorrent tries to load a configuration file from several locations:

  • $XDG_CONFIG_HOME/rtorrent/rtorrent.rc (highest priority)
  • $HOME/.config/rtorrent/rtorrent.rc
  • $HOME/.rtorrent.rc
  • /etc/rtorrent/rtorrent.rc (lowest priority)

Or, use -n argument to prevent rTorrent from loading any configuration file. Then you can use -o try_import=<path> to load a config file from an arbitrary location.

Build

Bazel

Bazel 3 or later is required.

Bazel manages most dependencies.

Dependencies are specified by the WORKSPACE file. Sometimes you may want to override a specific dependency with a local repository for easier development. To do that, use override_repository Bazel command line argument. For example, --override_repository=libtorrent=/path/to/local/libtorrent.

Unmanaged dependencies:

  • GCC/Clang compiler toolchain and C/C++ development files (C++17 support required)
# Install Bazel
# Use the build of your system and architecture
# bazelisk-linux-arm64 and bazelisk-darwin-amd64 are also available
sudo wget https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 -O /usr/local/bin/bazel
sudo chmod +x /usr/local/bin/bazel

# Install unmanaged dependencies and build tools
# Use the package manager of your distribution
sudo apt install build-essential

# Clone repository
git clone https://github.com/jesec/rtorrent.git
cd rtorrent

# Build
# By default, the executable is self contained, yet it depends on C/C++ standard libraries of system.
# To generate a fully static executable, use --features=fully_static_link argument.
# Note that glibc have issues that make static executables unreliable.
# If you want fully static, reproducible, portable and stable executable, build with Dockerfile.
bazel build rtorrent

# Binary available at bazel-bin/rtorrent

CMake

CMake 3.5 or later is required.

You have to install dependencies manually to system or let CMake know where to find them.

Dependencies:

  • GCC/Clang compiler toolchain and C/C++ development files (C++17 support required)
  • libtorrent with development files (core dependency, matching version required)
  • libcurl with development files
  • libncurses/libncursesw with development files (for terminal UI)
  • libxmlrpc-c with development files (optional if USE_XMLRPC=OFF, for XML-RPC support)
  • nlohmann/json with development files (optional if USE_JSONRPC=OFF, for JSON-RPC support)
  • googletest with development files (optional, for unit tests)
# Compile and install libtorrent (matching version required)
# Check README of libtorrent for instructions

# Install dependencies and build tools
# Use the package manager of your distribution
sudo apt install build-essential cmake libc6-dev libcurl4-openssl-dev libncursesw5-dev libxmlrpc-c++8-dev libgtest-dev nlohmann-json3-dev

# Clone repository
git clone https://github.com/jesec/rtorrent.git
cd rtorrent

# Configure and generate Makefile
cmake .

# Build
# By default, shared binaries are generated
make

# Binary available at ./rtorrent

# Install (optional)
sudo make install

Docker

Dockerfile

To test: docker run -it jesec/rtorrent

Note that you have to expose BitTorrent port (e.g. -p 50000:50000) and map folders (e.g. -v /home/download:/home/download) yourself.

By default, rTorrent's files are located in $HOME/.local/share/rtorrent. Check doc/rtorrent.rc to know more about the default configurations.

To integrate with Flood, see discussions.

Donate to rTorrent development

Donate

  • Paypal
  • Patreon
  • SubscribeStar
  • BitCoin: 1MpmXm5AHtdBoDaLZstJw8nupJJaeKu8V8
  • Etherium: 0x9AB1e3C3d8a875e870f161b3e9287Db0E6DAfF78
  • LiteCoin: LdyaVR67LBnTf6mAT4QJnjSG2Zk67qxmfQ

Help keep rTorrent development going by donating to its creator.

rtorrent's People

Contributors

artagnon avatar chros73 avatar cpugeniusmv avatar duraki avatar g0tmi1k avatar gulafaran avatar hkjn avatar jesec avatar kannibalox avatar lotheac avatar micdu70 avatar mvucbmm0 avatar mynamewastaken avatar netpok avatar nicholi avatar pyroscope avatar rakshasa avatar recursiveforest avatar rsully avatar salorium avatar sineswiper avatar skangas avatar slingamn avatar speeddymon avatar ss23 avatar toff avatar trogious avatar waveletlet avatar yate avatar zp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

rtorrent's Issues

Torrents not removed from session after deleting

When deleting (a large amount of) torrents, sometimes a portion of them don't get removed from the session directory. After restarting the client, these torrents are stopped.

To reproduce:

  1. Delete a large amount of torrents with Flood
  2. Wait for the operation to succeed
  3. Restart rTorrent

Version: 0.9.8-r16

Docker image not running

I'm trying to run rtorrent inside docker with this image. But all I get is an error

rtorrent: std::bad_alloc
rtorrent: std::bad_alloc
rtorrent: std::bad_alloc
rtorrent: std::bad_alloc
rtorrent: std::bad_alloc

This is my compose.yaml file:

services:
    rtorrent:
        hostname: rtorrent
            image: jesec/rtorrent:0.9.8-r16
            container_name: rtorrent
            user: 1000:1000
            restart: unless-stopped
            command: -o network.port_range.set=6881:6881, system.daemon.set=true
            environment:
                HOME: /config
            volumes:
                - ./dlconfig:/config
                - ./data:/data
            ports:
                - 6881:6881

I'm not sure what exactly is going wrong here.

request: PKGBUILD

Hey, thanks for your work on improving rtorrent. I'm also enjoying your nodejs-flood AUR package, and it would be great to see a PKGBUILD for your rtorrent fork in the AUR as well.

You might run into an issue where a moderator doesn't think your changes to rtorrent are substantive enough to merit an AUR package for it and deletes it. I've run into this before. In this case, if you could have the CI upload an up-to-date PKGBUILD to the releases, that would make it easier for Arch users to keep up to date with this package.

If you feel like it, it might be nice to have a CHANGES document listing the most significant changes you've made to vanilla rtorrent. I've been appreciating the access to sequential download from Flood, but it would be nice to know what else is different without having to trawl through commits. (A list of changes would also help justify an AUR package at some point, I suspect.)

List of Compelling Changes

I see you've added JSON, and a few other items, but looking high and low, I can't find a list of changes, particularly the compelling ones that would cause someone to pick this over the vanilla version.

Am I missing something, help a guy out?

Feature request: Suport systemd notify

Would you be open to accepting a patch that lets rtorrent notify systemd when it is ready?
This would allow writing of systemd service files that start flood/rutorrent after rtorrent has started up.

The systemd service type would switch to Type=notify.

Assuming you're okay with this, my plan would be the following.

I'm thinking I'll have this behind a configure flag, since the simplest approach would involve calling sd_notify. -DUSE_SYSTEMD seems like the reasonable flag for CMake.

I'm less familiar with Bazel, any pointers to how to support a build option like that with Bazel would be appreciated.

To high number of announces

Currently I have been informed that there might be an issue with announce times...
It seems as if I would be sending at least double the announces then the tracker wants.. And Maybe the client even ignores the wait time send by the tracker...
I'm not entirely sure how I can prove it. I'm using hotios rflood image: https://hotio.dev/containers/rflood/
My config looks like this:

#############################################################################
# A minimal rTorrent configuration that provides the basic features
# you want to have in addition to the built-in defaults.
#
# See https://github.com/rakshasa/rtorrent/wiki/CONFIG-Template
# for an up-to-date version.
#############################################################################


## Instance layout (base paths)
method.insert = cfg.basedir,  private|const|string, (cat,"/config/")
method.insert = cfg.download, private|const|string, (cat,(cfg.basedir),"download/")
method.insert = cfg.logs,     private|const|string, (cat,(cfg.basedir),"log/")
method.insert = cfg.logfile,  private|const|string, (cat,(cfg.logs),"rtorrent-",(system.time),".log")
method.insert = cfg.session,  private|const|string, (cat,(cfg.basedir),"session/")
method.insert = cfg.watch,    private|const|string, (cat,(cfg.basedir),"watch/")


## Create instance directories
execute.throw = sh, -c, (cat,\
    "mkdir -p \"",(cfg.download),"\" ",\
    "\"",(cfg.logs),"\" ",\
    "\"",(cfg.session),"\" ",\
    "\"",(cfg.watch),"/load\" ",\
    "\"",(cfg.watch),"/start\" ")


## Listening port for incoming peer traffic (fixed; you can also randomize it)
network.port_range.set = 50000-50000
network.port_random.set = no


## Tracker-less torrent and UDP tracker support
## (conservative settings for 'private' trackers, change for 'public')
dht.mode.set = disable
protocol.pex.set = no

trackers.use_udp.set = no


## Peer settings
throttle.max_uploads.set = 100
throttle.max_uploads.global.set = 250

throttle.min_peers.normal.set = 0
throttle.max_peers.normal.set = 60
throttle.min_peers.seed.set = 0
throttle.max_peers.seed.set = 80
trackers.numwant.set = 80

protocol.encryption.set = allow_incoming,try_outgoing,enable_retry


## Limits for file handle resources, this is optimized for
## an `ulimit` of 1024 (a common default). You MUST leave
## a ceiling of handles reserved for rTorrent's internal needs!
network.http.max_open.set = 50
network.max_open_files.set = 600
network.max_open_sockets.set = 300


## Memory resource usage (increase if you have a large number of items loaded,
## and/or the available resources to spend)
pieces.memory.max.set = 1800M
network.xmlrpc.size_limit.set = 4M


## Basic operational settings (no need to change these)
session.path.set = (cat, (cfg.session))
directory.default.set = (cat, (cfg.download))
log.execute = (cat, (cfg.logs), "execute.log")
#log.xmlrpc = (cat, (cfg.logs), "xmlrpc.log")
execute.nothrow = sh, -c, (cat, "echo >",\
    (session.path), "rtorrent.pid", " ",(system.pid))


## Other operational settings (check & adapt)
encoding.add = utf8
system.umask.set = 0027
system.cwd.set = (directory.default)
network.http.dns_cache_timeout.set = 25
schedule2 = monitor_diskspace, 15, 60, ((close_low_diskspace, 1000M))
#pieces.hash.on_completion.set = no
#view.sort_current = seeding, greater=d.ratio=
#keys.layout.set = qwerty
#network.http.capath.set = "/etc/ssl/certs"
#network.http.ssl_verify_peer.set = 0
#network.http.ssl_verify_host.set = 0


## Some additional values and commands
method.insert = system.startup_time, value|const, (system.time)
method.insert = d.data_path, simple,\
    "if=(d.is_multi_file),\
        (cat, (d.directory), /),\
        (cat, (d.directory), /, (d.name))"
method.insert = d.session_file, simple, "cat=(session.path), (d.hash), .torrent"


## Watch directories (add more as you like, but use unique schedule names)
## Add torrent
schedule2 = watch_load, 11, 10, ((load.verbose, (cat, (cfg.watch), "load/*.torrent")))
## Add & download straight away
schedule2 = watch_start, 10, 10, ((load.start_verbose, (cat, (cfg.watch), "start/*.torrent")))


## Run the rTorrent process as a daemon in the background
## (and control via XMLRPC sockets)
#system.daemon.set = true
#network.scgi.open_local = (cat,(session.path),rpc.socket)
#execute.nothrow = chmod,770,(cat,(session.path),rpc.socket)


## Logging:
##   Levels = critical error warn notice info debug
##   Groups = connection_* dht_* peer_* rpc_* storage_* thread_* tracker_* torrent_*
print = (cat, "Logging to ", (cfg.logfile))
log.open_file = "log", (cfg.logfile)
log.add_output = "info", "log"
#log.add_output = "tracker_debug", "log"

### END of rtorrent.rc ###

I recently changed from
throttle.min_peers.normal.set = 20
throttle.min_peers.seed.set = 30

But I dont think this will fix the issue..

How can I support to find out what the problem might be?

Can't run any commands like bash, mkdir, ls in container

I am trying to switch from wonderfall's rtorrent-flood to this image + flood, and I don't know if this is expected, but I think this is what is preventing me from moving completed downloads:

docker exec -it rtorrent-peioe "mkdir --help"
OCI runtime exec failed: exec failed: unable to start container process: exec: "mkdir --help": executable file not found in $PATH: unknown

docker exec -it rtorrent-peioe ls
OCI runtime exec failed: exec failed: unable to start container process: exec: "ls": executable file not found in $PATH: unknown

docker exec -it rtorrent-peioe sh
OCI runtime exec failed: exec failed: unable to start container process: exec: "sh": executable file not found in $PATH:

Is there anything I can do about this ?

Log to stdout

Hello,

I'm currently trying to output logs to stdout in order to take advantage of s6 log handling system, here what I did so far:

...
log.open_file = "main", (cat, "/dev/stdout")

# Based on levels defined here: https://github.com/jesec/libtorrent/blob/master/include/torrent/utils/log.h
log.add_output = "dht_info", "main"
log.add_output = "peer_info", "main"
...

After granting the user running rtorrent the rights to write to /dev/pts/0, logging correctly appears in stdout:

rTorrent: started, 0 torrents loaded
1653143350 N rtorrent scgi: Starting thread.
1653143350 N rtorrent main: Starting thread.

But an error msg pops before any output: Error in option file: /config/rtorrent/rtorrent.d/05-log.rc:2: Could not open log file '/dev/stdout'.

I was wondering if that's a good way to go - my c++ fu is pretty basic and I don't really know the semantics/primitives to write to stdout in this language haha - or whether stdout support requires some adjustments and should be a feature request.

For additional context, with this setup, s6-overlay logging capture feature is not working as expected: only the aforementioned log line is captured endlessly. AFAIU this feature works by creating in/out fd for each program and passing them around (hope I got it right), could this be related to the fact that I specified /dev/stdout explicitely?

Thanks for the help! Happy to provide any info

documentation issue: requires custom libtorrent

As per my comment here, I was going to try to write a PKGBUILD for this rtorrent fork. I wanted to use cmake because a dynamic build that uses libraries managed by the package manager would be ideal for an Arch package.

The readme says:

libtorrent with development files (core dependency, matching version required)

But this suggests that I should be able to just use the correct system vendored libtorrent (0.13.8), it's not clear that I need to use a fork (or that one even exists). Took me some time to figure this out.

For example, /usr/include/torrent/utils/ranges.h tries to include rak/functional.h, but you've removed this from your rtorrent fork, and your version of libtorrent no longer includes it.

Of course this issue doesn't show up for the bazel build, but I don't have as much interest in a PKGBUILD that pulls in a bunch of internet dependencies for a static build. I think what this means is that a PKGBUILD would need to depend on something like libtorrent-jesec, which would be a separate PKGBUILD in the AUR.

(Sorry if I somehow misunderstood this issue, I mainly work with high level languages like Python.)

Unable to override `method.insert` configurations

I want to use a custom .rtorrent.rc config, extending the default config, as per https://github.com/jesec/rtorrent/blob/master/doc/rtorrent.rc instructions.

The problem: all the command definitions using method.insert can't be redefined, e.g., if I would add a line for method.insert = cfg.download with a different assignment in my custom config, rtorrent would throw "Invalid key" error and fail to start. In order to have my custom value, I need to use a different name (e.g., method.insert = cfg.download2). And then don't forget to override the usage as well, in this case directory.default.set option.

I'm not sure if this can be "fixed" in a straightforward way, or maybe that's just the way method.insert assignments work. Especially considering you explicitly create directories in the default config as well.

Low disk space check not working properly

downloadList->close(*itr);
(*itr)->set_hash_failed(true);
(*itr)->set_message(std::string("Low diskspace."));

On v0.9.8-r16, I have not seen the "Low diskspace" error message more often than seeing it. Torrents stop successfully, and "Closed torrents due to low diskspace" is logged, it's just that I don't see the "Low diskspace" error message on the torrents. I do believe that I have seen it before, though.

rTorrent is unabled to use socket file

Hey !
I'm trying to install a vpn+rtorrent+flood stack but I'm stuck with the socket file use.

Here are my main configuration files :

My compose file
version: '3.7'

networks:
  web:
    external: true
  internal:
    external: false
    driver: bridge

services :
  vpn:
    image: bubuntux/nordvpn:latest
    network_mode: bridge
    container_name: nordvpnwireguard
    cap_add:
      - NET_ADMIN  # Required
    devices:
      - /dev/net/tun
    environment: # Review https://github.com/bubuntux/nordvpn#environment-variables
      - USER=username
      - "PASS=passphrase"
      - CONNECT=Somewhere
      - TECHNOLOGY=NordLynx
      - NETWORK=192.168.1.0/24
      
  torrent:
    image: jesec/rtorrent
    network_mode: service:vpn
    container_name: rtorrent
    user: 1001:1001
    restart: unless-stopped
    environment:
      XDG_CONFIG_HOME: /config 
    volumes:
      - /tmp/rtorrent/config/rtorrent.rc:/config/rtorrent/rtorrent.rc
      - /tmp/rtorrent.socket:/tmp/rtorrent.socket
      - /downloads:/downloads
      - /downloads/torrents/watch:/watch
    depends_on:
      - vpn
    
  flood:
    image: jesec/flood:latest
    container_name: flood
    user: 1001:1001
    restart: unless-stopped
    command: --allowedpath /data
    volumes:
      - /tmp/flood/config:/config
      - /downloads:/downloads
      - /tmp/rtorrent.socket:/tmp/rtorrent.socket
    labels:
      # Traefik Config omitted
    networks:
      - web
      - internal
    depends_on:
      - torrent
      - vpn
My rtorrent.rc file
# /tmp/rtorrent/config/rtorrent.rc
#############################################################################
# A minimal rTorrent configuration that provides the basic features
#############################################################################

# Some default configs are commented out by #, you can override them to fit your needs
# Lines commented out by ## are merely examples (NOT default)

# It is recommended to extend upon this default config file. For example:
# override only some configs via command line: -o network.port_range.set=6881-6881
# or, on top of custom config: import = /etc/rtorrent/rtorrent.rc

# rTorrent runtime directory (cfg.basedir) [default: "$HOME/.local/share/rtorrent"]
method.insert = cfg.basedir,  private|const|string, (cat,(fs.homedir),"/.local/share/rtorrent/")

# Default download directory (cfg.download) [default: "$(cfg.basedir)/download"]
method.insert = cfg.download, private|const|string, (cat,"/downloads/")

# Log directory (cfg.logs) [default: "$(cfg.basedir)/log"]
method.insert = cfg.logs,     private|const|string, (cat,(cfg.basedir),"log/")
method.insert = cfg.logfile,  private|const|string, (cat,(cfg.logs),"rtorrent-",(system.time),".log")

# Torrent session directory (cfg.session) [default: "$(cfg.basedir)/.session"]
method.insert = cfg.session,  private|const|string, (cat,(cfg.basedir),".session/")

# Watch (drop to add) directories (cfg.watch) [default: "$(cfg.basedir)/watch"]
method.insert = cfg.watch,    private|const|string, (cat,"/watch/")
# Create directories
fs.mkdir.recursive = (cat,(cfg.basedir))

fs.mkdir = (cat,(cfg.download))
fs.mkdir = (cat,(cfg.logs))
fs.mkdir = (cat,(cfg.session))

fs.mkdir = (cat,(cfg.watch))
fs.mkdir = (cat,(cfg.watch),"/load")
fs.mkdir = (cat,(cfg.watch),"/start")

# Drop to "$(cfg.watch)/load" to add torrent
schedule2 = watch_load, 11, 10, ((load.verbose, (cat, (cfg.watch), "load/*.torrent")))

# Drop to "$(cfg.watch)/start" to add torrent and start downloading
schedule2 = watch_start, 10, 10, ((load.start_verbose, (cat, (cfg.watch), "start/*.torrent")))

# Listening port for incoming peer traffic
#network.port_range.set = 6881-6999
network.port_range.set = 6881-6881
#network.port_random.set = yes

# Distributed Hash Table and Peer EXchange
# Enable tracker-less torrents but vulnerable to passive sniffing
# DHT and PEX are always disabled for private torrents
#dht.mode.set = auto
#dht.port.set = 6881
#protocol.pex.set = yes

# DHT nodes for bootstrapping
dht.add_bootstrap = dht.transmissionbt.com:6881
dht.add_bootstrap = dht.libtorrent.org:25401

# UDP tracker support
#trackers.use_udp.set = yes

# Peer settings
throttle.max_uploads.set = 100
throttle.max_uploads.global.set = 250
throttle.min_peers.normal.set = 20
throttle.max_peers.normal.set = 60
throttle.min_peers.seed.set = 30
throttle.max_peers.seed.set = 80
trackers.numwant.set = 80

#protocol.encryption.set = allow_incoming,try_outgoing,enable_retry

# Limits for file handle resources, this is optimized for
# an `ulimit` of 1024 (a common default). You MUST leave
# a ceiling of handles reserved for rTorrent's internal needs!
network.max_open_files.set = 600
network.max_open_sockets.set = 300

# Memory resource usage (increase if you have a large number of items loaded,
# and/or the available resources to spend)
pieces.memory.max.set = 1800M
#network.xmlrpc.size_limit.set = 16M

# Basic operational settings
session.path.set = (cat, (cfg.session))
directory.default.set = (cat, (cfg.download))
log.execute = (cat, (cfg.logs), "execute.log")
##log.xmlrpc = (cat, (cfg.logs), "xmlrpc.log")

# Other operational settings
encoding.add = utf8
system.umask.set = 0027
system.cwd.set = (directory.default)
#schedule2 = low_diskspace, 5, 60, ((close_low_diskspace, 500M))
#pieces.hash.on_completion.set = no
##view.sort_current = seeding, greater=d.ratio=
##keys.layout.set = qwerty

# HTTP and SSL
network.http.max_open.set = 50
network.http.dns_cache_timeout.set = 25

# Path to the CA bundle. By default, rTorrent tries to detect from:
#   $RTORRENT_CA_BUNDLE (highest priority)
#   $CURL_CA_BUNDLE
#   $SSL_CERT_FILE
#   /etc/ssl/certs/ca-certificates.crt
#   /etc/pki/tls/certs/ca-bundle.crt
#   /usr/share/ssl/certs/ca-bundle.crt
#   /usr/local/share/certs/ca-root-nss.crt
#   /etc/ssl/cert.pem (lowest priority)
##network.http.cacert.set = /etc/ssl/certs/ca-certificates.crt

# Path to the certificate directory to verify the peer. The certificates
# must be in PEM format, and the directory must have been processed using
# the c_rehash utility supplied with openssl.
#
# For advanced users only, generally you should use network.http.cacert.set
# to specify path to the bundle of certificates.
##network.http.capath.set = "/etc/ssl/certs"

#network.http.ssl_verify_peer.set = 1
#network.http.ssl_verify_host.set = 1

## Run the rTorrent process as a daemon in the background
system.daemon.set = true

# XML-RPC interface
network.scgi.open_local = (cat,"/tmp/rtorrent.socket")

# Logging:
#   Levels = critical error warn notice info debug
#   Groups = connection_* dht_* peer_* rpc_* storage_* thread_* tracker_* torrent_*
print = (cat, "Logging to ", (cfg.logfile))
log.open_file = "log", (cfg.logfile)
log.add_output = "info", "log"
##log.add_output = "tracker_debug", "log"

### END of rtorrent.rc ###

The rtorrent.rc is used by rtorrent but it does through a error while using the socket, here is the log of the container :

Error in option file: /config/rtorrent/rtorrent.rc:130: Could not prepare socket for listening: Address in use

refering this line :

# XML-RPC interface
network.scgi.open_local = (cat,"/tmp/rtorrent.socket")

The socket file on host :

$ ls -al /tmp/
drwxr-xr-x  2 1001  1001    4096 Nov  7 11:39 rtorrent.socket

Test with nc on host:

$ nc -lkU /tmp/rtorrent.socket
nc: Address already in use

: 6881 port is not used on host (checked with netstat -anop | grep 6881)

What do I miss ?

rtorrent not responding in docker

Flood is running and rtorrent is not responding. Are there more details logs anywhere? UI stuck on loading screen with call to /api/client/settings pending forever
Running in docker.

$ docker logs rtorrent
rTorrent: loading 182 entries from session directory
rTorrent: started, 182 torrents loaded
Caught internal_error: TrackerController cannot set timeout when inactive.
Stack dump not enabled.
rTorrent: loading 248 entries from session directory
rTorrent: started, 248 torrents loaded
Caught internal_error: TrackerController cannot set timeout when inactive.
Stack dump not enabled.
rTorrent: loading 196 entries from session directory
rTorrent: started, 196 torrents loaded
rTorrent: loading 109 entries from session directory
rTorrent: started, 109 torrents loaded

Extreme memory usage instantly when starting rtorrent container [weird issue]

I've been using your rtorrent docker image for ages now, without issue. I've recently moved houses (including my server), so I spun everything down, before spinning it up again in the new house. Everything works as expected, EXCEPT for rtorrent.

Starting rtorrent causes it to use an extreme amount of memory (even if set up from scratch using a minimal docker-compose file and your rtorrent.rc file).

See how much the memory increases when starting the container:

Screen.Recording.2022-11-21.at.10.41.03.mov

It exits with error 137 which means a container or pod is trying to use more memory than it's allowed.

The only console log output I get is:

[52874.426076] Out of memory: Killed process 550961 (rtorrent) total-um:33559656kB, anon-rss:2754180
3kB, file-rss:4kB, shmem-rss:0kB, UID: 1000 pgtables :53956kB oom_score_adj:0

docker-compose.yml:

version: '3.7'

services:
  rtorrent:
    container_name: rtorrent-test
    image: jesec/rtorrent
    command: -o system.daemon.set=true
      HOME: /config
    volumes:
      - ./conf:/config

I can't wrap my head around what can cause this. Any help is much appreciated!

Thanks!

Build error

Hello,

I tied to build the master branch with bazel 6.2.1 and GCC 12.2.0 and the process end up with this error :

error: '__builtin_memset' forming offset 16 is out of the bounds

Looks like a regression with GCC 12 ?

Multi user support

Would it be possible to add multi user support to rtorrent? By that I mean being able to run one instance of rtorrent but presenting independent lists of running torrents (and allowing each user to add/remove torrents independently) according to a user parameter passed in RPC calls. Basically make RPC calls behave like any standard multi-user web API.

Intended use case would be running rtorrent as a daemon in the context of its own user with a webUI like flood or transmission as the front-end, and having the web server relay the ID of the logged in user to RPC calls.

docker build failing

hi trying to build dockerimage via dockerfile provided in your repo but bazel seems to fail

❯ docker -v
Docker version 20.10.21, build baeda1f82a
❯ docker build -t rtorrent .
Sending build context to Docker daemon  1.878MB
Step 1/29 : ARG ALPINE_IMAGE=alpine:edge
Step 2/29 : FROM ${ALPINE_IMAGE} as build
 ---> 121d0da75751
Step 3/29 : WORKDIR /root/rtorrent
 ---> Using cache
 ---> 0becec4cb8bd
Step 4/29 : RUN echo https://dl-cdn.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories
 ---> Using cache
 ---> a1b717bf5970
Step 5/29 : RUN apk --no-cache add     bash     bazel     build-base     coreutils     gcompat     git     linux-headers     pythonispython3     python3     rpm
 ---> Using cache
 ---> 926245188a7c
Step 6/29 : RUN rpm --initdb
 ---> Using cache
 ---> 6f538059b0fd
Step 7/29 : COPY . ./
 ---> Using cache
 ---> 2ead94abb045
Step 8/29 : RUN if [[ `uname -m` == "aarch64" ]];     then sed -i 's/architecture = \"all\"/architecture = \"arm64\"/' BUILD.bazel;     elif [[ `uname -m` == "x86_64" ]];     then sed -i 's/architecture = \"all\"/architecture = \"amd64\"/' BUILD.bazel;     fi
 ---> Using cache
 ---> b2f8b0905ced
Step 9/29 : RUN bazel build rtorrent-deb rtorrent-rpm --features=fully_static_link --verbose_failures
 ---> Running in fecef0e5ad10
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Analyzing: 2 targets (1 packages loaded, 0 targets configured)
Analyzing: 2 targets (52 packages loaded, 347 targets configured)
Analyzing: 2 targets (60 packages loaded, 587 targets configured)
Analyzing: 2 targets (63 packages loaded, 587 targets configured)
Analyzing: 2 targets (63 packages loaded, 587 targets configured)
Analyzing: 2 targets (63 packages loaded, 587 targets configured)
Analyzing: 2 targets (63 packages loaded, 587 targets configured)
Analyzing: 2 targets (65 packages loaded, 8037 targets configured)
Analyzing: 2 targets (65 packages loaded, 8037 targets configured)
Analyzing: 2 targets (65 packages loaded, 8037 targets configured)
Analyzing: 2 targets (69 packages loaded, 9137 targets configured)
Analyzing: 2 targets (69 packages loaded, 9137 targets configured)
Analyzing: 2 targets (69 packages loaded, 9137 targets configured)
INFO: Analyzed 2 targets (70 packages loaded, 10526 targets configured).
INFO: Found 2 targets...
[0 / 21] [Prepa] BazelWorkspaceStatusAction stable-status.txt ... (7 actions, 0 running)
[163 / 460] BootstrapGNUMake external/rules_foreign_cc/toolchains/make; 3s processwrapper-sandbox ... (8 actions, 7 running)
[191 / 638] BootstrapGNUMake external/rules_foreign_cc/toolchains/make; 7s processwrapper-sandbox ... (8 actions, 7 running)
INFO: From Compiling ncurses/tinfo/lib_tparm.c:
external/ncurses/ncurses/tinfo/lib_tparm.c:344:45: warning: argument 2 of type 'char *[9]' with mismatched bound [-Warray-parameter=]
  344 | _nc_tparm_analyze(const char *string, char *p_is_s[NUM_PARM], int *popcount)
      |                                       ~~~~~~^~~~~~~~~~~~~~~~
In file included from external/ncurses/ncurses/tinfo/lib_tparm.c:44:
bazel-out/k8-opt/bin/external/ncurses/_virtual_includes/ncursesw/tic.h:340:60: note: previously declared as 'char **'
  340 | extern NCURSES_EXPORT(int) _nc_tparm_analyze(const char *, char **, int *);
      |                                                            ^~~~~~~
INFO: From Compiling ncurses/base/lib_screen.c:
external/ncurses/ncurses/base/lib_screen.c: In function 'putwin':
external/ncurses/ncurses/base/lib_screen.c:816:21: warning: 'fputs' argument missing terminating nul [-Wstringop-overread]
  816 | #define PUTS(s) if (fputs(s, filep) == EOF || ferror(filep)) returnCode(code)
      |                     ^~~~~~~~~~~~~~~
external/ncurses/ncurses/base/lib_screen.c:817:9: note: in expansion of macro 'PUTS'
  817 |         PUTS(my_magic);
      |         ^~~~
external/ncurses/ncurses/base/lib_screen.c:69:19: note: referenced argument declared here
   69 | static const char my_magic[] =
      |                   ^~~~~~~~
[378 / 1,006] BootstrapGNUMake external/rules_foreign_cc/toolchains/make; 11s processwrapper-sandbox ... (8 actions, 7 running)
[539 / 1,006] BootstrapGNUMake external/rules_foreign_cc/toolchains/make; 16s processwrapper-sandbox ... (8 actions, 7 running)
[634 / 1,006] BootstrapGNUMake external/rules_foreign_cc/toolchains/make; 23s processwrapper-sandbox ... (2 actions running)
[637 / 1,006] [Prepa] Foreign Cc - Configure: Building xmlrpc
[641 / 1,006] Foreign Cc - Configure: Building xmlrpc; 9s processwrapper-sandbox ... (5 actions, 1 running)
ERROR: /root/.cache/bazel/_bazel_root/709c8ab7bdae4c8e8497f1dffe93d5a8/external/libtorrent/BUILD.bazel:70:11: Compiling src/torrent/peer/peer_list.cc failed: (Exit 1): gcc failed: error executing command 
  (cd /root/.cache/bazel/_bazel_root/709c8ab7bdae4c8e8497f1dffe93d5a8/sandbox/processwrapper-sandbox/670/execroot/rtorrent && \
  exec env - \
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
    PWD=/proc/self/cwd \
  /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -MD -MF bazel-out/k8-opt/bin/external/libtorrent/_objs/torrent/peer_list.d '-frandom-seed=bazel-out/k8-opt/bin/external/libtorrent/_objs/torrent/peer_list.o' -iquote external/libtorrent -iquote bazel-out/k8-opt/bin/external/libtorrent -iquote external/boringssl -iquote bazel-out/k8-opt/bin/external/boringssl -isystem external/libtorrent/include -isystem bazel-out/k8-opt/bin/external/libtorrent/include -isystem bazel-out/k8-opt/bin/external/libtorrent/buildinfo/include -isystem external/boringssl/src/include -isystem bazel-out/k8-opt/bin/external/boringssl/src/include -isystem bazel-out/k8-opt/bin/external/zlib/zlib/include '-std=c++17' -Wall -Wextra -Wpedantic -Wdeprecated -Werror -Ofast -flto '-DEXPORT_LIBTORRENT_SYMBOLS=1' -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/libtorrent/src/torrent/peer/peer_list.cc -o bazel-out/k8-opt/bin/external/libtorrent/_objs/torrent/peer_list.o)
# Configuration: 4cfee8849517f12e8abc71dc447300a3242555c65ba031e14afdfd1626da47d9
# Execution platform: @local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
external/libtorrent/src/torrent/peer/peer_list.cc:55:17: error: 'template<class _Arg1, class _Arg2, class _Result> struct std::binary_function' is deprecated [-Werror=deprecated-declarations]
   55 |   : public std::binary_function<PeerList::reference, uint16_t, bool> {
      |                 ^~~~~~~~~~~~~~~
In file included from /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../include/c++/12.2.1/functional:49,
                 from external/libtorrent/src/torrent/peer/peer_list.cc:5:
/usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../include/c++/12.2.1/bits/stl_function.h:131:12: note: declared here
  131 |     struct binary_function
      |            ^~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
INFO: Elapsed time: 73.635s, Critical Path: 49.79s
INFO: 768 processes: 96 internal, 1 local, 671 processwrapper-sandbox.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
The command '/bin/sh -c bazel build rtorrent-deb rtorrent-rpm --features=fully_static_link --verbose_failures' returned a non-zero code: 1

Using incomplete/complete directories (what is wrong with the config?)

I want rtorrent to use custom incomplete and complete directories. I've spent a few hours attempting to understand the documentation to achieve this however rtorrent still missbehaves.

  • I run rtorrent in a docker container on Linux.

  • I want incomplete torrents to be in /config/.incomplete

  • I want completed torrents to be in /config/complete

However when rtorrent starts it still creates /config/download and places all torrents in it and when a torrent finishes downloading rtorrent does not move it. I can do a manual move from the webui so permissions are fine. There is nothing in the log as far as I can tell.

# This is the rtorrent configuration file installed by rtinst script - https://github.com/arakasi72/rtinst
# This file is installed to ~/.rtorrent.rc
# Enable/modify the options as needed, uncomment the options you wish to enable.
# This configuration will work with most systems, but optimal settings are dependant on specific server setup

### Set Directories
method.insert = cfg.basedir,     private|const|string, (cat,"/config/")
method.insert = cfg.watch,       private|const|string, (cat,(cfg.basedir),"watch/")

method.insert = cfg.logs,       private|const|string, (cat,(cfg.basedir),"log/")
method.insert = cfg.logfile,    private|const|string, (cat,(cfg.logs),"rtorrent-",(system.time),".log")

method.insert = cfg.complete, private|const|string, (cat,(cfg.basedir),"complete/")

## Move files after download has finished
method.insert = d.get_finished_dir, simple, "(cat, (cfg.complete)),$d.custom1="
method.insert = d.data_path, simple, "if=(d.is_multi_file), (cat,(d.directory),/), (cat,(d.directory),/,(d.name))"
method.insert = d.move_to_complete, simple, "d.directory.set=$argument.1=; execute=mkdir,-p,$argument.1=; execute=mv,-u,$argument.0=,$argument.1=; d.save_full_session="
method.set_key = event.download.finished,move_complete,"d.move_to_complete=$d.data_path=,$d.get_finished_dir="

session.path.set = (cat,(cfg.basedir),".session")
directory.default.set = (cat,(cfg.basedir),".incomplete")

schedule2 = watch_directory,5,5,((load.start,(cat,(cfg.watch),"*.torrent")))

#system.umask.set = 0000

### BitTorrent
# Global upload and download rate in KiB, `0` for unlimited
throttle.global_down.max_rate.set = 0
throttle.global_up.max_rate.set = 0

# Maximum number of simultaneous downloads and uploads slots
throttle.max_downloads.global.set = 150
throttle.max_uploads.global.set = 300

# Maximum and minimum number of peers to connect to per torrent while downloading
throttle.min_peers.normal.set = 30
throttle.max_peers.normal.set = 150

# Same as above but for seeding completed torrents (seeds per torrent)
throttle.min_peers.seed.set = -1
throttle.max_peers.seed.set = -1

### Networking
network.port_range.set = 51001-51250
network.port_random.set = yes
dht.mode.set = on
protocol.pex.set = yes
trackers.use_udp.set = true
network.xmlrpc.size_limit.set = 5M

network.http.ssl_verify_peer.set = 0
protocol.encryption.set = allow_incoming,enable_retry,prefer_plaintext

network.max_open_files.set = 4096
network.max_open_sockets.set = 1536
network.http.max_open.set = 48
network.send_buffer.size.set = 128M
network.receive_buffer.size.set = 4M

### Memory Settings
pieces.hash.on_completion.set = no
pieces.preload.type.set = 1
pieces.memory.max.set = 3500M

### Logging:
#   Levels = critical error warn notice info debug
#   Groups = connection_* dht_* peer_* rpc_* storage_* thread_* tracker_* torrent_*
#print = (cat,"Logging to ",(cfg.logfile))
#log.open_file = "log", (cfg.logfile)
#log.add_output = "info", "log"
#log.add_output = "tracker_debug", "log"


### Schedule rTorrent plugins to run 10 seconds after the program starts instead of instantly.
schedule2 = init_plugins, 10, 0, "execute2 = {sh,-c, /usr/bin/php /srv/rutorrent/php/initplugins.php user &}"

schedule2 = dht_node, 30, 0, "dht.add_node=router.bittorrent.com:6881"
#EOF

v0.9.8-r11 - radarr/lidarr/sonarr errors

After updating to 0.9.8-r11 I'm seeing errors in the event logs of radarr/lidarr/sonarr, which I have rtorrent configured as a download client.

The download is successful, but this error is returned:

Message
Request Failed. POST /api/v1/release: response contains array value where integer expected [response]
Exception
CookComputing.XmlRpc.XmlRpcTypeMismatchException: response contains array value where integer expected [response]
   at CookComputing.XmlRpc.XmlRpcSerializer.ParseArray(XmlNode node, Type valueType, ParseStack parseStack, MappingAction mappingAction)
   at CookComputing.XmlRpc.XmlRpcSerializer.ParseValue(XmlNode node, Type valueType, ParseStack parseStack, MappingAction mappingAction, Type& parsedType, Type& parsedArrayType)
   at CookComputing.XmlRpc.XmlRpcSerializer.DeserializeResponse(XmlDocument xdoc, Type returnType)
   at CookComputing.XmlRpc.XmlRpcClientProtocol.Invoke(Object clientObj, MethodInfo mi, Object[] parameters)
   at XmlRpcProxy590c83ef-700c-4d42-b1df-23a767d96ef8.LoadRawStart(String target, Byte[] data, String[] commands)
   at NzbDrone.Core.Download.Clients.RTorrent.RTorrentProxy.<>c__DisplayClass5_0.<AddTorrentFromFile>b__0() in D:\a\1\s\src\NzbDrone.Core\Download\Clients\rTorrent\RTorrentProxy.cs:line 152
   at NzbDrone.Core.Download.Clients.RTorrent.RTorrentProxy.ExecuteRequest[T](Func`1 task) in D:\a\1\s\src\NzbDrone.Core\Download\Clients\rTorrent\RTorrentProxy.cs:line 259
   at NzbDrone.Core.Download.Clients.RTorrent.RTorrentProxy.AddTorrentFromFile(String fileName, Byte[] fileContent, String label, RTorrentPriority priority, String directory, RTorrentSettings settings) in D:\a\1\s\src\NzbDrone.Core\Download\Clients\rTorrent\RTorrentProxy.cs:line 142
   at NzbDrone.Core.Download.Clients.RTorrent.RTorrent.AddFromTorrentFile(RemoteAlbum remoteAlbum, String hash, String filename, Byte[] fileContent) in D:\a\1\s\src\NzbDrone.Core\Download\Clients\rTorrent\RTorrent.cs:line 86
   at NzbDrone.Core.Download.TorrentClientBase`1.DownloadFromWebUrl(RemoteAlbum remoteAlbum, String torrentUrl) in D:\a\1\s\src\NzbDrone.Core\Download\TorrentClientBase.cs:line 190
   at NzbDrone.Core.Download.TorrentClientBase`1.Download(RemoteAlbum remoteAlbum) in D:\a\1\s\src\NzbDrone.Core\Download\TorrentClientBase.cs:line 122
   at NzbDrone.Core.Download.DownloadService.DownloadReport(RemoteAlbum remoteAlbum) in D:\a\1\s\src\NzbDrone.Core\Download\DownloadService.cs:line 74
   at Lidarr.Api.V1.Indexers.ReleaseModule.DownloadRelease(ReleaseResource release) in D:\a\1\s\src\Lidarr.Api.V1\Indexers\ReleaseModule.cs:line 124
   at Lidarr.Api.V1.Indexers.ReleaseModule.<.ctor>b__10_0(Object x) in D:\a\1\s\src\Lidarr.Api.V1\Indexers\ReleaseModule.cs:line 57
   at Nancy.NancyModule.<>c__DisplayClass38_0`1.<Post>b__0(Object args)
   at Nancy.NancyModule.<>c__DisplayClass40_0`1.<Post>b__0(Object args, CancellationToken ct)
   at Nancy.Routing.Route`1.Invoke(DynamicDictionary parameters, CancellationToken cancellationToken)
   at Nancy.Routing.DefaultRouteInvoker.Invoke(Route route, CancellationToken cancellationToken, DynamicDictionary parameters, NancyContext context)
   at Nancy.Routing.DefaultRequestDispatcher.Dispatch(NancyContext context, CancellationToken cancellationToken)
   at Nancy.NancyEngine.InvokeRequestLifeCycle(NancyContext context, CancellationToken cancellationToken, IPipelines pipelines)

Moving and script executing don't work?

Hi, I'm finally going over to a standalone rtorrent container (with flood in another separate container), and it seems to work fine except for two issues (that could be related).

1. My move on complete does not work anymore?

Relevant config:

method.insert = cfg.watch,   private|const|string, (cat,"/downloads/watch/")

# watch subdirectory
schedule2 = audiobooks,1,5,(cat,"load.start=",(cfg.watch),"/audiobooks/*.torrent,d.directory.set=/downloads/incomplete/,d.custom1.set=audiobooks,d.custom2.set=/downloads/completed/audiobooks/")

# Move finished 
method.insert = d.move_to_complete, simple, "d.directory.set=$argument.1=; execute=mkdir,-p,$argument.1=; execute=mv,-u,$argument.0=,$argument.1=; d.save_full_session="
method.set_key = event.download.finished,move_complete,"d.move_to_complete=$d.data_path=,$d.custom2="

2. Executing notification script no longer works

Relevant config:

# slacktee – https://github.com/course-hero/slacktee
method.set_key = event.download.finished,notify_me,"execute=/config/rt-notify.sh,$d.name="

Any input on this? Is the rtorrent image too limiting?

Appreciate your awesome work!

Performance issue

Hello,

I went from rtorrent 0.9.6 from rakshasa to your fork because i was less buggy and it got the console less launch mode.
However, when i had a few To/month with the 0.9.6, now all torrents are on error state and i see rtorrent freezeing for few seconds. jesec/rtorrent 0.9.8 is always using 100% of the CPU while rakshasa/rtorrent 0.9.6 was peaking at ~50% with the same .rtorrent.rc and and session, i just updated bins.

I have ~600 torrents.

Some of the torrents error messages :

  • Tracker: [Timed out]
  • Tracker: [Couldn't connect to server]

This is the CPU usage trace that let me think rtorrent process is stalling :
100

Flood is also sometimes stalling on the rtorrent interface, that didn't happend with rakshasa/rtorrent 0.9.6.

I know this version has some issues with the UDP DNS resolution that make rtorrent stall, so i have a local dnsmask server as DNS caching. My first resolv.conf line is nameserver 127.0.0.1.

How to make it work like it should ?

[EDIT] : stopping all torrents solve the problem. I guess it's the UDP nameserver resolution error. How can i track the bad UDP torrents or stop only UDP torrents ?

Session does not save

With the latest commits, newly added torrents are not reloaded after saving then restarting the rtorrent session. The torrent status is kept in the session directory but it is not loaded.

Changelog

Hello,

I admire all the work you're doing, and would like to keep myself informed.
Could you provide a short list of changes with each release? Reading all commits takes too much time.

Ideally the changes would be both in a file and on each GH release page.

Dockerbuild failing

Unable to build latest revision r16. No issues with r15 though:

[1/3] STEP 1/12: FROM alpine:edge AS build
[1/3] STEP 2/12: ENV RTORRENT_VERSION 0.9.8
--> Using cache 696370ee0c294d038e5421c9fb1c91420e7df76c76e7ed1f17d265391200476d
--> 696370ee0c2
[1/3] STEP 3/12: ENV RTORRENT_REVISION r16
--> Using cache 293877ba280b2f6c0bd16f3beb515855b5a06f8e49c9c9b27d8d1c238e8f8d01
--> 293877ba280
[1/3] STEP 4/12: WORKDIR /root/rtorrent
--> Using cache b86afc7fef70d1a5f27d77f855dd4a4cbf5cc52cf5c73ffdab13791ee36afaad
--> b86afc7fef7
[1/3] STEP 5/12: RUN echo https://dl-cdn.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories
--> Using cache 2827beda90d834d252560e1ca3ebfb940de939db52e38ca18b2a35a7ff9a8950
--> 2827beda90d
[1/3] STEP 6/12: RUN apk --no-cache add     bash     bazel     build-base     coreutils     gcompat     git     linux-headers     python2     python3
--> Using cache 55042d8707e5711d0e2c5cf5cf88a5148f1f8df0653bbe5050cadf32bc11bc2f
--> 55042d8707e
[1/3] STEP 7/12: RUN git clone -b v${RTORRENT_VERSION}-${RTORRENT_REVISION} --depth 1 https://github.com/jesec/rtorrent .
--> Using cache e467bfb80f4997dc3bc641ee18c8282321e73da7ce91f73f95cab936238a68ca
--> e467bfb80f4
[1/3] STEP 8/12: RUN if [[ `uname -m` == "aarch64" ]];     then sed -i 's/architecture = \"all\"/architecture = \"arm64\"/' BUILD.bazel;     elif [[ `uname -m` == "x86_64" ]];     then sed -i 's/architecture = \"all\"/architecture = \"amd64\"/' BUILD.bazel;     fi
--> Using cache e14696d64512d21376285622aaaf0e77132c8b942d42b4d9c78ee0f7a7bdaacc
--> e14696d6451
[1/3] STEP 9/12: RUN bazel build rtorrent-deb --features=fully_static_link --verbose_failures
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
Loading:
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
Analyzing: target //:rtorrent-deb (1 packages loaded, 0 targets configured)
Analyzing: target //:rtorrent-deb (4 packages loaded, 5 targets configured)
Analyzing: target //:rtorrent-deb (25 packages loaded, 305 targets configured)
Analyzing: target //:rtorrent-deb (26 packages loaded, 305 targets configured)
Analyzing: target //:rtorrent-deb (32 packages loaded, 1307 targets configured)
Analyzing: target //:rtorrent-deb (35 packages loaded, 1310 targets configured)
Analyzing: target //:rtorrent-deb (35 packages loaded, 1310 targets configured)
Analyzing: target //:rtorrent-deb (35 packages loaded, 1310 targets configured)
INFO: Analyzed target //:rtorrent-deb (37 packages loaded, 9083 targets configured).
INFO: Found 1 target...
[0 / 61] [Prepa] Writing file rtorrent-bin.args
ERROR: /root/.cache/bazel/_bazel_root/709c8ab7bdae4c8e8497f1dffe93d5a8/external/ncurses/BUILD.bazel:300:8: Executing genrule @ncurses//:include/curses failed: (Exit 1): bash failed: error executing command
  (cd /root/.cache/bazel/_bazel_root/709c8ab7bdae4c8e8497f1dffe93d5a8/sandbox/linux-sandbox/7/execroot/rtorrent && \
  exec env - \
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
  /bin/bash bazel-out/k8-opt/bin/external/ncurses/include/curses.genrule_script.sh)
Execution platform: @local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox
cat: -: No such file or directory
Target //:rtorrent-deb failed to build
INFO: Elapsed time: 35.728s, Critical Path: 0.13s
INFO: 74 processes: 64 internal, 10 linux-sandbox.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
[2/3] STEP 1/8: FROM alpine:edge AS build-sysroot
Error: error building at STEP "RUN bazel build rtorrent-deb --features=fully_static_link --verbose_failures": error while running runtime: exit status 1

Please advise.

sonarr connection to rtorrent directly

any ideas how to setup sonarr to connect to this container instance directly?

is it necessary to setup a scgi proxy to connect to his container instance.

I expose the scgi interface using network.scgi.open_port=0.0.0.0:5000 and keep them in an isolated docker network.

Docker issue with rtorrent socket on Windows

I'm trying to use the rtorrent Docker image on Windows with sockets, using WSL 2 Ubuntu 20.04. I get the following error:

rtorrent: Error in option file: ~/.rtorrent.rc:143: Could not prepare socket for listening: Not supported

Here's the relevent bit of my docker-compose.yml:

rtorrent:
    image: jesec/rtorrent
    user: ${DOCKER_USER}:${DOCKER_GROUP}
    restart: unless-stopped
    command: -o network.port_range.set=50000-50000,system.daemon.set=true
    environment:
      HOME: /config
    volumes:
      - ./rtorrent_config:/config
      - ${TORRENTS}:/torrents
    network_mode: "service:openvpn"
    depends_on:
      - "openvpn"

And line 143 of .rtorrent.rc is

network.scgi.open_local = /config/.local/share/rtorrent/rtorrent.sock

Future plans?

Do you plan to support libtorrent 2.0 eventually?

Explain link to Rakshasa's repo in the readme

Hello

It'll be great if you could add a blurb about the status of this project in relation to Rakshasa's.
I was wondering why this wasn't marked as a fork but looking at #27 gave me the info I needed. It'll be nice if this info was right there in the README.md

Thanks for the free software 👍

References to Rakshasa appears on the binary and on the source code

Hello!
I am Anderson, a Nixpkgs maintainer in my spare time!

When running rtorrent -h, it appeared the message Rakshasa's Bittorrent client . . ..

It was a bit confusing, indeed.

std::cout << "Report bugs to <github.com/rakshasa/rtorrent>." << std::endl;


EDIT: Just a bit of context:

In Nixpkgs we package both softwares; indeed it is very commonplace in general to package forks of some softwares in nixpkgs.
There is no problem in multiple softwares with the same name, at least in principle, because we employ a form of "sandboxing"

Out of curiousity, I went to test jesec's fork, and found this "bug". It was very confusing at first sight.

Broken autodl-irssi on v0.9.8-r12

Hi Jesec,

Thank you very much for taking this work on and continuing the work that @rakshasa was doing. I'm using the latest release and autodl-irssi fails to communicate properly with rtorrent. I noticed fff94b3 which didn't set the content type previously.

Could you please spin a new release when you have a moment and I can help test(?). My container is using Ubuntu (so the deb package would be appreciated).

ruTorrent causes rTorrent to crash by sending invalid xmlrpc data

I've recently started using this rtorrent version in place of those provided by swizzin. I have started seeing rutorrent cause rtorrent to crash. I have only been able to find a few references on google and they all point to xmlrpc errors.

Would you add this patch or something similar? Or is this something I need to do myself when building?

This patch ignores invalid xmlrpc data, instead of trying to queue it and terminating the client.

https://github.com/swizzin/swizzin/blob/a1266d83b3330536bb0bac35b0b9e9fbda4f24af/sources/xmlrpc-fix.patch

Thanks

docker rtorrent std::bad_alloc

docker run -ti --rm jesec/rtorrent:latest
rtorrent: std::bad_alloc

docker info

 Containers: 18
  Running: 18
  Paused: 0
  Stopped: 0
 Images: 50
 Server Version: 23.0.1
 Storage Driver: btrfs
  Btrfs:
 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 logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 1fbd70374134b891f97ce19c70b6e50c7b9f4e0d.m
 runc version:
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.1.21-1-lts
 Operating System: Arch Linux
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 3.797GiB
 Name: hp-micro
 ID: LMDL:M4FO:QLW7:PKFU:4BSW:ZEUG:FUP5:HFVV:S37E:P2DX:ZB4L:IZKU
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Experimental: false
 Insecure Registries:
  192.168.88.2
  registry.home
  127.0.0.0/8
 Live Restore Enabled: false```

Does not always remove lock file when stopped

I frequently have an issue where rtorrent does not remove its lock file when stopping (running in Docker), meaning that next time it starts I get the "could not lock session directory" error and have to manually remove the lock file and restart the container.

Never reconnects after network goes down

I'm running rtorrent in Docker Compose and forcing its traffic over a VPN by running a VPN client in another container and then using network_mode: "container:vpn" on the rtorrent container. This is generally working, the torrent traffic is being routed via the VPN and, if the VPN container stops, rtorrent traffic stops (which is what I want).

The issue is that, when the network and VPN container are available again, rtorrent is never able to reconnect to anything. I need to restart the rtorrent container, and then everything is fine again. I had one thought to implement a healthcheck which, in conjunction with autoheal, would kill/restart the rtorrent container if it was unable to e.g. curl some site but, given the Docker image is based on scratch, it doesn't have any utilities like that in it.

Any ideas on how to resolve this? It seems like the root issue is that rtorrent should be able to reconnect after the network comes back, but this could also be solved in the Docker scenario by a healthcheck which fails if it can't connect to some test site on the internet.

"DhtServer::event_write called but both write queues are empty" Error

Running your version of rTorrent 0.9.8/0.13.8 I regularly get the following error:

C Caught internal_error: 'DhtServer::event_write called but both write queues are empty.'.

This seems to be a known issue and is discussed further in the following issues from other rTorrent repo's and related projects:

rakshasa/libtorrent#141
rakshasa/rtorrent#760
chros73/rtorrent-ps-ch#166

Also included in those issues are logs and a possible workaround patch. Unfortunately it looks like this issue is not being acted on since it's been known for years. I was wondering if you would consider adding the workaround patch or maybe a different solution to your version of rTorrent so that this issue can be fixed.

Cannot install from APT debian repository

Hello~

I'm trying to install rtorrent from your Debian repository but having issues:
(from flood installation link: https://github.com/jesec/flood/wiki/Install-Flood-on-Debian,-Ubuntu-and-derivatives)

root@flood:~# sudo apt install -y rtorrent
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  rtorrent
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 2143 kB of archives.
After this operation, 0 B of additional disk space will be used.
Err:1 https://deb.jesec.io devel/main amd64 rtorrent amd64 0.9.8-jc+1622031270-f8537e3
  Connection failed [IP: 104.21.51.24 443]
E: Failed to fetch https://decompressor.jesec.workers.dev/?decompress=https://nightly.link/jesec/rtorrent/actions/runs/878467218/rtorrent-deb-amd64.zip  Connection failed [IP: 104.21.51.24 443]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

image
For unknown reasons artifact 878467218 returns to 6453724 which seems expired 🤔
Thank you! Keep going on your awesome work ❤

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.