Make the upload limit a config option.
[quix0rs-apt-p2p.git] / debian / apt-p2p.conf.sgml
1 <!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
2
3   <!-- Fill in your name for FIRSTNAME and SURNAME. -->
4   <!ENTITY dhfirstname "<firstname>Cameron</firstname>">
5   <!ENTITY dhsurname   "<surname>Dale</surname>">
6   <!-- Please adjust the date whenever revising the manpage. -->
7   <!ENTITY dhdate      "<date>February 17, 2008</date>">
8   <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
9        allowed: see man(7), man(1). -->
10   <!ENTITY dhsection   "<manvolnum>5</manvolnum>">
11   <!ENTITY dhemail     "<email>camrdale@gmail.com</email>">
12   <!ENTITY dhusername  "Cameron Dale">
13   <!ENTITY dhucpackage "<refentrytitle>apt-p2p.conf</refentrytitle>">
14   <!ENTITY dhpackage   "apt-p2p">
15
16   <!ENTITY debian      "<productname>Debian</productname>">
17   <!ENTITY gnu         "<acronym>GNU</acronym>">
18   <!ENTITY gpl         "&gnu; <acronym>GPL</acronym>">
19 ]>
20
21 <refentry>
22   <refentryinfo>
23     <address>
24       &dhemail;
25     </address>
26     <author>
27       &dhfirstname;
28       &dhsurname;
29     </author>
30     <copyright>
31       <year>2008</year>
32       <holder>&dhusername;</holder>
33     </copyright>
34     &dhdate;
35   </refentryinfo>
36   <refmeta>
37     &dhucpackage;
38
39     &dhsection;
40   </refmeta>
41
42   <refnamediv>
43     <refname>&dhpackage;</refname>
44
45     <refpurpose>configuration file for &dhpackage;</refpurpose>
46   </refnamediv>
47
48   <refsect1>
49     <title>DESCRIPTION</title>
50
51     <para>Configuration information for &dhpackage; is searched for in the following order, with later
52       entries overriding former ones:
53       <OrderedList>
54         <ListItem><para>/etc/apt-p2p/apt-p2p.conf</para></ListItem>
55         <ListItem><para>${HOME}/.apt-p2p/apt-p2p.conf</para></ListItem>
56         <ListItem><para>the location specified by the config-file parameter</para></ListItem>
57       </OrderedList>
58     </para>
59     
60   </refsect1>
61   <refsect1>
62     <title>FORMAT</title>
63
64     <para>&dhpackage; has a structure similar to Microsoft Windows INI files.
65         The configuration file consists of sections, led by a ``[section]'' header and followed
66         by ``name = value'' or ``name: value'' entries, with continuations in the style of RFC 822
67         (values can span multiple lines by starting the subsequent lines with one or more spaces).
68         Some values indicate times, in which case a suffix of 'd' for
69         days, 'h' for hours, 'm' for minutes, and 's' for seconds can be used.
70         Boolean values can be '1', 'yes', 'true', and 'on' to evaluate to True,
71         or '0', 'no', 'false', and 'off' to evaluate to false.
72         Note that leading whitespace is removed from values, and case is not important.
73         Lines beginning with "#" or ";" are ignored and may be used to provide comments.</para>
74     
75   </refsect1>
76   <refsect1>
77     <title>VARIABLES</title>
78       <para>There are 2 required sections in the config file. The first is the DEFAULT section, providing
79         variables for the configuration of the main application. The second is the section that provides
80         variables for the configuration of the DHT.</para>
81         
82       <refsect2>
83         <title>DEFAULT</title>
84
85         <variablelist>
86           <varlistentry>
87             <term><option>PORT = <replaceable>number</replaceable></option></term>
88              <listitem>
89               <para>The <replaceable>number</replaceable> of the port to listen on for requests.
90                   The main application will use this TCP port to listen for requests from APT, and
91                   for uploads to other peers. If a port is not specified for the DHT, it will also
92                   use this UDP port to listen for DHT requests.
93                   (Default is 9977.)</para>
94             </listitem>
95           </varlistentry>
96           <varlistentry>
97             <term><option>UPLOAD_LIMIT = <replaceable>speed</replaceable></option></term>
98              <listitem>
99               <para>The <replaceable>speed</replaceable> to limit sending data to peers to, in KBytes/sec.
100                 Set this to 0 to not limit the upload bandwidth.
101                 (Default is 0)</para>
102             </listitem>
103           </varlistentry>
104           <varlistentry>
105             <term><option>CACHE_DIR = <replaceable>directory</replaceable></option></term>
106              <listitem>
107               <para>The <replaceable>directory</replaceable> to store the downloaded files in.
108                 (Default is ${HOME}/.apt-p2p/cache.)</para>
109             </listitem>
110           </varlistentry>
111           <varlistentry>
112             <term><option>OTHER_DIRS = <replaceable>list</replaceable></option></term>
113              <listitem>
114               <para>The <replaceable>list</replaceable> of directories containing packages to share with others.
115                 All files in these directories will be hashed and available for everybody to download.
116                 (Default is to share only the files downloaded.)</para>
117             </listitem>
118           </varlistentry>
119           <varlistentry>
120             <term><option>LOCAL_OK = <replaceable>boolean</replaceable></option></term>
121              <listitem>
122               <para>Whether it's OK to use an IP addres from a known local or private range.
123                 (Default is false)</para>
124             </listitem>
125           </varlistentry>
126           <varlistentry>
127             <term><option>UNLOAD_PACKAGES_CACHE = <replaceable>time</replaceable></option></term>
128              <listitem>
129               <para>The <replaceable>time</replaceable> of inactivity to wait for before unloading the
130                   packages cache. The packages cache uses a lot of memory, and only takes a few seconds
131                   to reload when a new request arrives. (Default is 5 minutes.)</para>
132             </listitem>
133           </varlistentry>
134           <varlistentry>
135             <term><option>KEY_REFRESH = <replaceable>time</replaceable></option></term>
136              <listitem>
137               <para>The <replaceable>time</replaceable> after which to refresh DHT keys.
138                   This should be a time slightly less than the DHT's KEY_EXPIRE value.
139                   (Default is 57 minutes.)</para>
140             </listitem>
141           </varlistentry>
142           <varlistentry>
143             <term><option>DHT = <replaceable>string</replaceable></option></term>
144              <listitem>
145               <para>The DHT implementation to use. It must be possile to do (in python)
146                 ``from &lt;DHT&gt;.DHT import DHT'' to get a class that implements the IDHT interface.
147                 There should also be a similarly named section below to specify the options for the DHT.
148                 (Default is `apt_p2p_Khashmir')</para>
149             </listitem>
150           </varlistentry>
151           <varlistentry>
152             <term><option>DHT-ONLY = <replaceable>boolean</replaceable></option></term>
153              <listitem>
154               <para>Whether to only run the DHT. This can be useful for providing only a bootstrap node.
155                 (Default is false)</para>
156             </listitem>
157           </varlistentry>
158         </variablelist>
159       </refsect2>
160       <refsect2>
161         <title>apt_p2p_Khashmir</title>
162
163         <variablelist>
164           <varlistentry>
165             <term><option>PORT = <replaceable>number</replaceable></option></term>
166              <listitem>
167               <para>The <replaceable>number</replaceable> of the port to listen on for DHT (UDP) requests.
168                   (Default is to use the value specified in the DEFAULT section.)</para>
169             </listitem>
170           </varlistentry>
171           <varlistentry>
172             <term><option>BOOTSTRAP = <replaceable>list</replaceable></option></term>
173              <listitem>
174               <para>The <replaceable>list</replaceable> of bootstrap nodes to contact to join the DHT.
175                 Each node should be on a separate line, and start with the IP address or host name,
176                 followed by a colon and the port number.
177                 (Default is a list of known good nodes.)</para>
178             </listitem>
179           </varlistentry>
180           <varlistentry>
181             <term><option>BOOTSTRAP_NODE = <replaceable>boolean</replaceable></option></term>
182              <listitem>
183               <para>Whether this node is a bootstrap node.
184                 (Default is false)</para>
185             </listitem>
186           </varlistentry>
187           <varlistentry>
188             <term><option>K = <replaceable>number</replaceable></option></term>
189              <listitem>
190               <para>The <replaceable>number</replaceable> of the Kademlia "K" constant.
191                   It should be an even number.
192                   (Default is 8.)</para>
193             </listitem>
194           </varlistentry>
195           <varlistentry>
196             <term><option>HASH_LENGTH = <replaceable>number</replaceable></option></term>
197              <listitem>
198               <para>The <replaceable>number</replaceable> of bits in the hash to use.
199                   (Default is 160.)</para>
200             </listitem>
201           </varlistentry>
202           <varlistentry>
203             <term><option>CHECKPOINT_INTERVAL = <replaceable>time</replaceable></option></term>
204              <listitem>
205               <para>The <replaceable>time</replaceable> to wait between saves of the running state.
206                   (Default is 5 minutes.)</para>
207             </listitem>
208           </varlistentry>
209           <varlistentry>
210             <term><option>CONCURRENT_REQS = <replaceable>number</replaceable></option></term>
211              <listitem>
212               <para>The concurrent <replaceable>number</replaceable> of calls per find node/value request.
213                   (Default is 4.)</para>
214             </listitem>
215           </varlistentry>
216           <varlistentry>
217             <term><option>STORE_REDUNDANCY = <replaceable>number</replaceable></option></term>
218              <listitem>
219               <para>The <replaceable>number</replaceable> of redundant copies of a value to store in the DHT.
220                   (Default is 3.)</para>
221             </listitem>
222           </varlistentry>
223           <varlistentry>
224             <term><option>RETRIEVE_VALUES = <replaceable>number</replaceable></option></term>
225              <listitem>
226               <para>The <replaceable>number</replaceable> of values to attempt to retrieve from the DHT.
227                   Setting this to 0 will try and get all values (which could take a while if
228                   a lot of nodes have values). Setting it negative will try to get that
229                   number of results from only the closest STORE_REDUNDANCY nodes to the hash.
230                   (Default is -10000, which is a large negative number so all values from the closest
231                   STORE_REDUNDANCY nodes will be retrieved.)</para>
232             </listitem>
233           </varlistentry>
234           <varlistentry>
235             <term><option>MAX_FAILURES = <replaceable>number</replaceable></option></term>
236              <listitem>
237               <para>The <replaceable>number</replaceable> of times in a row a node can fail to
238                   respond before it's booted from the routing table.
239                   (Default is 3.)</para>
240             </listitem>
241           </varlistentry>
242           <varlistentry>
243             <term><option>MIN_PING_INTERVAL = <replaceable>time</replaceable></option></term>
244              <listitem>
245               <para>The minimum <replaceable>time</replaceable> to wait before re-pinging a node.
246                   (Default is 15 minutes.)</para>
247             </listitem>
248           </varlistentry>
249           <varlistentry>
250             <term><option>BUCKET_STALENESS = <replaceable>time</replaceable></option></term>
251              <listitem>
252               <para>The maximum <replaceable>time</replaceable> to wait before refreshing a bucket.
253                   (Default is 1 hour.)</para>
254             </listitem>
255           </varlistentry>
256           <varlistentry>
257             <term><option>KEY_EXPIRE = <replaceable>time</replaceable></option></term>
258              <listitem>
259               <para>The <replaceable>time</replaceable> to wait before expiring unrefreshed keys.
260                   (Default is 1 hour.)</para>
261             </listitem>
262           </varlistentry>
263           <varlistentry>
264             <term><option>SPEW = <replaceable>boolean</replaceable></option></term>
265              <listitem>
266               <para>Whether to log lots of info about the requests and responses in the protocol.
267                 (Default is false)</para>
268             </listitem>
269           </varlistentry>
270         </variablelist>
271      </refsect2>
272   </refsect1>
273
274   <refsect1>
275     <title>SEE ALSO</title>
276
277     <para>
278       <citerefentry><refentrytitle>apt-p2p</refentrytitle><manvolnum>8</manvolnum></citerefentry>
279     </para>
280   </refsect1>
281   <refsect1>
282     <title>AUTHOR</title>
283     <para>This manual page was written by &dhusername; &lt;&dhemail;> for
284       the &debian; system (but may be used by others).  Permission is
285       granted to copy, distribute and/or modify this document under
286       the terms of the &gnu; General Public License, Version 2 or any
287       later version published by the Free Software Foundation.
288     </para>
289     <para>
290       On Debian systems, the complete text of the GNU General Public
291       License can be found in /usr/share/common-licenses/GPL.
292     </para>
293   </refsect1>
294 </refentry>
295
296 <!-- Keep this comment at the end of the file
297 Local variables:
298 mode: sgml
299 sgml-omittag:t
300 sgml-shorttag:t
301 sgml-minimize-attributes:nil
302 sgml-always-quote-attributes:t
303 sgml-indent-step:2
304 sgml-indent-data:t
305 sgml-parent-document:nil
306 sgml-default-dtd-file:nil
307 sgml-exposed-tags:nil
308 sgml-local-catalogs:nil
309 sgml-local-ecat-files:nil
310 End:
311 -->