Freenet Setup

Then activate the Web of Trust plugin and the Freemail plugin. As soon as your Freenet is running, you’ll find the Web of Trust and Freemail plugins on the Plugins-Page. This link will work once you have a running Freenet. If you want to run Freenet on another computer, you can make it accessible to your main machine via ssh port forwarding: ssh -NL 8888:localhost:8888 -L 9481:localhost:9481 <host>.

Privacy Protections

Infocalypse takes your privacy seriously. When you clone a repository
from freenet, your username for that repository is automatically set
to “anonymous” and when you commit, the timezone is faked as UTC to
avoid leaking your home country.

If you want to add more security to your commits, consider also using
a fake time-of-day:

Open path/to/repo-from-freenet/.hg/hgrc to set this permanently via
an alias (just adapt the alias for rewriting the commit-date to UTC -
these are already in the hgrc file if you cloned from Freenet).

Background Information

Let’s look at a few interesting steps in the example to highlight the strengths of Infocalypse, and provide an outlook with steps we already took to prepare Infocalypse for future development.

Efficient storage in Freenet

hg clone life-repo freenet://ArneBab/life-repo

Here we clone the local repository into Freenet. Infocalypse looks up the private key from the identity ArneBab. Then it creates two repositories in Freenet: <private key>/life-repo.R1/0 and <private key>/life-repo.R0/0. The URLS only differ in the R1 / R0: They both contain the same pointers to the actual data, and if one becomes inaccessible, the chances are good that the other still exists. Doubling them reduces the chance that they fall out and become inaccessible, which is crucial because they are the only part of your repository which does not have 100% redundancy. Also these pointers are the only part of the repository which only you can insert. As long as they stay available, others can reinsert the actual data to keep your repository accessible.

To make that easy, you can run the command hg fn-reinsert in a cloned repository. It provides 5 levels:

1 - re-inserts the top key(s)

2 - re-inserts the top keys(s), graphs(s) and the most recent update.

3 - re-inserts the top keys(s), graphs(s) and all keys required to bootstrap the repo (default).

4 - adds redundancy for big (>7Mb) updates.

5 - re-inserts existing redundant big updates.

To reinsert everything you can insert, just run a tiny bash-loop:

for i in {1..5}; do hg fn-reinsert --level $i; done

Let’s get to that “actual data”. When uploading your data into Freenet, Infocalypse creates a bundle with all your changes and uploads it as a single file with a content-dependent key (a CHK). Others who know which data is in that bundle can always recreate it exactly from the repository.

When someone else uploads additional changes into Freenet, Infocalypse calculates the bundle for only the additional changes. This happens when you push:

hg push freenet://ArneBab/life-repo

To clone a repository, Infocalypse first downloads the file with pointers to the data, then downloads the bundles it needs (it walks the graph of available bundles and only gets the ones it needs) and reassembles the whole history by pulling it from the downloaded bundles.

hg clone freenet://ArneBab/life-repo real-life

By reusing the old bundles and only inserting the new data, Infocalypse minimizes the amount of data it has to transfer in and out of Freenet, and more importantly: Many repositories can share the same bundles, which provides automatic deduplication of content in Freenet. When you take into account that in Freenet often accessed content is faster and more reliable than seldomly accessed content, this gives Infocalypse a high degree of robustness and uses the capabilities of Freenet in an optimal way.

If you want to go into Infocalypse-specific commands, you can also clone a repository directly to your own keyspace without having to insert any actual data yourself:

This works by sending a Freemail to the owner of that repository which contains a YAML-encoded footer with the data about the repository to use.

You have to trust the owner of the other repository to send the pull-request, and the owner of the other repository has to trust you to receive the message. If the other does not trust you when you send the pull-request, you can change this by introducing your Pseudonym in the Web of Trust plugin (this means solving CAPTCHAs).

Convenience

To make key management easier, you can add the following into path/to/repo/.hg/hgrc

Now pull and push will by default go to freenet://ArneBab/life-repo and you can pull from the other repo via hg pull real-life.

Your keys are managed by the Web of Trust plugin in Freenet, so you can use the same freenet-uri for push and pull, and you can share the paths without having to take care that you don’t spill your private key.

DVCS WebUI

When looking for repositories with the command line interface, you are reliant on finding the addresses of repositories somewhere else. To ease that, Steve also implemented the DVCS WebUI for Freenet during his GSoC project. It provides a web interface via a Freenet plugin. In addition to providing a more colorful user interface, it could add 24/7 monitoring, walking remote repositories and pre-fetching of relevant data to minimize delays in the command line interface. It is still in rudimentary stages, though.

All the heavy lifting is done within the Infocalypse Mercurial plugin: Instead of implementing DVCS parsing itself, The DVCS WebUI asks you to connect Infocalypse so it can defer processing to that:

hg fn-connect

The longterm goal of the DVCS WebUI is to use provide a full-featured web interface for repository exploration. The current version provides the communication with the Mercurial plugin and lists the paths of locally known repositories.

Gitocalypse

If you prefer working with git, you can use gitocalypse written by SeekingFor to seamlessly use Infocalypse repositories as git remotes. Gitocalypse is available from https://github.com/SeekingFor/gitocalypse

Troubleshooting

When I'm running "hg fn-setup" I get the error "abort: No module named fcp.node"Do you have pyFreenet installed? Also ensure that you installed it for python 2.wget bootstrap.pypa.io/ez_setup.py -O - | python2.7 - --usereasy_install --user --egg Mercurial defusedxml PyYAML pyFreenet==0.4.0

Conclusion

Infocalypse provides hosting of repositories in Freenet with a level of convenience similar to GitHub or Bitbucket, but decentralized, anonymous and entirely built of Free Software.

You can leverage it to become independent from centralized hosting platforms for sharing your work and collaborating with other hackers.

This guide shows the convenient way of working which has a higher barrier of entry. It uses WoT Pseudonyms to allow you to insert repositories by Pseudonym and repository name. If you can cope with inserting by private key and sending pull-requests manually, you can use it without the WoT, too, which reduces the setup effort quite a bit. Just skip the setup of the Web of Trust and Freemail and plugins. You can then clone the life repo via hg clone freenet://USK@6~ZDYdvAgMoUfG6M5Kwi7SQqyS-gTcyFeaNN1Pf3FvY,OSOT4OEeg4xyYnwcGECZUX6~lnmYrZsz05Km7G7bvOQ,AQACAAE/life-repo.R1/4 life-repo. See hg fn-genkey and hg help infocalypse for details. ↩

But thanks to massive shared action earlier this year, the European parliament can still prevent the problems. For each of the articles there are proposals which fix them. The parliamentarians (MEPs) just have to vote for them. And since they are under massive pressure from large media companies, that went as far as defaming those who took action as fake people, the MEPs need to hear your voice to know that your are real.

If you care about the future of the Internet in the EU, please Call your MEPs.