This guide is going to focus on the Pleroma federation aspect. The actual installation is neatly explained in the official documentation, and more likely to remain up-to-date.
It might be added to this guide if there will be a need for that.
We're going to use I2PD for its lightweightness over the official client.
Follow the documentation according to your distro: https://i2pd.readthedocs.io/en/latest/user-guide/install/#installing
How to run it: https://i2pd.readthedocs.io/en/latest/user-guide/run/
## I2P Federation
There are 2 ways to go about this.
One using the config, and one using external software (fedproxy). The external software works better so far.
### Using the Config
**Warning:** So far, everytime I followed this way of federating using I2P, the rest of my federation stopped working. I'm leaving this here in case it will help with making it work.
Assuming you're running in prod, cd to your Pleroma folder and append the following to `config/prod.secret.exs`:
You can restart I2PD here and finish if you don't wish to make your instance viewable or accessible over I2P.
```
systemctl stop i2pd.service --no-block
systemctl start i2pd.service
```
*Notice:* The stop command initiates a graceful shutdown process, i2pd stops after finishing to route transit tunnels (maximum 10 minutes).
You can change the socks proxy port in `/etc/i2pd/i2pd.conf`.
## I2P Instance Access
Make your instance accessible using I2P.
Add the following to your I2PD config `/etc/i2pd/tunnels.conf`:
```
[pleroma]
type = http
host = 127.0.0.1
port = 14447
keys = pleroma.dat
```
Restart I2PD:
```
systemctl stop i2pd.service --no-block
systemctl start i2pd.service
```
*Notice:* The stop command initiates a graceful shutdown process, i2pd stops after finishing to route transit tunnels (maximum 10 minutes).
Now you'll have to find your address.
To do that you can download and use I2PD tools.[^1]
Or you'll need to access your web-console on localhost:7070.
If you don't have a GUI, you'll have to SSH tunnel into it like this:
`ssh -L 7070:127.0.0.1:7070 user@ip -p port`.
Now you can access it at localhost:7070.
Go to I2P tunnels page. Look for Server tunnels and you will see an address that ends with `.b32.i2p` next to "pleroma".
This is your site's address.
### I2P-only Instance
If creating an I2P-only instance, open `config/prod.secret.exs` and under "config :pleroma, Pleroma.Web.Endpoint," edit "https" and "port: 443" to the following:
And for both cases, disable CSP in Pleroma's config (STS is disabled by default) so you can define those yourself separately from the clearnet (if your instance is also on the clearnet).
*Notice:* The stop command initiates a graceful shutdown process, i2pd stops after finishing to route transit tunnels (maximum 10 minutes).
You should now be able to bothaccess your instance using I2P and federate with other I2P instances!
[^1]: [I2PD tools](https://github.com/purplei2p/i2pd-tools) to print information about a router info file or an I2P private key, generate an I2P private key, and generate vanity addresses.