Skip to content
Snippets Groups Projects
Verified Commit 9405fc9a authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

fix: solve bugs with initial implementation

parent 23e1bfe1
Branches
No related tags found
No related merge requests found
Pipeline #2875 passed
...@@ -3,10 +3,10 @@ set -euo pipefail ...@@ -3,10 +3,10 @@ set -euo pipefail
rm /tmp/rtorrent.log rm /tmp/rtorrent.log
touch /tmp/rtorrent.log touch /tmp/rtorrent.log
rm /data/.session/rtorrent.lock /data/.session/rtorrent.pid rm /tmp/.session/rtorrent.lock /tmp/.session/rtorrent.pid
# Start rtorrent as a daemon with the setting in the config file # Start rtorrent as a daemon with the setting in the config file
# & to actually run it in the background # & to actually run it in the background
rtorrent -n -o "import=/rtorrent.conf" & rtorrent -n -o "import=/rtorrent.rc" &
tail -f /tmp/rtorrent.log tail -f /tmp/rtorrent.log
############################################################################# #############################################################################
# A minimal rTorrent configuration that provides the basic features # 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.
############################################################################# #############################################################################
method.insert = cfg.download, private|const|string, /data/
method.insert = cfg.tmp, private|const|string, /tmp/
method.insert = cfg.logfile, private|const|string, (cat,(cfg.tmp),"rtorrent.log")
method.insert = cfg.session, private|const|string, (cat,(cfg.tmp),".session/")
fs.mkdir = (cat,(cfg.session))
## Instance layout (base paths) # Listening port for incoming peer traffic
method.insert = cfg.basedir, private|const|string, (cat,(system.env,RT_BASE_DIR))
method.insert = cfg.tmpdir, private|const|string, (cat,"/tmp/")
method.insert = cfg.download, private|const|string, (cat,(cfg.basedir),"download/")
method.insert = cfg.logs, private|const|string, (cat,(cfg.tmpdir),"log/")
method.insert = cfg.logfile, private|const|string, (cat,(cfg.logs),"rtorrent.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_range.set = 50000-50000
network.port_random.set = no network.port_random.set = no
# Distributed Hash Table and Peer EXchange
## Tracker-less torrent and UDP tracker support # Enable tracker-less torrents but vulnerable to passive sniffing
## (conservative settings for 'private' trackers, change for 'public') # DHT and PEX are always disabled for private torrents
dht.mode.set = (system.env,RT_DHT_MODE) dht.mode.set = disable
#dht.port.set = (system.env,RT_DHT_PORT) protocol.pex.set = no
protocol.pex.set = (system.env,RT_PROTO_PEX)
trackers.use_udp.set = (system.env,RT_TRACKER_UDP) trackers.use_udp.set = (system.env,RT_TRACKER_UDP)
# Peer settings
## Peer settings
throttle.max_uploads.set = (system.env,RT_MAX_UP) throttle.max_uploads.set = (system.env,RT_MAX_UP)
throttle.max_uploads.global.set = (system.env,RT_MAX_UP_GLOBAL) throttle.max_uploads.global.set = (system.env,RT_MAX_UP_GLOBAL)
throttle.min_peers.normal.set = (system.env,RT_MIN_PEERS) throttle.min_peers.normal.set = (system.env,RT_MIN_PEERS)
...@@ -51,74 +31,50 @@ trackers.numwant.set = (system.env,RT_TRACKERS_WANT) ...@@ -51,74 +31,50 @@ trackers.numwant.set = (system.env,RT_TRACKERS_WANT)
protocol.encryption.set = allow_incoming,try_outgoing,enable_retry protocol.encryption.set = allow_incoming,try_outgoing,enable_retry
# Limits for file handle resources, this is optimized for
## Limits for file handle resources, this is optimized for # an `ulimit` of 1024 (a common default). You MUST leave
## an `ulimit` of 1024 (a common default). You MUST leave # a ceiling of handles reserved for rTorrent's internal needs!
## a ceiling of handles reserved for rTorrent's internal needs!
network.http.max_open.set = 50 network.http.max_open.set = 50
network.max_open_files.set = 600 network.max_open_files.set = 600
network.max_open_sockets.set = 300 network.max_open_sockets.set = 300
# Memory resource usage (increase if you have a large number of items loaded,
## Memory resource usage (increase if you have a large number of items loaded, # and/or the available resources to spend)
## and/or the available resources to spend)
pieces.memory.max.set = (system.env,RT_MEMORY_MAX) pieces.memory.max.set = (system.env,RT_MEMORY_MAX)
network.xmlrpc.size_limit.set = 4M network.xmlrpc.size_limit.set = 16M
## Basic operational settings (no need to change these) # Basic operational settings
session.path.set = (cat, (cfg.session)) session.path.set = (cat, (cfg.session))
directory.default.set = (cat, (cfg.download)) directory.default.set = (cat, (cfg.download))
log.execute = (cat, (cfg.logs), "execute.log") log.execute = (cat, (cfg.tmp), "execute.log")
#log.xmlrpc = (cat, (cfg.logs), "xmlrpc.log") ##log.xmlrpc = (cat, (cfg.tmp), "xmlrpc.log")
execute.nothrow = sh, -c, (cat, "echo >",\
(session.path), "rtorrent.pid", " ",(system.pid))
# Other operational settings
## Other operational settings (check & adapt)
encoding.add = utf8 encoding.add = utf8
system.umask.set = 0027 system.umask.set = 0027
system.cwd.set = (directory.default) system.cwd.set = (directory.default)
network.http.dns_cache_timeout.set = 25
schedule2 = monitor_diskspace, 15, 60, ((close_low_diskspace, 1000M)) schedule2 = monitor_diskspace, 15, 60, ((close_low_diskspace, 1000M))
#pieces.hash.on_completion.set = no #pieces.hash.on_completion.set = no
#view.sort_current = seeding, greater=d.ratio= ##view.sort_current = seeding, greater=d.ratio=
#keys.layout.set = qwerty ##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"
# HTTP and SSL
network.http.max_open.set = 50
network.http.dns_cache_timeout.set = 25
## Watch directories (add more as you like, but use unique schedule names) #network.http.ssl_verify_peer.set = 1
## Add torrent #network.http.ssl_verify_host.set = 1
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 # Run the rTorrent process as a daemon in the background
## (and control via XMLRPC sockets) system.daemon.set = true
system.daemon.set = (system.env,RT_DAEMON)
network.scgi.open_port = (cat,(system.env,RT_XMLRPC_BIND),:,(system.env,RT_XMLRPC_PORT))
#network.scgi.open_local = (cat,(session.path),rpc.socket)
#execute.nothrow = chmod,770,(cat,(session.path),rpc.socket)
# XML-RPC interface
network.scgi.open_port = 0.0.0.0:5000
## Logging: # Logging:
## Levels = critical error warn notice info debug # Levels = critical error warn notice info debug
## Groups = connection_* dht_* peer_* rpc_* storage_* thread_* tracker_* torrent_* # Groups = connection_* dht_* peer_* rpc_* storage_* thread_* tracker_* torrent_*
print = (cat, "Logging to ", (cfg.logfile)) print = (cat, "Logging to ", (cfg.logfile))
log.open_file = "log", (cfg.logfile) log.open_file = "log", (cfg.logfile)
log.add_output = "info", "log" log.add_output = "info", "log"
#log.add_output = "tracker_debug", "log" ##log.add_output = "tracker_debug", "log"
### END of rtorrent.rc ###
#!/bin/bash #!/bin/bash
set -euo pipefail set -euo pipefail
wg-quick up "/wireguard.conf" if [ -n "$LOCAL_NETWORK" ]; then
gateway=$(ip route list match 0.0.0.0 | grep -v tun0 | cut -d ' ' -f 3)
interface=$(ip route list match 0.0.0.0 | grep -v tun0 | cut -d ' ' -f 5)
echo gateway="$gateway"
echo interface="$interface"
fi
wg-quick up /wireguard.conf
if [ -n "$LOCAL_NETWORK" ]; then
ip r add "$LOCAL_NETWORK" via "${gateway}" dev "${interface}"
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment