Commit Graph

327 Commits

Author SHA1 Message Date
Matt Joiner 01f9fdb921 Upgrade to log v0.5.0 2020-01-03 15:37:08 +11:00
Matt Joiner bfbed8ab6d cmd/torrent: Make the addr flag a string
This avoids tagflag trying to resolve it, and then passing a bad IP for different listen networks. There's also a patch to tagflag so it doesn't do this anymore.
2020-01-03 14:51:26 +11:00
Matt Joiner e24a9b343f cmd/torrent: Add dht flag 2020-01-03 14:51:26 +11:00
D. HT. Yu 6e95274413 fix if statement in `cmd/torrent/main.go` (#349) 2019-12-08 20:34:24 +11:00
Matt Joiner eb4dad73ae Lots of improvements to logging 2019-08-22 13:59:04 +10:00
Matt Joiner cb1bf0f413 goimports -local 2019-08-21 20:58:40 +10:00
Matt Joiner 09b587f17b Comments 2019-07-19 13:04:10 +10:00
Matt Joiner fb7293a94f cmd/torrent: Add flag for progress bar 2019-07-19 13:01:36 +10:00
Matt Joiner 93d34dd122 cmd/torrent: Don't log the public IP flag value 2019-07-19 13:00:31 +10:00
Matt Joiner 561e3915f3 cmd/torrent-magnet: Add a description to command help output 2019-07-17 18:12:54 +10:00
Matt Joiner 27b7fbe3f3 Fix announcing to S3 HTTP trackers 2019-07-17 18:12:11 +10:00
Matt Joiner 9afa2e70d7 cmd/torrent-metainfo-pprint: Fix -files for single-file torrents 2019-07-17 15:28:49 +10:00
Masih Yeganeh 72db8ae577 Adds more flags to torrent-create
Flags for setting Comment and CreatedBy fields and starting with empty AnnounceList
2019-03-01 11:18:57 +11:00
Matt Joiner ba9300e27e cmd/torrent: Add -publicIp flag 2019-01-08 15:47:01 +11:00
Matt Joiner fc4fab91f5 Switch to goimports import sorting
Used to use sortimports, but it's old, and goimports seems to have an opinion now.
2018-11-02 23:12:01 +11:00
Matt Joiner ad0c33a50c Fix TLS handshake failures with https trackers
Fixes #276
2018-10-18 11:09:56 +11:00
Matt Joiner 3ae66f3693 cmd/tracker-announce: Add a port flag 2018-08-13 20:27:42 +10:00
Matt Joiner 975fa8f143 cmd/tracker-announce: Provide a http.Client for announces 2018-08-13 20:27:16 +10:00
Matt Joiner 8b4a4193a8 cmd/tracker-announce: Was using empty AnnounceRequest 2018-08-13 20:26:47 +10:00
jb 5a09866db4 attempt to close the client on signal 2018-07-24 09:34:06 +02:00
Matt Joiner a7e338a3f1 More sortimports 2018-07-07 11:40:06 +10:00
Matt Joiner 2b1068885c cmd/torrent-metainfo-pprint: Use bufio input and enable envpprof 2018-06-17 16:20:02 +10:00
Matt Joiner cee8e3b9f9 Update external use of ClientConfig 2018-06-16 16:33:40 +10:00
Matt Joiner 37fc800cb1 cmd/torrent: Add -stats flag
Requires updated tagflag package.
2018-06-06 00:40:03 +10:00
Matt Joiner b5df073217 Support different hosts for each network
CircleCI's localhost hostname doesn't resolve for IPv6.
2018-04-12 15:06:53 +10:00
Matt Joiner 319e57d1c6 Rework conns to/and allow multiple DHT servers
This will help with #229, and IPv6 support.
2018-04-12 11:41:07 +10:00
Matt Joiner 5a7c4fc135 cmd/torrent: Add packed-blocklist flag 2018-02-19 16:20:31 +11:00
Matt Joiner 7a7f468d9d cmd/tracker-announce: Rework to be faster and support UDP IPv6 2018-02-19 16:20:08 +11:00
Matt Joiner 358c6c8649 cmd/torrent: Fix logging when progress bar and stderr are the same file 2018-01-25 13:12:46 +11:00
Matt Joiner ddd1e90d45 Fix cmd/torrent -debug 2018-01-25 13:11:32 +11:00
Matt Joiner 0b553b296f Add File priorities
Fixes #220.
2018-01-21 22:49:12 +11:00
Matt Joiner 2f616b9d8b megacheck and staticcheck fixes 2018-01-06 16:53:40 +11:00
Matt Joiner 7b668237bc cmd/torrent-pick: Close file Reader 2018-01-06 16:41:05 +11:00
Matt Joiner 9b718566ba Add File.NewReader
Fixes #222
2018-01-06 16:37:13 +11:00
Denis Kuzmenok 455a414204 adding http user-agent setters and usage 2017-12-28 10:47:51 +02:00
Matt Joiner 4190856b6c sortimports 2017-12-01 18:12:29 +11:00
Matt Joiner 8f7720edb2 Merge commit '6ab65a49a8a72dea1a28968b2ab42a85fd4566ec'
# Conflicts:
#	config.go
2017-11-08 20:23:15 +11:00
Matt Joiner f960ec1b65 cmd/torrent-metainfo-pprint: Just take a single metainfo to stdin
Move processing into its own function too.
2017-11-08 19:33:05 +11:00
themihai 6ab65a49a8 feat(config): Allows the torrent client to customise the client identity and connection config 2017-11-07 20:14:13 +02:00
Matt Joiner 2ab850f56e cmd/torrent-metainfo-pprint: Include metainfo's url-list in output
Helps with testing #197.
2017-10-14 16:41:14 +11:00
Matt Joiner 881f1a7e35 Support plaintext crypto method for protocol header encryption 2017-09-13 18:20:20 +10:00
Matt Joiner 016b238cc5 cmd/torrent: Enhance debugging 2017-09-01 10:35:40 +10:00
Matt Joiner 756375879b cmd/torrent: Include global dht starting nodes 2017-08-28 20:54:37 +10:00
Matt Joiner 4ffcd9f1ce cmd/torrentfs: Switch to tagflag and rename -torrentPath->-metainfoDir 2017-08-27 12:25:51 +10:00
Matt Joiner 6268fa0b54 cmd/magnet-metainfo: Use tagflag 2017-08-27 11:46:06 +10:00
Matt Joiner dfb7f5b00c Make cmd/tracker-announce output a bit easier to consume 2017-08-26 12:38:08 +10:00
Matt Joiner 401974dd8d dht.ServerConfig.StartingNodes is now a function
Additionally cmd/torrentfs uses the global bootstrap nodes for its DHT. Aids with https://github.com/anacrolix/torrent/issues/180
2017-08-25 16:28:27 +10:00
Matt Joiner 89f39b0b09 Add some debugging routes and envpprof to cmd/magnet-metainfo
https://github.com/anacrolix/torrent/issues/178
2017-08-18 11:14:57 +10:00
Matt Joiner 99b3f98e3e Remove dht cmds, they're added to anacrolix/dht 2017-07-21 00:39:28 +10:00
Matt Joiner 78a8db10da sortimports 2017-03-19 17:04:32 +11:00
Matt Joiner b868a6b9e2 dht.Server.Announce now takes [20]byte 2017-02-07 15:01:02 +11:00
BonkaBonka 25990f44ee Abort verify at first hash mismatch. 2017-01-03 21:44:19 -05:00
Matt Joiner d8ca4ac92a Rewrite cmd/torrent-verify
Fixes #141
2017-01-01 10:08:45 +11:00
Matt Joiner b68d7cd08e dht/… moved to github.com/anacrolix/dht 2016-12-14 11:43:37 +11:00
Matt Joiner 9d35196cca cmd/torrent: Accept infohash: scheme torrents 2016-11-30 18:02:21 +11:00
Igor Shishkin c43751cfea Trivial HTTP support for adding torrent files by (#126)
* Trivial HTTP support for adding torrent files by

Sometimes it's really usefull to do not download
torrent file locally but simply pass HTTP link
this patch adds such ability.

Signed-off-by: Igor Shishkin <me@teran.ru>

* Fix for closing http connection after use

Signed-off-by: Igor Shishkin <me@teran.ru>
2016-10-25 19:13:06 +11:00
Matt Joiner d4cbdc5c38 Add download rate limiting
Fixes #121.
2016-10-10 17:29:39 +11:00
Meng Zhuo 23efae91e2 fix unreadable id when started 2016-09-22 12:03:59 +10:00
Meng Zhuo c4979954e8 fix dht-server cmd won't exit after Ctrl+C 2016-09-22 12:03:53 +10:00
Matt Joiner 594053609c Fixes for changes to metainfo.MetaInfo.UnmarshalInfo 2016-09-20 18:39:07 +10:00
Matt Joiner 7204503206 cmd/torrent: Fix progress bar for zero-length torrents 2016-09-12 17:47:07 +10:00
Ye Yin 2fba33d5a2 Pass seed option to Config for cmd/torrent 2016-08-31 17:20:20 +08:00
Matt Joiner 2a1cef7c9e Remove the InfoEx type, and don't generate its infohash on the fly
Fixes #106.
2016-08-26 20:29:05 +10:00
Matt Joiner 0bd5bcd1a5 cmd/torrentfs: Ensure unmounting occurs for some errors
Restructured so other errors can be handled better too.
2016-08-02 11:19:41 +10:00
ctn a3739fc47c torrentfs: fix panic when testPeer is not specified 2016-07-26 23:30:40 +03:00
Matt Joiner 1b3e37b9ed cmd/torrent: Remove unused "short" tag 2016-06-18 16:02:59 +10:00
Matt Joiner d20384b421 cmd/torrent-create: Improve spelling and descriptions 2016-06-16 12:27:49 +10:00
Alexey Kuznetsov ad5d5bc350 -a option (#86)
* add -a option

* name
2016-06-16 01:25:48 +10:00
Matt Joiner abbbb6e115 cmd/torrent-metainfo-pprint: Add Announce and AnnounceList keys 2016-05-23 10:18:39 +10:00
Matt Joiner a69044b9ea Break out KRPC stuff from dht into new package 2016-05-17 16:40:08 +10:00
Matt Joiner b714da8184 Torrent.AddPeers can't fail, so don't return an error 2016-05-12 12:26:09 +10:00
Matt Joiner 9c36d36654 cmd/torrent-infohash update for API changes 2016-05-06 15:09:59 +10:00
Matt Joiner 2d160b0419 metainfo.InfoEx.Hash becomes a function, UpdateBytes is added, and Bytes used in marshalling
Fixes #80.
2016-05-05 22:40:38 +10:00
Matt Joiner 3c612cbfc8 cmd/torrent-create: Tidy up flags and remove redundant function calls
Issue #80
2016-05-03 16:49:30 +10:00
Matt Joiner 8ae88151a8 cmd/torrent-metainfo-pprint: Add -files flag, and expose NumFiles and TotalLength in output 2016-05-03 12:51:31 +10:00
Matt Joiner 1936054615 cmd/torrent-metainfo-pprint: Also print InfoHash 2016-05-02 19:14:49 +10:00
Matt Joiner 2db45b1198 cmd/torrent: Add -addr flag back in 2016-04-19 17:20:14 +10:00
Matt Joiner 2dcbe31304 cmd/torrent: Forget trying to expose the entire Client config struct to the command-line 2016-04-18 21:30:28 +10:00
Matt Joiner 9bebc043ea cmd/torrent: Remove redundant _ "net/http/pprof" import
It's done by envpprof instead
2016-04-18 21:29:37 +10:00
Matt Joiner fa511154e4 Move Magnet and friends into metainfo package 2016-04-04 13:48:39 +10:00
Matt Joiner 6aacfe5589 Merge pull request #72 from shoenig/magnetize
convenience function for creating magnets
2016-04-04 13:20:15 +10:00
Seth Hoenig 890658ef93 convenience function for creating magnets 2016-04-03 10:05:17 -05:00
Matt Joiner d3a1c79c79 Merge Torrent and torrent types 2016-04-03 18:40:43 +10:00
Matt Joiner c469d4a837 cmd/torrent-metainfo-pprint: Switch to tagflag for argument parsing 2016-04-03 16:37:17 +10:00
Matt Joiner 0a3a5d6ae0 Finish fixing tests 2016-03-29 00:24:00 +11:00
Matt Joiner 775cf53809 Get mmap storage working 2016-03-28 21:57:04 +11:00
Matt Joiner b97b50aca9 New storage interface 2016-03-28 20:38:30 +11:00
Matt Joiner d5f888069f Ditch Data.WriteSectionTo, and fix cmd/torrent-verify 2016-02-18 11:45:31 +11:00
Matt Joiner 0c28a0f1b1 Use new tracker package interface 2016-02-07 18:49:35 +11:00
Matt Joiner 0e85ff190d go vet 2016-02-02 00:44:29 +11:00
Matt Joiner 3a206d4f12 util/profile was replaced by github.com/anacrolix/envpprof 2016-01-31 18:35:51 +11:00
Matt Joiner fe9d5702f6 Fixes for torrent.Reader not having ReadAt 2016-01-18 20:12:51 +11:00
Matt Joiner 153c13db43 Revert "Merge pull request #54 from zhulik/master"
This reverts commit 5cf75b869c, reversing
changes made to 09050ff2c5.
2016-01-06 12:19:49 +11:00
Gleb Sinyavsky 48c3df2d43 Refactorings 2016-01-05 11:48:16 +03:00
Gleb Sinyavsky 052a899f60 cmd utils fixed 2015-12-27 14:59:07 +03:00
Matt Joiner 812f5af66b Switch from launchpad.net/gommap to github.com/edsrzf/mmap-go for Windows support
Fixes #45.
2015-12-23 03:50:34 +11:00
Matt Joiner 5aca9d3563 Rewrite cmd/dht-ping 2015-12-08 00:45:42 +11:00
Dmitry Borzov b42fc90674 Fix name ambiguity for dht-ping, too many things are called pingResponses 2015-12-08 00:13:50 +11:00
Matt Joiner ff835db955 Actually fix #41 properly; and several big changes
bencode:
 * Handle omitempty on non-trivial types.
cmd/dht-ping:
 * Handle timeouts in ping transactions.
dht:
 * Propagate failed transaction responses properly.
 * Msg related tests are moved into their own file.
 * In some places, IPs in binary form are shorted to 4 bytes if IPv4.
2015-12-07 03:28:28 +11:00
Matt Joiner 5886fa1d6b cmd/torrent-infohash: Switch to tagflag 2015-11-22 18:49:44 +11:00
Matt Joiner 9230a1b9df Use uiprogress to display a progress bar per torrent 2015-11-22 18:45:06 +11:00
Matt Joiner c7f9bfccc1 Ditch go-flags for tagflag
Fixes #37
2015-11-05 23:21:39 +11:00
Matt Joiner f9c600b264 metainfo: Add alternative "builder" API
The existing builder API is gross and heavy-handed. I won't rip it out just yet.
2015-10-30 01:21:09 +11:00
Matt Joiner ea0ccf6a23 Tidy 2015-10-23 12:42:57 +11:00
Matt Joiner b8da06a885 cmd/torrent: Expose --mmap 2015-10-23 12:42:19 +11:00
Matt Joiner 99a0813d88 dht: Make Msg a struct with bencode tags 2015-10-23 12:41:45 +11:00
Matt Joiner abdf1f049f dht: Support IPv6 compact peers 2015-08-06 09:01:38 +10:00
Matt Joiner 4fb7d8f4d4 cmd/dht-secure-id 2015-08-05 02:38:02 +10:00
Matt Joiner 8069573abe cmd/torrent: Remove some dead code 2015-07-21 22:54:50 +10:00
Matt Joiner fcd98acc9b cmd/torrent-metainfo-pprint: Don't print extra newline when -name is true 2015-07-04 13:30:26 +10:00
Alexander Baranov 029f431ff6 Make torrent-pick work with latest changes 2015-06-25 21:02:14 +03:00
Matt Joiner 348c6406eb cmd/torrent-metainfo-pprint: Output JSON instead 2015-06-22 19:50:29 +10:00
Matt Joiner ca27d431f4 cmd/torrent-pick: gofmt and sortimports 2015-06-03 13:31:27 +10:00
Matt Joiner c6e2f2e15d Merge pull request #16 from scr4t/master
torrent-pick tool
2015-06-02 06:28:07 +10:00
Alexander Baranov 05d597a9f7 Only wait for io.Copy; Remove obsolete from client 2015-06-01 23:11:45 +03:00
Alexander Baranov 577b129df5 Use higher-level API to get file 2015-06-01 22:56:10 +03:00
Alexander Baranov 1bb31b979d Rename picker tool 2015-05-28 23:55:15 +03:00
Matt Joiner 9ea28a5094 go vet 2015-05-20 22:24:09 +10:00
Matt Joiner ca86b0248e go vet 2015-05-20 15:47:07 +10:00
Milos Gajdos 41c2773bcf Removed summary flag. Modified fileToMmap function
This commit also reverts the ugly hack in dht.go which was checking for
empty bootstrap node string.
2015-05-16 15:34:09 +01:00
Milos Gajdos e6e0b227da Multiple file metainfo mode support in cmd tools
torrent-create and torrent-verify did not work correctly when a single
file is present in metainfo torrent file. torrent-create now fails if
the path passed as an argument does not exist. I've als modified
dht.go which now handles the case when an empty string is passed in
DHT bootstrap nodes slice. Finally in span.go I've sneaked in cheekily
a change which defines a type more like idiomatic Go (I have an OCD :-))
2015-05-16 13:23:33 +01:00
Matt Joiner 0d13293d71 Support seeding 2015-05-15 08:39:53 +10:00
Alexander Baranov b8b403f83e Basic pick-file functionality 2015-05-11 17:50:59 +03:00
Matt Joiner c5208569ca Apply sortimports 2015-04-30 00:31:34 +10:00
Matt Joiner ca74d8ed33 Made Torrent.GotInfo a function, to avoid use of zero-initialized channel 2015-04-30 00:30:19 +10:00
Matt Joiner 0ec0302d1c Publicly expose Torrent.GotInfo 2015-04-28 15:24:17 +10:00
Matt Joiner 526d9d738e Rewrite imports to local bencode and metainfo 2015-04-27 14:55:01 +10:00
Matt Joiner d48b755776 cmd/torrent-magnet: Error if arguments are given
Too easy to make this mistake, and then it hangs.
2015-04-08 02:15:25 +10:00
Matt Joiner 23ff66e300 cmd/...: Some package synopses 2015-04-06 23:04:18 +10:00
Matt Joiner 6b81d57ca2 dht: Clean-up interface, add loads of documentation 2015-04-01 17:29:55 +11:00
Matt Joiner 0fddc286e6 cmd/torrentfs: Tidy 2015-04-01 14:32:42 +11:00
Matt Joiner 8ba4a2e0f3 cmd/torrentfs: Check error creating client
This wouldn't have happened with exceptions ;)
2015-04-01 14:30:22 +11:00
Matt Joiner d05e63d094 Use math.MaxUint64, the more you know 2015-03-30 23:08:43 +11:00
Matt Joiner 026b6da54f cmd/tracker-announce: Send left=-1, which is what we send when we don't have the metainfo 2015-03-27 17:23:42 +11:00
Matt Joiner 64f833f3f0 cmd/torrent-magnet: Converts a torrent from stdin to a magnet link 2015-03-27 17:16:50 +11:00
Matt Joiner 5f7ad4c769 Merge all the tracker packages, why would anyone want them separately? 2015-03-27 15:12:15 +11:00
Matt Joiner 9f62098e85 cmd/scrape -> cmd/tracker-announce, and a big refresh
What it was doing was not scraping, that's something completely different. Now it can also announce magnets.
2015-03-26 17:22:17 +11:00
Matt Joiner 3aa78763aa Use rogpeppe's sortimports to fix this goimports ordering madness 2015-03-26 17:18:08 +11:00
Matt Joiner d97b487229 cmd/torrent: Report progress
Fixes #6
2015-03-25 17:32:42 +11:00
Matt Joiner 1ec15c9560 cmd/torrent: Replace flag with go-flags, rejig options 2015-03-25 15:41:15 +11:00
Jimmy Zelinskie 8cc582ecb2 add cli flag to disable DHT
This partially addresses #3.
2015-03-22 18:24:31 -04:00
Matt Joiner ed8e89a60c cmd/torrent: Nicer usage 2015-03-20 23:18:32 +11:00
Matt Joiner 842a32ae0c Rewrite import paths for migration from Bitbucket 2015-03-20 16:37:44 +11:00
Matt Joiner ad6ac3f2cd More cleaning of public interface 2015-03-08 17:28:14 +11:00
Matt Joiner bc940ae2c6 Remove unused code 2015-02-25 01:40:27 +11:00
Matt Joiner a372b68abb dht: Handle responses through a callback
Trying to reduce number of goroutines
2015-02-21 15:00:48 +11:00
Matt Joiner a7946c773e cmd/torrent-metainfo-pprint: Add -name flag 2015-02-10 00:20:14 +11:00
Matt Joiner 1994e82297 Fails go vet 2015-02-10 00:19:31 +11:00
Matt Joiner 029d6939f8 Hide some methods that shouldn't be public 2015-02-10 00:12:29 +11:00
Matt Joiner 40593a741e Provide HTTP pprof via envpprof package 2015-01-29 14:51:23 +11:00