mktorrent icon indicating copy to clipboard operation
mktorrent copied to clipboard

Add the ability to read the announce URL from a file

Open ghost opened this issue 6 years ago • 9 comments

Currently the announce URL only can be specified with a CLI argument. This is bad if the URL contains a passkey as it is standard under private trackers. In a shared environment this is highly insecure because under standard conditions everyone can see the CLI arguments from all running processes, so an attacker or an users who knows what he's doing can harvest passkeys from other users. But if the announce URL is read from a file instead nobody can see what the file contains.

ghost avatar Jan 16 '18 17:01 ghost

Great addition. I see it doesn't support multiple announce url's? Maybe an idea to add as some private trackers use up to (as I've seen) three unique announce URL's to prevent dependency on one.

The changes in main.c also seem irrelevant to your pull request. If they are. Please remove them.

Also it would be nice if you took the files size into consideration when you allocate memory and not always allocate the maximum you allow. It is a lightweight torrent creator.

Rudde avatar Jan 17 '18 07:01 Rudde

@Rudde I've never heard of a private tracker that allows multiple announce URLs, but if you say that one like that exists then I'll add support for it.

Yeah, I'll use the filesize of the file now that's much better.

OK, I can revert the changes and you're right they have nothing to do with that PR, but it's still much more efficient probably to do it like that. Do you have anything against that? Would you accept it in a separate PR?

ghost avatar Jan 17 '18 08:01 ghost

Yes they exist, and it's also nice to keep it consistent with the original features of announce adding.

Super!

Yes, I can do that, but I would have to test it first. Don't really have anything against it.

Rudde avatar Jan 17 '18 08:01 Rudde

OK, all done. But I've use newline as a separator in announce files as it is more natural and easier to read in files.

ghost avatar Jan 17 '18 10:01 ghost

Any update on this?

ghost avatar Jan 25 '18 08:01 ghost

Hello, I tested this today, but I can't seem to get multipler announce files on new lines to work, it seems to only honor the first one.

Rudde avatar Jan 28 '18 14:01 Rudde

Gotta look into it later.

ghost avatar Jan 28 '18 14:01 ghost

Hello, I've tested it and it works for me. How are you creating the torrent? And what are you using as announce file? Can you show me both?

ghost avatar Jan 29 '18 19:01 ghost

@Hyleus I'm terrible sorry for the late respond, I have overseen the e-mail notification of your latest post.

Content of this: https://gist.github.com/Rudde/b0232e92288e7a3fbe6caf4e91c96786

I had as announce.txt file

use the following to create torrent file

$ ./mktorrent/mktorrent -A announce.txt -p -o from_file_three_announce.torrent file.tar.gz

Rudde avatar Apr 15 '18 13:04 Rudde