Comments (5)
- http://blog.bitcomet.com/bitcomet/post_417/ provides some hints as to how it works on a protocol level.
There's also this definition here: http://www.bittorrent.org/beps/bep_0027.html#bep-12
Examples of announce URLs:
http://tracker.what.cd:34000/igmax2lw0vabtj0y9w8box2tvxwj4fws/announce
http://please.passthepopcorn.me:2710/rhoymaldjuxixvyf2vgq3sf0r9rvjhi5/announce
(keys have been obfuscated for anonymity).
I don't believe the private key needs to actually be in the announce URL at all, but it makes it easier for users to tell what private key a torrent is using, as those are not normally exposed to the user directly. (I've seen a couple of "private" torrents that do NOT have the private key in the URL, but do use private keys).
- My two primary concerns would be speed and scalability. Checking against a database many times a second could rapidly hurt performance; but I believe that's how Ocelot does it it and Ocelot is ridiculously fast... hmm.
Here's the relevant config stuff from Ocelot (an excellent but restrictively licensed tracker):
config::config() {
host = "127.0.0.1";
port = 34000;
max_connections = 512;
max_read_buffer = 4096;
timeout_interval = 20;
schedule_interval = 3;
max_middlemen = 5000;
announce_interval = 1800;
peers_timeout = 2700; //Announce interval * 1.5
reap_peers_interval = 1800;
del_reason_lifetime = 604800;
// MySQL
mysql_db = "gazelle";
mysql_host = "127.0.0.1:3306";
mysql_username = "***";
mysql_password = "***";
site_host = "localhost";
site_password = "********************************"; // MUST BE 32 CHARS
}
I'll try to get a dump of the DB schema it uses.
I'm fairly certain it gets around the DB performance hit by basically caching MySQL queries in memory - allowing the flexibility of a DB but without as much performance overhead. It flushes the caches every X seconds (schedule_interval?).
It largely follows the DB format XBTT uses, but with some neat variations.
I used MySQL logs to gather some info on how it works - these are in no particular order but give you some idea of how it might be implemented.
Grab list of users allowed to leech:
SELECT ID, can_leech, torrent_pass FROM users_main WHERE Enabled='1';
Reset seeder and leecher count in DB:
UPDATE torrents SET Seeders = 0, Leechers = 0;
Grab list of torrents, including freeleech/neutral status:
SELECT ID, info_hash, freetorrent, Snatched FROM torrents ORDER BY ID;
(if freetorrent = 1, freeleech mode; torrent only counts the uploaded data in the DB)
(if freetorrent = 2, neutral mode; torrent does not count any data)
(if freetorrent = 0, regular mode; both upload and download counts).
Clear XBTT user list?!
TRUNCATE xbt_files_users;
There's lots of stuff besides that, but that's the basic stuff near as I can see.
So; to answer 3...
Write it to SQL as you clear the buffer :P
from hefur.
Maybe the db for private trackers could be into hefur? It would allow a custom and high performances format.
from hefur.
By the way, checking against the database can scale if your table+index can fit in memory ;-)
How many users do/will you have?
from hefur.
I think that with an interface like this one, we can implement anything: https://github.com/abique/hefur/blob/master/hefur/private-tracker-controller.hh
from hefur.
That seems like the easiest idea. I think aiming for Gazelle support is
good - it's the most popular private tracker CMS now :)
- B
Maybe the db for private trackers could be into hefur?
—
Reply to this email directly or view it on
GitHubhttps://github.com//issues/5#issuecomment-11609826.
from hefur.
Related Issues (20)
- /var/run/hefur is not created as defined service user HOT 1
- Can't "make" Ubuntu 12.04 HOT 2
- fail build with GCC 6.1.1 HOT 3
- Server IPv4 & IPv6 peers
- mimosa submodule needs update
- Docbook template location is distro-dependent, build breaks on failure to find manual.html HOT 3
- hefurctl log commands do not work HOT 1
- Missing systemd service HOT 1
- manual/manual.html file is missing
- add support for BitTorrent v2 HOT 9
- error: /var/run/hefur/control: No such file or directory HOT 6
- fatal: failed to listen on the port <num>: Address already in use HOT 1
- Symbolic links in whitelist directory are ignored HOT 3
- /file/ does not handle SHA256 hashes HOT 1
- /stat and /peers do not set content-type header
- failed to listen on the port 6969 with ipv6 HOT 1
- Broken parsing of HTTP headers HOT 13
- Inconsistency in manual.md
- v2 torrents not removed in daemon mode
- Broken link in manual.md
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hefur.