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