}
$txt = '<pre>' . $l->linkify_2($txt) . '</pre>';
$txt =~ s!\bPOP3\b!<a\nid=pop3>POP3</a>!;
- $txt =~ s!\bNewsgroups\b!<a\nid=nntp>Newsgroups</a>!;
+ $txt =~ s!\b(Newsgroups?)\b!<a\nid=nntp>$1</a>!;
$txt =~ s!\bIMAP\b!<a\nid=imap>IMAP</a>!;
- PublicInbox::WwwStream::html_oneshot($ctx, $code, \$txt);
+ PublicInbox::WwwStream::html_oneshot($ctx, $code, $txt);
}
sub _srch_prefix ($$) {
my ($ctx, $top_url) = @_;
my $cr = $ctx->{ibx}->{coderepo} // return ();
my $cfg = $ctx->{www}->{pi_cfg};
- my @ret;
+ my @ret = ('Code repositories for project(s) associated with this '.
+ $ctx->{ibx}->thing_type . "\n");
for my $cr_name (@$cr) {
- $ret[0] //= do {
- my $thing = $ctx->{ibx}->can('cloneurl') ?
- 'public inbox' : 'external index';
- <<EOF;
-Code repositories for project(s) associated with this $thing
-EOF
- };
my $urls = $cfg->get_all("coderepo.$cr_name.cgiturl");
if ($urls) {
for (@$urls) {
- # relative or absolute URL?, prefix relative
- # "foo.git" with appropriate number of "../"
my $u = m!\A(?:[a-z\+]+:)?//!i ? $_ :
$top_url.$_;
$ret[0] .= "\n\t" . prurl($ctx->{env}, $u);
$ctx->{ibx}->can('nntp_url') or return; # TODO extindex can have IMAP
my $urls = $ctx->{ibx}->imap_url($ctx);
if (@$urls) {
- $$txt .= "\nIMAP subfolder(s) are available under:";
- $$txt .= "\n " . join("\n ", @$urls);
+ $urls = join("\n ", @$urls);
+ $urls =~ s!://([^/@]+)/!://;AUTH=ANONYMOUS\@$1/!sg;
$$txt .= <<EOM
+IMAP subfolder(s) are available under:
+ $urls
# each subfolder (starting with `0') holds 50K messages at most
EOM
}
POP3 access is available:
$urls
-The password is: anonymous
-The username is: \$(uuidgen)\@$ctx->{ibx}->{newsgroup}
+The POP3 password is: anonymous
+The POP3 username is: \$(uuidgen)\@$ctx->{ibx}->{newsgroup}
where \$(uuidgen) in the output of the `uuidgen' command on your system.
The UUID in the username functions as a private cookie (don't share it).
Idle accounts will expire periodically.