2014-08-21 18:07:06 +10:00
|
|
|
package torrent
|
|
|
|
|
2014-11-28 12:13:08 -06:00
|
|
|
import (
|
2015-03-20 16:37:44 +11:00
|
|
|
"github.com/anacrolix/torrent/dht"
|
2015-08-04 01:07:22 +10:00
|
|
|
"github.com/anacrolix/torrent/iplist"
|
2014-11-28 12:13:08 -06:00
|
|
|
)
|
|
|
|
|
2015-03-08 17:28:14 +11:00
|
|
|
// Override Client defaults.
|
2014-08-21 18:07:06 +10:00
|
|
|
type Config struct {
|
2015-03-08 17:28:14 +11:00
|
|
|
// Store torrent file data in this directory unless TorrentDataOpener is
|
|
|
|
// specified.
|
2015-03-25 15:41:15 +11:00
|
|
|
DataDir string `long:"data-dir" description:"directory to store downloaded torrent data"`
|
2015-03-08 17:28:14 +11:00
|
|
|
// The address to listen for new uTP and TCP bittorrent protocol
|
|
|
|
// connections. DHT shares a UDP socket with uTP unless configured
|
|
|
|
// otherwise.
|
2015-03-25 15:41:15 +11:00
|
|
|
ListenAddr string `long:"listen-addr" value-name:"HOST:PORT"`
|
2015-03-08 17:28:14 +11:00
|
|
|
// Don't announce to trackers. This only leaves DHT to discover peers.
|
2015-03-25 15:41:15 +11:00
|
|
|
DisableTrackers bool `long:"disable-trackers"`
|
2015-03-25 15:42:14 +11:00
|
|
|
DisablePEX bool `long:"disable-pex"`
|
2015-03-08 17:28:14 +11:00
|
|
|
// Don't create a DHT.
|
2015-03-25 15:41:15 +11:00
|
|
|
NoDHT bool `long:"disable-dht"`
|
2015-03-08 17:28:14 +11:00
|
|
|
// Overrides the default DHT configuration.
|
|
|
|
DHTConfig *dht.ServerConfig
|
2015-05-15 08:39:53 +10:00
|
|
|
// Don't ever send chunks to peers.
|
2015-03-25 15:41:15 +11:00
|
|
|
NoUpload bool `long:"no-upload"`
|
2015-05-15 08:39:53 +10:00
|
|
|
// Upload even after there's nothing in it for us. By default uploading is
|
|
|
|
// not altruistic.
|
|
|
|
Seed bool `long:"seed"`
|
2015-03-08 17:28:14 +11:00
|
|
|
// User-provided Client peer ID. If not present, one is generated automatically.
|
|
|
|
PeerID string
|
|
|
|
// For the bittorrent protocol.
|
|
|
|
DisableUTP bool
|
|
|
|
// For the bittorrent protocol.
|
2015-04-20 17:35:21 +10:00
|
|
|
DisableTCP bool `long:"disable-tcp"`
|
2015-03-08 17:28:14 +11:00
|
|
|
// Don't automatically load "$ConfigDir/blocklist".
|
2014-12-02 14:23:01 -06:00
|
|
|
NoDefaultBlocklist bool
|
2015-03-08 17:28:14 +11:00
|
|
|
// Defaults to "$HOME/.config/torrent". This is where "blocklist",
|
|
|
|
// "torrents" and other operational files are stored.
|
|
|
|
ConfigDir string
|
|
|
|
// Don't save or load to a cache of torrent files stored in
|
|
|
|
// "$ConfigDir/torrents".
|
2015-02-25 14:48:39 +11:00
|
|
|
DisableMetainfoCache bool
|
2015-03-08 17:28:14 +11:00
|
|
|
// Called to instantiate storage for each added torrent. Provided backends
|
|
|
|
// are in $REPO/data. If not set, the "file" implementation is used.
|
2015-02-25 14:48:39 +11:00
|
|
|
TorrentDataOpener
|
2015-04-20 17:30:22 +10:00
|
|
|
DisableEncryption bool `long:"disable-encryption"`
|
2015-08-04 01:07:22 +10:00
|
|
|
|
|
|
|
IPBlocklist *iplist.IPList
|
2015-08-05 02:41:50 +10:00
|
|
|
DisableIPv6 bool
|
2014-08-21 18:07:06 +10:00
|
|
|
}
|