# Required for ruTorrent
execute2 = {sh,-c,/usr/bin/php7 /app/rutorrent/php/initplugins.php abc &}
execute.nothrow = rm,/run/php/.rtorrent.sock
network.scgi.open_local = /run/php/.rtorrent.sock
schedule2 = socket_chmod,0,0,"execute=chmod,0660,/run/php/.rtorrent.sock"
schedule2 = socket_chgrp,0,0,"execute=chgrp,abc,/run/php/.rtorrent.sock"

# Logging
log.open_file = "rtorrent", /config/log/rtorrent/rtorrent.log
log.add_output = "info", "rtorrent"

# Throttling
throttle.min_peers.normal.set = 40
throttle.max_peers.normal.set = 1200
throttle.max_uploads.global.set = 15
# Optionally, set this per torrent:
# throttle.max_uploads.set = 5

# Directories
# schedule2 = watch_directory_1,5,5,"load.start=/downloads/watched/*.torrent"
directory = /downloads/incoming
session = /config/rtorrent/rtorrent_sess
#method.insert = d.get_finished_dir, simple, "cat=/downloads/completed/,$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="

# Stop torrents when your drive has <100M free disk space
schedule = low_diskspace,5,60,close_low_diskspace=100M

# Ports
network.port_range.set = 51413-51413
network.port_random.set = no

# Downloading settings
pieces.hash.on_completion.set = yes
protocol.encryption.set = allow_incoming,try_outgoing,enable_retry

# DHT / PEX settings
# set to "disable" to disable
dht.mode.set = auto
dht.port.set = 6881
# set to "no" to disable
protocol.pex.set = yes
# set to "no" to disable
trackers.use_udp.set = yes

encoding.add = utf8
