]> Sergey Matveev's repositories - public-inbox.git/blob - Documentation/public-inbox-config.pod
doc: extindex: document current behavior + knobs
[public-inbox.git] / Documentation / public-inbox-config.pod
1 =head1 NAME
2
3 public-inbox-config - public-inbox config file description
4
5 =head1 SYNOPSIS
6
7 ~/.public-inbox/config
8
9 =head1 DESCRIPTION
10
11 The public-inbox config file is parseable by L<git-config(1)>.
12 This is a global configuration file for mapping/discovering
13 all public-inboxes used by a particular user.
14
15 =head1 CONFIGURATION FILE
16
17 =head2 EXAMPLE
18
19         [publicinbox "test"]
20                 inboxdir = /home/user/path/to/test.git
21                 ; multiple addresses are supported
22                 address = test@example.com
23                 ; address = alternate@example.com
24                 url = http://example.com/test
25                 newsgroup = inbox.test
26
27                 ; backwards compatibility with public-inbox pre-1.2.0,
28                 ; "inboxdir" takes precedence over "mainrepo"
29                 mainrepo = /home/user/path/to/test.git
30
31 =head2 VARIABLES
32
33 =over 8
34
35 =item publicinbox.<name>.address
36
37 The email address of the public-inbox.  May be specified
38 more than once for merging multiple mailing lists (or migrating
39 to new addresses).  This must be specified at least once,
40 the first value will be considered the primary address for
41 informational purposes.
42
43 Default: none, required
44
45 =item publicinbox.<name>.inboxdir
46
47 The absolute path to the directory which hosts the
48 public-inbox.  This must be specified once.
49
50 This was previously known as "mainrepo", which remains supported,
51 but "inboxdir" takes precedence.
52
53 Default: none, required
54
55 =item publicinbox.<name>.url
56
57 The primary URL for hosting the HTTP/HTTPS archives.
58 Additional HTTP/HTTPS URLs may be specified via
59 C<$GIT_DIR/cloneurl> as documented in L<gitweb(1)>
60
61 Default: none, optional
62
63 =item publicinbox.<name>.newsgroup
64
65 The NNTP group name for use with L<public-inbox-nntpd(1)>.  This
66 may be any newsgroup name with hierarchies delimited by C<.>.
67 For example, the newsgroup for L<mailto:meta@public-inbox.org>
68 is: C<inbox.comp.mail.public-inbox.meta>
69
70 It also configures the folder hierarchy used by L<public-inbox-imapd(1)>.
71
72 Omitting this for a given inbox will prevent the inbox from
73 being served by L<public-inbox-nntpd(1)> and/or L<public-inbox-imapd(1)>.
74
75 Default: none, optional
76
77 =item publicinbox.<name>.watch
78
79 See L<public-inbox-watch(1)>
80
81 =item publicinbox.<name>.watchheader
82
83 See L<public-inbox-watch(1)>
84
85 =item publicinbox.<name>.listid
86
87 The L<rfc2919|https://tools.ietf.org/html/rfc2919> header without
88 angle brackets for L<public-inbox-mda(1)> deliveries and
89 L<public-inbox-watch(1)>.
90
91 For public-inbox-watch users, this is a shortcut for specifying
92 C<publicinbox.$NAME.watchheader=List-Id:E<lt>foo.example.comE<gt>>
93
94 For public-inbox-mda users, this may be used to avoid recipient
95 matching via C<ORIGINAL_RECIPIENT> environment variable.
96
97 This may be specified multiple times for merging multiple mailing
98 lists into a single public-inbox, only one C<List-Id> header
99 needs to match.
100
101 Default: none
102
103 =item publicinbox.<name>.imapmirror
104
105 This may be the full IMAP URL of an independently-run IMAP mirror.
106
107 Default: none
108
109 =item publicinbox.<name>.nntpmirror
110
111 This may be the full NNTP URL of an independently-run mirror.
112 For example, the https://public-inbox.org/meta/ inbox is
113 mirrored by Gmane at
114 C<nntp://news.gmane.io/gmane.mail.public-inbox.general>
115
116 Default: none
117
118 =item publicinbox.<name>.indexlevel
119
120 The indexing level for L<public-inbox-index(1)>
121
122 C<basic> only requires L<DBD::SQLite(3pm)> and provides all
123 NNTP functionality along with thread-awareness in the WWW
124 interface.
125
126 C<medium> requires L<Search::Xapian(3pm)> to provide full-text
127 term search functionality in the WWW UI.
128
129 C<full> also includes positional information used by Xapian to
130 allow for searching for phrases using quoted text.
131 (e.g. C<"looking for a complete sentence">)
132
133 Default: C<full>
134
135 =item publicinbox.<name>.boost
136
137 Control indexing order for L<public-inbox-extindex(1)>, with ties
138 broken by config file order.  This only affects indexing and does
139 not affect messages which are already indexed.
140
141 Default: C<0>
142
143 =item publicinbox.<name>.indexSequentialShard
144
145 See L<public-inbox-index(1)/publicInbox.indexSequentialShard>
146
147 =item publicinbox.<name>.httpbackendmax
148
149 If a digit, the maximum number of parallel
150 L<git-http-backend(1)> processes to allow for cloning this
151 particular inbox.
152
153 If an alphanumeric value starting with a lowercase alphabetic
154 character is specified, the inbox will use a L</NAMED LIMITER>
155 which can be shared by multiple inboxes.
156
157 Default: 32 (using a default limiter shared by all inboxes)
158
159 =item publicinbox.<name>.coderepo
160
161 The nickname of a "coderepo" section associated with the inbox.
162 May be specified more than once for M:N mapping of code repos to
163 inboxes.  If enabled, diff hunk headers in patch emails will
164 link to the line numbers of blobs.
165
166 Default: none
167
168 =item publicinbox.<name>.replyto
169
170 May be used to control how reply instructions in the PSGI
171 interface are displayed.
172
173 ":none=dead inbox" may be specified to denote an inactive list
174 ("dead inbox" may be replaced with another phrase).
175
176 A list of comma-delimited email addresses may be specified.
177 This can be useful for dedicated inboxes for bot emails, but
178 discussion happens on a separate mailing list/inbox.
179
180 Mirrors of existing centralized mailing lists may use ":list"
181 here to redirect mail only to the configured inbox address.
182 The use of ":list" is discouraged for new mailing lists, as it
183 leads to centralization.
184
185 Default: :all
186
187 =item publicinbox.css
188
189 The local path name of a CSS file for the PSGI web interface.
190 May contain the attributes "media", "title" and "href" which match
191 the associated attributes of the HTML <style> tag.
192 "href" may be specified to point to the URL of an remote CSS file
193 and the path may be "/dev/null" or any empty file.
194 Multiple files may be specified and will be included in the
195 order specified.
196
197 =item publicinboxmda.spamcheck
198
199 This may be set to C<none> to disable the use of SpamAssassin
200 L<spamc(1)> for filtering spam before it is imported into git
201 history.  Other spam filtering backends may be supported in
202 the future.
203
204 Default: spamc
205
206 =item publicinboxwatch.spamcheck
207
208 See L<public-inbox-watch(1)>
209
210 =item publicinboxwatch.watchspam
211
212 See L<public-inbox-watch(1)>
213
214 =item publicinbox.imapserver
215
216 Set this to point to the hostname(s) of the L<public-inbox-imapd(1)>
217 instance.  This is used to advertise the existence of the IMAP
218 endpoint in the L<PublicInbox::WWW> HTML interface.
219
220 Default: none
221
222 =item publicinbox.nntpserver
223
224 Same as C<publicinbox.imapserver>, but for the hostname(s) of the
225 L<public-inbox-nntpd(1)> instance.
226
227 Default: none
228
229 =item publicinbox.<name>.feedmax
230
231 The size of an Atom feed for the inbox.  If specified more than
232 once, only the last value is used.  Invalid values (<= 0) will
233 be treated as the default value.
234
235 Default: 25
236
237 =item publicinbox.<name>.hide
238
239 A comma-delimited list of listings to hide the inbox from.
240
241 Valid values are currently C<www> and C<manifest>.
242
243 Default: none
244
245 =item coderepo.<nick>.dir
246
247 The path to a git repository for "publicinbox.<name>.coderepo"
248
249 =item coderepo.<nick>.cgitUrl
250
251 The URL of the cgit instance associated with the coderepo.
252
253 Default: none
254
255 =item publicinbox.cgitrc
256
257 A path to a L<cgitrc(5)> file.  "repo.url" directives in the cgitrc
258 will be mapped to the nickname of a coderepo (without trailing slash),
259 and "repo.path" directives map to "coderepo.<nick>.dir".
260 Use of this directive allows admins of existing cgit installations
261 to skip declaring coderepo sections and map inboxes directly to
262 code repositories known to cgit.
263
264 Macro expansion (e.g. C<$HTTP_HOST>) is not yet supported.
265
266 =item publicinbox.cgitbin
267
268 A path to the C<cgit.cgi> executable.  The L<PublicInbox::WWW>
269 interface can spawn cgit as a fallback if the publicinbox.cgitrc
270 directive is configured.
271
272 Default: /var/www/htdocs/cgit/cgit.cgi or /usr/lib/cgit/cgit.cgi
273
274 =item publicinbox.cgitdata
275
276 A path to the data directory used by cgit for storing static files.
277 Typically guessed based the location of C<cgit.cgi> (from
278 C<publicinbox.cgitbin>, but may be overridden.
279
280 Default: basename of C<publicinbox.cgitbin>, /var/www/htdocs/cgit/
281 or /usr/share/cgit/
282
283 =item publicinbox.mailEditor
284
285 See L<public-inbox-edit(1)>
286
287 =item publicinbox.indexMaxSize
288 =item publicinbox.indexBatchSize
289 =item publicinbox.indexSequentialShard
290
291 See L<public-inbox-index(1)>
292
293 =item publicinbox.wwwlisting
294
295 Enable a HTML listing style when the root path of the URL '/' is accessed.
296 Valid values are:
297
298 =over 8
299
300 =item * all
301 - Show all inboxes
302
303 =item * 404
304 - Return a 404 page.  This is useful to allow customization with
305 L<Plack::App::Cascade(3pm)>
306
307 =item * match=domain
308 - Only show inboxes with URLs which belong to the domain of the HTTP request
309
310 =for comment
311 TODO support showing cgit listing
312
313 =back
314
315 Default: C<404>
316
317 =item publicinbox.grokmanifest
318
319 Controls the generation of a grokmirror-compatible gzipped JSON file
320 at the top-level of the PSGI interface.  You generally do not need to
321 change this from the default.
322
323 Valid values are:
324
325 =over 8
326
327 =item * match=domain
328 - Only include inboxes with URLs which belong to the domain of
329 the HTTP request.  This is compatible with virtual hosting where
330 several domains come from the same host.
331
332 =item * all
333 - All inboxes are present in C<manifest.js.gz>, regardless of domain.
334 Only use this if you're serving HTTP requests in a domain-agnostic manner.
335
336 =item * 404
337 - C<manifest.js.gz> will only contain an empty JSON array.
338 This does NOT affect C<$INBOX_URL/manifest.js.gz>, which will
339 always contain all git repos used by the inbox at C<$INBOX_URL>
340
341 =back
342
343 Default: C<match=domain>
344
345 =item publicinbox.<name>.obfuscate
346
347 Whether to obfuscate email addresses in the L<PublicInbox::WWW> HTML
348 interface.
349
350 Default: false
351
352 =item publicinbox.noObfuscate
353
354 A space-delimited list of well-known addresses and domains that should
355 not be obfuscated when C<publicinbox.$NAME.obfuscate> is true (e.g.,
356 C<public@example.com> and C<@example.com>).  This may be specified
357 more than once, in which case the values are merged.
358
359 Default: none
360
361 =item extindex.<name>.topdir
362
363 The directory of an external index.  See
364 L<public-inbox-extindex(1)> for more details.
365
366 =item extindex.<name>.url
367
368 Identical to L</publicinbox.E<lt>nameE<gt>.url>, but for
369 external indices
370
371 =item extindex.<name>.coderepo
372
373 Identical to L</publicinbox.E<lt>nameE<gt>.coderepo>, but for
374 external indices.  Code repos may be freely associated with
375 any number of public inboxes and external indices.
376
377 =back
378
379 =head2 NAMED LIMITER (PSGI)
380
381 Named limiters are useful for preventing large inboxes from
382 monopolizing (or overloading) the server.  Since serving git
383 clones (via L<git-http-backend(1)> can be memory-intensive for
384 large inboxes, it makes sense to put large inboxes on a named
385 limiter with a low max value; while smaller inboxes can use
386 the default limiter.
387
388 C<RLIMIT_*> keys may be set to enforce resource limits for
389 a particular limiter (L<BSD::Resource(3pm)> is required).
390
391 Default named-limiters are prefixed with "-".  Currently,
392 the "-cgit" named limiter is reserved for instances spawning
393 cgit via C<publicinbox.cgitrc>
394
395 =over 8
396
397 =item publicinboxlimiter.<name>.max
398
399 The maximum number of parallel processes for the given limiter.
400
401 =item publicinboxlimiter.<name>.rlimitCore
402
403 =item publicinboxlimiter.<name>.rlimitCPU
404
405 =item publicinboxlimiter.<name>.rlimitData
406
407 The maximum core size, CPU time, or data size processes run with the
408 given limiter will use.  This may be comma-separated to distinguish
409 soft and hard limits.  The word "INFINITY" is accepted as the
410 RLIM_INFINITY constant (if supported by your OS).
411
412 See L<setrlimit(2)> for more info on the behavior of RLIMIT_CORE,
413 RLIMIT_CPU, and RLIMIT_DATA for you operating system.
414
415 =back
416
417 =head3 EXAMPLE WITH NAMED LIMITERS
418
419         ; big inboxes which require lots of memory to clone:
420         [publicinbox "big1"]
421                 inboxdir = /path/to/big1
422                 address = big1@example.com
423                 httpbackendmax = big
424         [publicinbox "big2"]
425                 inboxdir = /path/to/big2
426                 address = big2@example.com
427                 httpbackendmax = big
428
429         ; tiny inboxes which are easily cloned:
430         [publicinbox "tiny1"]
431                 inboxdir = /path/to/tiny1
432                 address = tiny1@example.com
433         [publicinbox "tiny2"]
434                 inboxdir = /path/to/tiny2
435                 address = tiny2@example.com
436
437         [publicinboxlimiter "big"]
438                 max = 4
439
440 In the above example, the "big1" and "big2" are limited to four
441 parallel L<git-http-backend(1)> processes between them.
442
443 However, "tiny1" and "tiny2" will share the default limiter
444 which means there can be 32 L<git-http-backend(1)> processes
445 between them.
446
447 =head1 ENVIRONMENT
448
449 =over 8
450
451 =item PI_CONFIG
452
453 Used to override the default "~/.public-inbox/config" value.
454
455 =back
456
457 =head1 CONTACT
458
459 Feedback welcome via plain-text mail to L<mailto:meta@public-inbox.org>
460
461 The mail archives are hosted at L<https://public-inbox.org/meta/> and
462 L<http://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/meta/>
463
464 =head1 COPYRIGHT
465
466 Copyright 2016-2021 all contributors L<mailto:meta@public-inbox.org>
467
468 License: AGPL-3.0+ L<https://www.gnu.org/licenses/agpl-3.0.txt>
469
470 =head1 SEE ALSO
471
472 L<git(1)>, L<git-config(1)>, L<public-inbox-daemon(8)>,
473 L<public-inbox-mda(1)>, L<public-inbox-watch(1)>,
474 L<grokmirror|https://git.kernel.org/pub/scm/utils/grokmirror/grokmirror.git>