{% extends "global/layout.html" %} {% block title %}{% trans %}Configuration File Specification{% endtrans %}{% endblock %} {% block lastupdated %}{% trans %}January 2014{% endtrans %}{% endblock %} {% block accuratefor %}0.9.10{% endblock %} {% block content %}
{% trans -%} This page provides a general specification of I2P configuration files, used by the router and various applications. It also gives an overview of the information contained in the various files, and links to detailed documentation where available. {%- endtrans %}
{% trans url='http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Properties.html#load%28java.io.InputStream%29' -%} An I2P configuration file is formatted as specified in Java Properties with the following exceptions: {%- endtrans %}
{% trans -%} The file need not be sorted, but most applications do sort by key when writing to the file, for ease of reading and manual editing. {%- endtrans %}
{% trans url='http://docs.i2p-projekt.de/javadoc/net/i2p/data/DataHelper.html', commonstructures=site_url('docs/spec/common-structures') -%} Reads and writes are implemented in DataHelper loadProps() and storeProps(). Note that the file format is significantly different than the serialized format for I2P protocols specified in Mapping. {%- endtrans %}
{% trans -%} Configured via /configclients in the router console. {%- endtrans %}
The format is as follows:
Lines are of the form clientApp.x.prop=val, where x is the app number. App numbers MUST start with 0 and be consecutive.
Properties are as follows:
main: Full class name. Required. The constructor or main() method in this class will be run, depending on whether the client is managed or unmanaged. See below for details. name: Name to be displayed on console. args: Arguments to the main class, separated by spaces or tabs. Arguments containing spaces or tabs may be quoted with ' or " delay: Seconds before starting, default 120 onBoot: {true|false}, default false, forces a delay of 0, overrides delay setting startOnLoad: {true|false} Is the client to be run at all? Default true
The following additional properties are used only by plugins:
stopargs: Arguments to stop the client. uninstallargs: Arguments to uninstall the client. classpath: Additional classpath elements for the client, separated by commas.
The following substitutions are made in the args, stopargs, uninstallargs, and classpath lines, for plugins only:
$I2P: The base I2P install directory $CONFIG: The user's configuration directory (e.g. ~/.i2p) $PLUGIN: This plugin's directory (e.g. ~/.i2p/plugins/foo)
All properties except "main" are optional. Lines starting with "#" are comments.
If the delay is less than zero, the client is run immediately, in the same thread, so that exceptions may be propagated to the console. In this case, the client should either throw an exception, return quickly, or spawn its own thread. If the delay is greater than or equal to zero, it will be run in a new thread, and exceptions will be logged but not propagated to the console.
Clients may be "managed" or "unmanaged".
As of release 0.9.4, the router supports "managed" clients.
Managed clients are instantiated and started by the ClientAppManager
.
The ClientAppManager maintains a reference to the client and receives updates on the client's state.
Managed clients are preferred, as it is much easier to implement state tracking
and to start and stop a client. It also is much easier to avoid static references in the client code
which could lead to excessive memory usage after a client is stopped.
Managed clients implement either the net.i2p.app.ClientApp
or
net.i2p.router.app.RouterApp
interface.
Clients implementing the ClientApp interface MUST provide the following constructor:
public MyClientApp(I2PAppContext context, ClientAppManager listener, String[] args)Clients implementing the RouterApp interface MUST provide the following constructor:
public MyClientApp(RouterContext context, ClientAppManager listener, String[] args)The args will be the arguments specified in the clients.config file.
If the main class does not implement a managed interface, it will be started with main() with the arguments specified, and stopped with main() with the arguments specified.
{% trans -%} Configured via /configlogging in the router console. {%- endtrans %}
{% trans -%} Properties are as follows: {%- endtrans %}
logger.format={dctpm}* where d = date, c = class, t = thread name, p = priority, m = message logger.dateFormat=HH:mm:ss.SSS logger.logFileName=name logger.logFileSize=nnn[K|M|G] logger.logRotationLimit=n logger.displayOnScreen=true|false logger.consoleBufferSize=n logger.minimumOnScreenLevel=CRIT|ERROR|WARN|INFO|DEBUG logger.defaultLevel=CRIT|ERROR|WARN|INFO|DEBUG logger.logBufferSize=n logger.dropOnOverflow=true|false logger.dropDuplicates=true|false logger.record.{class}=CRIT|ERROR|WARN|INFO|DEBUG
{% trans pluginspec=site_url('docs/spec/plugin') -%} See the plugin specification. {%- endtrans %}
{% trans -%} Enable/disable for each installed plugin. {%- endtrans %} {% trans -%} Properties are as follows: {%- endtrans %}
plugin.{name}.startOnLoad=true|false
{% trans -%} Enable/disable for each installed webapp. {%- endtrans %} {% trans -%} Properties are as follows: {%- endtrans %}
webapps.{name}.classpath=[space- or comma-separated paths] webapps.{name}.startOnLoad=true|false
{% trans -%} Configured via /configadvanced in the router console. {%- endtrans %}
{% trans -%} See documentation in SusiDNS. {%- endtrans %}
{% trans -%} Configured via the application gui. {%- endtrans %}
{% trans -%} Configured via the /i2ptunnel application in the router console. {%- endtrans %}
{% trans -%} The router console uses the router.config file. {%- endtrans %}
{% trans -%} See post on zzz.i2p. {%- endtrans %}
{% endblock %}