In this tutorial, I will show how to run a torrent tracker in i2p, including how to block torrents from your tracker or make a closed tracker with a whitelist.
Why?
There is some reasons you may want to create a torrent tracker:
To share torrents in a private community.
To have your own tracker instead of rely in other public trackers.
To help i2p network.
I2pd tunnel configuration
Add these lines to your tunnels.conf file to create a i2p address for your tracker:
Replacing “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.b32.i2p” with your tracker address.
Click “Add Tracker” and “Save Tracker Configuration”.
Go back to the main i2pspark page.
Add the file you want to seed in your i2psnark directory.
Put the file name in “Data to seed” field and select your tracker in “Trackers” list. Then click “Create torrent”. 6.1. If you are running a closed tracker, you need to add the info_hash of the torrent you just created inside your whitelist file and restart your tracker.
Click the magnet symbol in your torrent to copy the magnet link, it will look like this example:
In this tutorial, I will show how you can make your own private XMPP server, where you will have full control of your user data, messages, groups, files, all of that federated over anonymizing networks such as tor and i2p.
This first address is the main address, each user in the server will have this address in their JID, for example: user@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.b32.i2p. The port 5269 will be used for server-to-server connections, this is where your server will be able to talk to other servers federated in i2p network. The port 5222 will be used for client-to-server connections, this is where your xmpp client(in this tutorial, monocles chat) will talk to your server. The inbound/outbound quantity are the amount of tunnels that this b32 address will have for receiving/sending data over i2p network, since this b32 address will not have a huge flow of data, I decided to configure less tunnels to avoid wasting i2p network resources.
This third address will be used for prosody file sharing server, every time a user uploads a file it will be sent to this server, and other people in the chat will be able to download the file. The port 5280 is used for http, and the port 5281 is used for https.
Replacing “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.b32.i2p” with prosody-s2s/prosody-c2s b32 address you got in i2pd webconsole. Replacing “yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy.b32.i2p” with prosody-s2s-muc/prosody-c2s-muc b32 address you got in i2pd webconsole. Replacing “zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.b32.i2p” with prosody-http/prosody-https b32 address you got in i2pd webconsole.
Run tor using this torrc file and check your hidden service folder, you will find a file called “hostname”, this is your onion address, and it will look like this:
Replacing “aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.onion” with the onion address you got on “hostname” file from your hidden service folder.
Turn on your i2pd router in your phone, you can use their app for this.
Open monocles chat and go to the login page.
Click “I have an account”.
Go to the config button(“⋮”) and go to configurations, then select “Expert settings” and check “Connect via I2P”.
Go back to login, put in “hostname” your main b32 address, and in “ID Jabber” put your JID, like this:
1 2
hostname: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.b32.i2p ID Jabber: user@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.b32.i2p
Put your password and click “Next”.
Accept the certificate of your server and you are ready to go!
Tor
Turn on tor, you can use orbot for this.
Open monocles and go to login page.
Click “I have an account”.
Go to the config button(“⋮”) and go to configurations, then select “Expert settings” and check “Connect via Tor”.
Go back to login, put in “hostname” your onion address, and in “ID Jabber” put your JID, like this:
1 2
hostname: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.onion ID Jabber: user@aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.onion
Put your password and click “Next”.
Accept the certificate of your server and you are ready to go!
Optional: other prosody configurations that you may want to change
Message archiving(mod_mam)
Uncomment mod_mam to make your server store messages.
1 2 3 4
change this line: --"mam"; -- Store recent messages to allow multi-device synchronization to this: "mam"; -- Store recent messages to allow multi-device synchronization
Change this config to set the expiration time of your messages:
1
archive_expires_after = "1w" -- Remove archived messages after 1 week
You can set the value to any time you want, including “never” to never delete your messages(this is YOUR private server, if you have good amount of storage, go ahead, you have FULL CONTROL over your data! ;D). Check more about mod_mam here.
Server limits(mod_limits)
Change the bandwidth limits by your choice in these lines:
Prosody is private by default to avoid abuse of spammers, meaning that with the current setup showed in this tutorial, the only user of your server will be you. If you have a good hardware, you may want to run a public server for other people to join, or just want a server for your private community. You have 2 ways to allow other people to register in your server.
Create a register invite for each participant you want to join your server
First, add these 2 lines to your prosody.cfg.lua before the lines with “VirtualHost”:
You will get something like: xmpp:your_address?register;preauth=ramdom_token
Create a QR Code with this invite and send to the person you want to register. For this method, the person needs to have a xmpp client installed that recognizes this invite(like Monocles chat). The invite will work for only one account, so you will need to generate a invite for every person you want to register in your server.
Allow ANYONE to register in your server(be carefull with this option)
First, add these 2 lines to your prosody.cfg.lua before the lines with “VirtualHost”:
Anyone with a xmpp client will be able to register in your server, so you need to be carefull with spammers.
Check more about register here. Check more about invites here. Check best practices for public servers here.
Pros and Cons of making your own XMPP server over tor/i2p (In my opinion)
Pros:
Full control of your data.
Anyone can make a server, since tor/i2p domains are free.
Very lightweight server.
Location of your server and user will be hidden.
Having the benefits of a p2p messenger(like briar), without the problems of p2p messenger(like group syncronization problems).
Cons:
You will only be able to talk with other people that has a similar setup inside tor/i2p. (Good reason to share this tutorial to more people :D)
Not all XMPP clients will work with this setup, but if this setup gets more popular, hopefully this will change. (For example, Dino does not handle onion/i2p addresses, gajim works with DMs and MUCs, but fails with file download)
Slow connection, mostly with sharing files. (In monocles chat, for example, I frequently got “timeout error” when trying to send videos, but maybe this can be fixed setting a higher timeout when using tor and i2p in their source code)
You need some kind of knowledge to setup this, and a hardware running 24/7.
Test your setup!
If you were able to create your server successfully, I created a group in my server in tor and i2p, so people can join and test their setup.