forked from crazy-max/docker-rtorrent-rutorrent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.rtlocal.rc
67 lines (51 loc) · 2.88 KB
/
.rtlocal.rc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Launch as a daemon
system.daemon.set = true
# Instance layout
method.insert = cfg.basedir, private|const|string, (cat,"/data/rtorrent/")
method.insert = cfg.download, private|const|string, (cat,"/downloads/")
method.insert = cfg.download_complete, private|const|string, (cat,(cfg.download),"complete/")
method.insert = cfg.download_temp, private|const|string, (cat,(cfg.download),"temp/")
method.insert = cfg.logs, private|const|string, (cat,(cfg.basedir),"log/")
method.insert = cfg.session, private|const|string, (cat,(cfg.basedir),".session/")
method.insert = cfg.watch, private|const|string, (cat,(cfg.basedir),"watch/")
method.insert = cfg.rundir, private|const|string, (cat,"/var/run/rtorrent/")
# Gets the full path of data of a torrent (it's a workaround for the possibly empty 'd.base_path' attribute)
method.insert = d.data_path, simple, "if=(d.is_multi_file), (cat,(d.directory),/), (cat,(d.directory),/,(d.name))"
# Default directory to save the downloaded torrents
directory.default.set = (cat,(cfg.download_temp))
# Default session directory
session.path.set = (cat,(cfg.session))
# PID file
execute.nothrow = sh,-c,(cat,"echo >",(cfg.rundir),"rtorrent.pid"," ",(system.pid))
# SCGI socket and make it group-writable and secure
network.scgi.open_local = (cat, (cfg.rundir), "scgi.socket")
schedule2 = scgi_permission, 0, 0, (cat,"execute.nothrow=chmod,\"g+w,o=\",",(cfg.rundir),"scgi.socket")
# Listening port for incoming peer traffic
network.port_range.set = @RT_INC_PORT@-@RT_INC_PORT@
network.port_random.set = no
# UDP port to use for DHT
dht.port.set = @RT_DHT_PORT@
# XMLRPC size limit
network.xmlrpc.size_limit.set = @XMLRPC_SIZE_LIMIT@
# Configure session saving interval to balance disk usage and torrent information accuracy
schedule2 = session_save, 1200, @RT_SESSION_SAVE_SECONDS@, ((session.save))
# Save torrents immediately to prevent losing them between session saving intervals
# Schedule task to run in background (with unique hash) to avoid seeding impact
method.set_key = event.download.inserted_new, "schedule2 = ((d.hash)), 0, 0, ((d.save_full_session))"
# Configure whether to delay tracker announces at startup
trackers.delay_scrape = @RT_TRACKER_DELAY_SCRAPE@
# Configure TCP rmem and wmem for rTorrent client
network.send_buffer.size.set = @RT_SEND_BUFFER_SIZE@
network.receive_buffer.size.set = @RT_RECEIVE_BUFFER_SIZE@
# Configure preallocation feature for rTorrent client
system.file.allocate.set = @RT_PREALLOCATE_TYPE@
# Logging
## levels = critical error warn notice info debug
## groups = connection_* dht_* peer_* rpc_* storage_* thread_* tracker_* torrent_*
log.open_file = "log",(cat,(cfg.logs),"rtorrent.log")
log.add_output = "@RT_LOG_LEVEL@","log"
log.add_output = "rpc_events","log"
#log.execute = (cat,(cfg.logs),"execute.log")
#log.xmlrpc = (cat,(cfg.logs),"xmlrpc.log")
# Initialize plugins
execute2 = {sh,-c,/usr/bin/php82 /var/www/rutorrent/php/initplugins.php rtorrent &}