]> Cypherpunks.ru repositories - nncp.git/blob - doc/cfg.texi
3483f11c53fb1eec2b821cc98f3ec7146943136c
[nncp.git] / doc / cfg.texi
1 @node Configuration
2 @unnumbered Configuration file
3
4 Example YAML configuration file:
5
6 @verbatim
7 spool: /var/spool/nncp
8 log: /var/spool/nncp/log
9 notify:
10   file:
11     from: nncp@localhost
12     to: user+file@example.com
13   freq:
14     from: nncp@localhost
15     to: user+freq@example.com
16 self:
17   id: TIJQL...2NGIA
18   exchpub: CYVGQ...PSEWQ
19   exchprv: 65PUY...MPZ3Q
20   signpub: 2NMVC...CMH5Q
21   signprv: 555JD...RGD6Y
22   noiseprv: D62XU...NKYPA
23   noisepub: KIBKK...ESM7Q
24 neigh:
25   self:
26     id: TIJQL...2NGIA
27     exchpub: CYVGQ...PSEWQ
28     signpub: 2NMVC...CMH5Q
29     noisepub: KIBKK...ESM7Q
30     sendmail: [/usr/sbin/sendmail]
31   alice:
32     id: XJZBK...65IJQ
33     exchpub: MJACJ...FAI6A
34     signpub: T4AFC...N2FRQ
35     noisepub: UBM5K...VI42A
36     sendmail: ["/bin/sh", "-c", "false"]
37     incoming: /home/alice/incoming
38     onlinedeadline: 1800
39     maxonlinetime: 3600
40     addrs:
41       lan: "[fe80::1234%igb0]:5400"
42       internet: alice.com:3389
43     calls:
44       -
45         cron: "*/2 * * * *"
46   bob:
47     id: 2IZNP...UYGYA
48     exchpub: WFLMZ...B7NHA
49     signpub: GTGXG...IE3OA
50     sendmail: [/usr/sbin/sendmail]
51     freq: /home/bob/pub
52     freqchunked: 1024
53     freqminsize: 2048
54     via: [alice]
55 @end verbatim
56
57 @strong{spool} field contains an absolute path to @ref{Spool, spool}
58 directory. @strong{log} field contains an absolute path to @ref{Log,
59 log} file.
60
61 @anchor{CfgNotify}
62 @strong{notify} section contains notification settings for successfully
63 tossed file and freq packets. Corresponding @strong{from} and
64 @strong{to} fields will be substituted in notification email message.
65 @emph{neigh/self/sendmail} will be used as a local mailer. You can omit
66 either of those two @emph{from}/@emph{to} sections to omit corresponding
67 notifications, or the whole section at once.
68
69 @strong{self} section contains our node's private keypairs.
70 @strong{exch*} and @strong{sign*} are used during @ref{Encrypted,
71 encrypted} packet creation. @strong{noise*} are used during @ref{Sync,
72 synchronization protocol} working in @ref{nncp-call}/@ref{nncp-daemon}.
73
74 @strong{neigh} section contains all known neighbours information. It
75 always has @strong{self} neighbour that is copy of our node's public
76 data (public keys). It is useful for copy-paste sharing with your
77 friends. Each section's key is a human-readable name of the neighbour.
78
79 Except for @emph{id}, @emph{exchpub} and @emph{signpub} each neighbour
80 node has the following fields:
81
82 @table @strong
83
84 @item noisepub
85 If present, then node can be online called using @ref{Sync,
86 synchronization protocol}. Contains authentication public key.
87
88 @anchor{CfgSendmail}
89 @item sendmail
90 An array containing path to executable and its command line arguments
91 that is called for mail sending. If it is empty, then no mail processing
92 will be performed from that node. Sendmail command
93 @command{["/bin/foo", "bar"]} called the following way:
94 @command{NNCP_NICE=NICE NNCP_SENDER=NODEID /bin/foo bar RCPT1 RCPT2 ... < MSG}.
95
96 @anchor{CfgIncoming}
97 @item incoming
98 Full path to directory where all file uploads will be saved. May be
99 omitted to forbid file uploading on that node.
100
101 @anchor{CfgFreq}
102 @item freq
103 Full path to directory from where file requests will queue files for
104 transmission. May be omitted to forbid freqing from that node.
105
106 @item freqchunked
107 If set, then enable @ref{Chunked, chunked} file transmission during
108 freqing. This is the desired chunk size in KiBs.
109
110 @item freqminsize
111 If set, then apply @ref{OptMinSize, -minsize} option during file
112 transmission.
113
114 @anchor{CfgVia}
115 @item via
116 An array of node identifiers that will be used as a relay to that node.
117 For example @verb{|[foo,bar]|} means that packet can reach current node
118 by transitioning through @emph{foo} and then @emph{bar} nodes. May be
119 omitted if direct connection exists and no relaying is required.
120
121 @anchor{CfgAddrs}
122 @item addrs
123 Dictionary containing known network addresses of the node. Each key is
124 human-readable name of the link/address. Values are @verb{|addr:port|}
125 pairs pointing to @ref{nncp-daemon}'s listening instance. May be omitted
126 if either no direct connection exists, or @ref{nncp-call} is used with
127 forced address specifying.
128
129 @anchor{CfgOnlineDeadline}
130 @item onlinedeadline
131 Online connection deadline of node inactivity in seconds. It is the time
132 connection considered dead after not receiving/sending any packets and
133 node must disconnect. By default it is set to 10 seconds -- that means
134 disconnecting after 10 seconds when no packets received and transmitted.
135 This can be set to rather high values to keep connection alive (to
136 reduce handshake overhead and delays), wait for appearing packets ready
137 to send and notifying remote side about their appearance.
138
139 @anchor{CfgMaxOnlineTime}
140 @item maxonlinetime
141 If greater than zero, then it is maximal amount of time connect could be
142 alive. Forcefully disconnect if it is exceeded.
143
144 @anchor{CfgCalls}
145 @item calls
146 List of @ref{Call, call configuration}s. Can be omitted if
147 @ref{nncp-caller} won't be used to call that node.
148
149 @end table