]> Cypherpunks.ru repositories - nncp.git/blob - doc/cfg/neigh.texi
Merge branch 'develop'
[nncp.git] / doc / cfg / neigh.texi
1 @node CfgNeigh
2 @cindex neighbour configuration options
3 @section Configuration neighbour options
4
5 @vindex neigh
6 @strong{neigh} section contains all known neighbours information. It
7 always has @strong{self} neighbour that is copy of our node's public
8 data (public keys). It is useful for copy-paste sharing with your
9 friends. Each section's key is a human-readable name of the neighbour.
10
11 @verbatim
12 neigh: {
13   self: {
14     id: RKOLY...KAMXQ
15     exchpub: 2NZKH...CMI7A
16     signpub: EXD7M...YAOFA
17     noisepub: MIXYN...BGNDQ
18     exec: {sendmail: ["/usr/sbin/sendmail"]}
19   }
20   alice: {
21     id: "XJZBK...65IJQ"
22     exchpub: MJACJ...FAI6A
23     signpub: T4AFC...N2FRQ
24     noisepub: UBM5K...VI42A
25     exec: {flag: ["/usr/bin/touch", "-t"]}
26     incoming: "/home/alice/incoming"
27     onlinedeadline: 1800
28     maxonlinetime: 3600
29     addrs: {
30       lan: "[fe80::1234%igb0]:5400"
31       internet: alice.com:3389
32       proxied: "|ssh remote.host nncp-daemon -ucspi"
33     }
34     calls: [
35       {
36         cron: "*/2 * * * *"
37       }
38     ]
39   }
40   bob: {
41     id: 2IZNP...UYGYA
42     exchpub: WFLMZ...B7NHA
43     signpub: GTGXG...IE3OA
44     exec: {
45       sendmail: ["/usr/sbin/sendmail"]
46       warcer: ["/path/to/warcer.sh"]
47       wgeter: ["/path/to/wgeter.sh"]
48     }
49     freq: {
50       path: "/home/bob/pub"
51       chunked: 1024
52       minsize: 2048
53     }
54     ack: {
55       nice: FLASH
56       minsize: 2048
57     }
58     via: ["alice"]
59     rxrate: 10
60     txrate: 20
61   }
62 }
63 @end verbatim
64
65 Except for @code{id}, @code{exchpub} and @code{signpub} each neighbour
66 node has the following fields:
67
68 @table @code
69
70 @item noisepub
71     If present, then node can be online called using @ref{Sync,
72     synchronization protocol}. Contains authentication public key.
73
74 @vindex exec
75 @pindex sendmail
76 @anchor{CfgExec}
77 @item exec
78     Dictionary consisting of handles and corresponding command line
79     arguments. In example above there are @command{sendmail} handles,
80     @command{warcer}, @command{wgeter} and @command{flag} one. Remote
81     node can queue some handle execution with providing additional
82     command line arguments and the body fed to command's @code{stdin}.
83
84     @verb{|sendmail: ["/usr/sbin/sendmail", "-t"]|} handle, when called by
85     @verb{|echo hello world | nncp-exec self sendmail ARG0 ARG1 ARG2|}
86     command, will execute:
87
88 @example
89 NNCP_SELF=OURNODE \
90 NNCP_SENDER=REMOTE \
91 NNCP_NICE=64 \
92 /usr/sbin/sendmail -t ARG0 ARG1 ARG2
93 @end example
94
95     feeding @verb{|hello world\n|} to that started @command{sendmail}
96     process.
97
98 @vindex incoming
99 @anchor{CfgIncoming}
100 @item incoming
101     Full path to directory where all file uploads will be saved. May be
102     omitted to forbid file uploading on that node.
103
104 @vindex freq
105 @anchor{CfgFreq}
106 @item freq
107     @table @code
108     @item path
109         Full path to directory from where file requests will queue files
110         for transmission. May be omitted to forbid freqing from that node.
111
112     @item chunked
113         If set, then enable @ref{Chunked, chunked} file transmission
114         during freqing. This is the desired chunk size in KiBs.
115
116     @item minsize
117         If set, then apply @ref{OptMinSize, -minsize} option during file
118         transmission.
119     @end table
120
121 @vindex ack
122 @anchor{CfgACK}
123 @item ack
124     Options applied to automatically generated @ref{ACK} packets during tossing.
125
126     @table @code
127     @item nice
128         Use that @ref{Niceness, niceness} for generated packets (255 is used
129         otherwise).
130
131     @item minsize
132         If set, then apply @ref{OptMinSize, -minsize} option during file
133         transmission.
134     @end table
135
136 @vindex via
137 @anchor{CfgVia}
138 @item via
139     An array of node identifiers that will be used as a relay to that
140     node. For example @verb{|["foo","bar"]|} means that packet can reach
141     current node by transitioning through @code{foo} and then @code{bar}
142     nodes. May be omitted if direct connection exists and no relaying is
143     required.
144
145 @vindex addrs
146 @anchor{CfgAddrs}
147 @item addrs
148     Dictionary containing known network addresses of the node. Each key
149     is human-readable name of the address. For direct TCP connections
150     use @verb{|host:port|} format, pointing to @command{@ref{nncp-daemon}}'s
151     listening instance.
152
153     Also you can pipe connection through the external command using
154     @verb{#|some command#} format. @code{/bin/sh -c "some command"} will
155     start and its @code{stdin}/@code{stdout} used as a connection.
156
157     To use @ref{Yggdrasil} network for connectivity, use
158     @code{yggdrasil:PUB;PRV;PEER[,@dots{}]} format, read about
159     @ref{CfgYggdrasilAliases, possible aliases} usage.
160
161     May be omitted if either no direct connection exists, or
162     @command{@ref{nncp-call}} is used with forced address specifying.
163
164 @vindex rxrate
165 @vindex txrate
166 @anchor{CfgXxRate}
167 @item rxrate/txrate
168     If greater than zero, then at most *rate packets per second will be
169     sent/received after the handshake. It could be used as crude
170     bandwidth traffic shaper: each packet has at most 64 KiB payload
171     size. If omitted -- no rate limits.
172
173 @vindex onlinedeadline
174 @anchor{CfgOnlineDeadline}
175 @item onlinedeadline
176     Online connection deadline of nodes inactivity in seconds. It is the
177     time connection considered dead after not receiving/sending any
178     packets (except for PINGs) and connection must be terminated. By
179     default it is set to 10 seconds. This can be set to rather high
180     values to keep connection alive (to reduce handshake overhead and
181     delays), wait for appearing packets ready to send and notifying
182     remote side about their appearance.
183
184 @vindex maxonlinetime
185 @anchor{CfgMaxOnlineTime}
186 @item maxonlinetime
187     If greater than zero, then it is maximal time of single connection.
188     Forcefully disconnect if it is exceeded.
189
190 @anchor{CfgCalls}
191 @item calls
192     List of @ref{Call, call configuration}s.
193     Can be omitted if @command{@ref{nncp-caller}} won't be used to call that node.
194
195 @end table