Il Torrent pare oramai il protocollo più diffuso per la condivisione di contenuti, ma il castello di carte che si regge sulla condivisione va aiutato, così da diverso tempo dedico il mio vecchio raspberry Pi B+ 1 (512Mb ram) alla condivisione, iso e poche altre cose compreso un paio di titoli introvabili.
Perché rtorrent ?
Perché è installato su un raspberry PI B e necessita di poche risorse, è tra i più potenti, ha un’interfaccia minimalista da console che convive ottimamente in una scheda di tmux perché rtorrent resta uno dei migliori .
Con il passaggio a buster sulla rasbian abbiamo trovato tra le novità una nuova versione di rtorrent, la 0.9.7, molto aggiornata ma con il bisogno di un nuovo file rtorrent.rc di configurazione.
A detta dello stesso sviluppatore occorre un nuovo template (e qui ne trovate uno valido), perché quello della precedente versione è “vecchia spazzatura“.
a modern rTorrent configuration that provides a good starting point. Its expressed purpose is to replace that years-old rotting piece of garbage that people still use to create their first configuration. Friends don’t let friends use that!
rtorrent
installare rtorrent è semplice perché è già disponibile nei repository ufficiali e ha poche dipendenze.
# apt install rtorrent
configurazione con .rtorrent.rc
successivamente va creato un file di configurazione nella nostra /home con il nome .rtorrent.rc , come spunto ho usato il template ufficiale a cui ho apportato alcune modifiche e ripulito del non necessario.
Per ottimizzare le prestazioni potete seguire questa guida, oppure consultare in generale la guida di configurazione per saziare ogni vostro dubbio.
################################################################ # A minimal rTorrent configuration that provides the basic features # # you want to have in addition to the built-in defaults. # # # # just edit by barabba # # # # See https://github.com/rakshasa/rtorrent/wiki/CONFIG-Template # # for an up-to-date version. # ##################################################################### ## Instance layout (base paths) ## compliare le directory necessarie method.insert = cfg.basedir, private|const|string, (cat,"/media/usb0/torrent/") method.insert = cfg.download, private|const|string, (cat,(cfg.basedir),"complete/") 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) ## la porta usata, se singola non serve random, aprire anche sul firewall network.port_range.set = 29164-29164 network.port_random.set = no # Set an interface with IPv4 address to bind to: [eth0|tun0] method.insert = cfg.interface.bind, string|const|private, (cat,"eth0") # Get IPv4 address of a given interface method.insert = get_interface_ipv4_address, simple|private, \ "execute.capture=bash,-c,\"$cat=\\\"echo -n \$(ip -o -4 addr show \\\",$argument.0=,\\\" | grep -Po 'inet \\\\\\\\\\K[\\\\\\\\\\d.]+')\\\"\"" # The IP address the listening socket and outgoing connections is bound to. (bind) schedule2 = set_bind_address, 0, 0, \ "branch=((cfg.interface.bind)), \ ((network.bind_address.set,(get_interface_ipv4_address,(cfg.interface.bind))))" ## IMPORTANTE ## inserite l'IP del PC bind = 192.168.1.11 # Enable DHT support for trackerless torrents or when all trackers are down. # May be set to "disable" (completely disable DHT), "off" (do not start DHT), # "auto" (start and stop DHT as needed), or "on" (start DHT immediately). # The default is "off". # For DHT to work, a session directory must be defined. dht.mode.set = auto # Enable/disable peer exchange for torrents that aren't marked private. Disabled by default. (peer_exchange) protocol.pex.set = 1 # UDP port to use for DHT dht.port.set = 4444 # Adding public DHT servers for easy bootstrapping # ricordate di mettere la porta utilizzata in precedenza schedule2 = dht_node_1, 5, 0, "dht.add_node=router.utorrent.com:29164" schedule2 = dht_node_2, 5, 0, "dht.add_node=dht.transmissionbt.com:29164" schedule2 = dht_node_3, 5, 0, "dht.add_node=router.bitcomet.com:29164" schedule2 = dht_node_4, 5, 0, "dht.add_node=dht.aelitis.com:29164" # Set whether the client should try to connect to UDP trackers #(It can cause various problems if it's enabled, if you experience any with this option enabled then disable it.) trackers.use_udp.set = 1 # Global upload and download rate in KiB. "0" for unlimited. download_rate = 160 upload_rate = 48 ## 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! ## default 50.600.300 network.http.max_open.set = 25 network.max_open_files.set = 300 network.max_open_sockets.set = 150 ## Memory resource usage (increase if you have a large number of items loaded, ## and/or the available resources to spend) ## ogni torrent occupa 4MB esempio 10 torrent in lista 4x10= 40MB pieces.memory.max.set = 50M 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)) ## 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"))) ## necessaria per collegare una gui scgi_port = 127.0.0.1:5000 ## 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 ###
Utilizzo
L’uso è molto semplice e avviene esclusivamente dalla tastiera la lista completa dei comandi la trovate Qui, di seguito riporto quelli essenziali
comando | Azione |
---|---|
Ctrl-q | Quit application |
Ctrl-s | Start download. Runs hash first unless already done. |
Ctrl-d | Stop an active download or remove a stopped download |
Ctrl-k | Stop and close the files of an active download. |
Ctrl-r | Initiate hash check of torrent. Starts downloading if file is not available. |
Ctrl-o | Specify the download directory for a added, but not started torrent. |
Left | Returns to the previous screen |
Right | Goes to the next screen |
Backspace | Adds and starts the specified *.torrent |
Return | Adds and doesn’t start the specified *.torrent |
s|d | 5|50 KB/s |
S|D | 5|50 KB/s |
x|c | 5|50 KB/s |
X|C | 5|50 KB/s |