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