lib/PublicInbox/WwwStream.pm | 14 +++++++++++--- diff --git a/lib/PublicInbox/WwwStream.pm b/lib/PublicInbox/WwwStream.pm index bdc8048d5ef1cc6050d6a4903b0f3b308bfd7101..de457b4814653fbef34ca737c48634ad417c16ad 100644 --- a/lib/PublicInbox/WwwStream.pm +++ b/lib/PublicInbox/WwwStream.pm @@ -8,6 +8,7 @@ use warnings; use PublicInbox::Hval qw(ascii_html); use URI; use constant PI_URL => 'https://public-inbox.org/'; +our $TOR_URL = 'https://www.torproject.org/'; sub close {} @@ -68,8 +69,10 @@ my $http = $obj->base_url($ctx->{env}); chop $http; my %seen = ( $http => 1 ); my @urls = ($http); + my $need_tor; foreach my $u (@{$obj->cloneurl}) { next if $seen{$u}; + $need_tor = 1 if $u =~ m!\A[^:]+://\w+\.onion/!; $seen{$u} = 1; push @urls, $u =~ /\Ahttps?:/ ? qq($u) : $u; } @@ -78,13 +81,18 @@ $urls .= " git clone --mirror $http"; } else { $urls .= "\n" . join("\n", map { "\tgit clone --mirror $_" } @urls); + } + + if ($need_tor) { + $urls .= "\n note: .onion URLs require Tor: "; + $urls .= qq[$TOR_URL]; } my $url = PublicInbox::Hval::prurl($ctx->{env}, PI_URL); - '
'.join("\n",
- '- ' . $desc,
+ '
'.join("\n\n",
+ $desc,
$urls,
'Served with public-inbox: '.
- qq(git clone $url public-inbox),
+ qq(git clone $url public-inbox)
).'