# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
# used for displaying help texts and other non-mail content
package PublicInbox::WwwText;
use strict;
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
# used for displaying help texts and other non-mail content
package PublicInbox::WwwText;
use strict;
use PublicInbox::Linkify;
use PublicInbox::WwwStream;
use PublicInbox::Hval qw(ascii_html);
use PublicInbox::Linkify;
use PublicInbox::WwwStream;
use PublicInbox::Hval qw(ascii_html);
return [ $code, $hdr, [ $txt ] ]
}
# enforce trailing slash for "wget -r" compatibility
if (!$have_tslash && $code == 200) {
return [ $code, $hdr, [ $txt ] ]
}
# enforce trailing slash for "wget -r" compatibility
if (!$have_tslash && $code == 200) {
$url .= "_/text/$key/";
return [ 302, [ 'Content-Type', 'text/plain',
$url .= "_/text/$key/";
return [ 302, [ 'Content-Type', 'text/plain',
# n.b. this is a perfect candidate for memoization
sub inbox_config ($$$) {
my ($ctx, $hdr, $txt) = @_;
# n.b. this is a perfect candidate for memoization
sub inbox_config ($$$) {
my ($ctx, $hdr, $txt) = @_;
push @$hdr, 'Content-Disposition', 'inline; filename=inbox.config';
my $name = dq_escape($ibx->{name});
my $inboxdir = '/path/to/top-level-inbox';
push @$hdr, 'Content-Disposition', 'inline; filename=inbox.config';
my $name = dq_escape($ibx->{name});
my $inboxdir = '/path/to/top-level-inbox';
-; example public-inbox config snippet for "$name"
-; see public-inbox-config(5) manpage for more details:
+; Example public-inbox config snippet for a mirror of
+; $base_url
+; See public-inbox-config(5) manpage for more details:
- ; note: public-inbox before v1.2.0 used "mainrepo"
- ; instead of "inboxdir", both remain supported after 1.2
+ ; note: public-inbox before v1.2.0 used `mainrepo' instead of
+ ; `inboxdir', both remain supported after 1.2
; gzip(1), and sqlite3(1) as documented:
EOF
for (sort keys %$altid_map) {
; gzip(1), and sqlite3(1) as documented:
EOF
for (sort keys %$altid_map) {
; line number ranges in `[PATCH]' emails link to /$INBOX_NAME/$OID/s/,
; an HTTP endpoint which reconstructs git blobs via git-apply(1).
EOF
; line number ranges in `[PATCH]' emails link to /$INBOX_NAME/$OID/s/,
; an HTTP endpoint which reconstructs git blobs via git-apply(1).
EOF
if ($urls && scalar(@$urls)) {
$$txt .= "\t; ";
$$txt .= join(" ||\n\t;\t", map {;
if ($urls && scalar(@$urls)) {
$$txt .= "\t; ";
$$txt .= join(" ||\n\t;\t", map {;
return inbox_config($ctx, $hdr, $txt) if $key eq 'config';
return if $key ne 'help'; # TODO more keys?
return inbox_config($ctx, $hdr, $txt) if $key eq 'config';
return if $key ne 'help'; # TODO more keys?
# n.b. we use the Xapian DB for any regeneratable,
# order-of-arrival-independent data.
# n.b. we use the Xapian DB for any regeneratable,
# order-of-arrival-independent data.
This help text is maintained by public-inbox developers
reachable via plain-text email at: meta\@public-inbox.org
This help text is maintained by public-inbox developers
reachable via plain-text email at: meta\@public-inbox.org