{% extends "global/layout.html" %} {% block title %}{% trans %}Monotone Guide{% endtrans %}{% endblock %} {% block content_nav %}
  1. {% trans %}Operating a Monotone client{% endtrans %}
    1. {% trans %}Generating Monotone keys{% endtrans %}
    2. {% trans %}Trust and initializing your repository{% endtrans %}
    3. {% trans %}Obtaining and deploying developers' keys{% endtrans %}
    4. {% trans %}Setting up trust evaluation hooks{% endtrans %}
    5. {% trans %}Pulling the i2p.i2p, i2p.www and i2p.syndie branches{% endtrans %}
    6. {% trans %}Verifying that trust evaluation works{% endtrans %}
    7. {% trans %}Checking out a working copy of the latest version{% endtrans %}
    8. {% trans %}Updating your working copy to the latest version{% endtrans %}
  2. {% trans %}Operating a Monotone Server{% endtrans %}
    1. {% trans %}Obtaining and deploying developers’ transport keys{% endtrans %}
    2. {% trans %}Granting push and pull access{% endtrans %}
    3. {% trans %}Running Monotone in server mode{% endtrans %}
    4. {% trans %}Differences under Debian GNU/Linux{% endtrans %}
{% endblock %} {% block content %}

{% trans transitionguide=site_url('misc/transition-guide'), newdevs=site_url('get-involved/guides/new-developers') -%} This is a revised version of Complication's original guide detailing the use of Monotone in I2P development. For basic instructions see the quick-start guide. {%- endtrans %}

{% trans licenses=site_url('get-involved/develop/licenses') -%} I2P has a distributed development model. The source code is replicated across independently administered Monotone ("MTN") repositories. Developers with commit rights are able to push their changes to the repository (a license agreement needs to be signed before commit rights are granted). {%- endtrans %}

{% trans -%} Some of Monotone's noteworthy qualities are: distributed version control, cryptographic authentication, access control, its small size, having few dependencies, storage of projects in a compressed SQLite database file, and having the ability to resume interrupted synchronization attempts. {%- endtrans %}

{% trans %}Operating a Monotone Client{% endtrans %}

{% trans %}Generating Monotone keys{% endtrans %}

{% trans -%} A transport key grants you the ability to push your changes to a Monotone repository server. In order to commit code into Monotone (in essence signing your code), a commit key is also needed. None of the public Monotone servers on I2P currently require a key in order to read (or pull) the source code. {%- endtrans %}

{% trans -%} Without a transport key, one cannot:

{%- endtrans %}

{% trans -%} Without a commit key, one cannot:

{%- endtrans %}

{% trans -%} If you only intend to retrieve code from MTN, feel free to skip to the next section. If you want to generate keys, read the following. {%- endtrans %}

{% trans -%} By convention keys are named like an e-mail addresses, but a corresponding e-mail address does not need to exist. For example, your keys might be named: {%- endtrans %}

{% trans -%} Monotone stores keys under $HOME/.monotone/keys in text files which are named identically to the keys. For example: {%- endtrans %}

{% trans -%} To generate transport and commit keys, enter the following commands at a prompt: {%- endtrans %}

{% trans -%} Monotone will prompt you for a password to protect your keys. You are very strongly encouraged to set a password for the commit key. Many users will leave an empty password for the transport key, especially those running a Monotone server. {%- endtrans %}

{% trans %}Trust, and initializing your repository{% endtrans %}

{% trans -%} Monotone's security model helps to ensure that nobody can easily impersonate a developer without it being noticed. Since developers can make mistakes and become compromised,only manual review can ensure quality of code. Monotone's trust model will ensure that you read the right diffs. It does not replace reading diffs. {%- endtrans %}

{% trans -%} A Monotone repository is a single file (a compressed SQLite database) which contains all of the project's source code and history. {%- endtrans %}

{% trans -%} After importing the developers' keys into Monotone and setting up trust evaluation hooks, Monotone will prevent untrusted code from being checked out into your workspace. There are commands available to clean untrusted code from your workspace but in practice they've not been needed due to the push access policies in place. {%- endtrans %}

{% trans -%} A repository can hold many branches. For example, our repository holds the following main branches: {%- endtrans %}

{% trans -%} By convention, the I2P Monotone repository is named i2p.mtn. Before pulling source code from servers, a database for your repository will need to be initialized. To initialize your local repository, change into the directory that you want the i2p.mtn file and branch directories to be stored and issue the following command: {%- endtrans %}

{% trans %}Obtaining and deploying developers' keys{% endtrans %}

{% trans -%} Keys which developers use to commit code are essential for trust evaluation in Monotone. The other developers' transport keys are only required for Monotone server operators. {% endtrans %}

{% trans signedkeys=site_url('get-involved/develop/signed-keys') -%} Developers' commit keys are provided GPG-signed on another page. {%- endtrans %}

{% trans devkeys=site_url('get-involved/develop/developers-keys') -%} To import developers' keys after verifying their authenticity, copy all of the keys into a new file. Create this file (e.g. keys.txt) in the same directory where i2p.mtn is located. Import the keys with the command: {%- endtrans %}

{% trans -%} Note: Never add keys to $HOME/.monotone/keys manually. {%- endtrans %}

{% trans %}Setting up trust evaluation hooks{% endtrans %}

{% trans -%} The default Monotone trust policy is way too lax for our requirements: every committer is trusted by default. That is not acceptable for I2P development. {%- endtrans %}

{% trans -%} Change into the directory $HOME/.monotone and open the file monotonerc with a text editor. Copy and paste the following two functions into this file: {%- endtrans %}

{% include "include/monotonerc.html" %}

{% trans -%} The first function determines an intersection between two sets, in our case a revision's signers and trusted signers. {%- endtrans %}

{% trans -%} The second function determines trust in a given revision, by calling the first function with "signers" and "trusted" as arguments. If the intersection is null, the revision is not trusted. If the intersection is not empty, the revision is trusted. Otherwise, the revision is not trusted. {%- endtrans %}

{% trans -%} More information about Trust Evaluation Hooks can be found in the official Monotone documentation. {%- endtrans %}

{% trans %}Pulling the i2p.i2p, i2p.www and i2p.syndie branches{% endtrans %}

{% trans -%} I2P is shipped with a pre-configured tunnel pointing to the project Monotone server. Ensure that the tunnel has been started within I2PTunnel before attempting to pull the source code from 127.0.0.1:8998. {%- endtrans %}

{% trans -%} Enter the directory where you initialized i2p.mtn. Depending on whether you want only I2P sources, or also sources for the I2P website and Syndie, you can perform the pull operation in different ways. {%- endtrans %}

{% trans -%} If you only want I2P sources: {%- endtrans %}

{% trans -%} If you want all branches: {%- endtrans %}

{% trans -%} If the transfer aborts before completing sucessfully, simply repeating the pull command will resume the transfer. {%- endtrans %}

{% trans -%} Pulling in the above examples is done anonymously by specifying an empty transport key. If everyone pulls anonymously it will be harder for an attacker who gains control of the server to selectively provide some people with tampered data. {%- endtrans %}

{% trans %}Verifying that trust evaluation works{% endtrans %}

{% trans -%} To verify that trust evaluation works: {%- endtrans %}