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