]> Sergey Matveev's repositories - public-inbox.git/commitdiff
www: give tor2web some exposure, too
authorEric Wong <e@80x24.org>
Tue, 23 Aug 2016 21:23:53 +0000 (21:23 +0000)
committerEric Wong <e@80x24.org>
Tue, 23 Aug 2016 21:31:12 +0000 (21:31 +0000)
Not everybody can run Tor, hopefully more can use Tor2web
even if it compromises their privacy.  This should help
make system more resilient for users unable to use Tor.

lib/PublicInbox/WwwStream.pm

index c89e6de41822a7571c06864074ff984bcf6a7151..dfbcf4105a14ae74d97181183f547c01aef9318a 100644 (file)
@@ -8,6 +8,7 @@ use warnings;
 use PublicInbox::Hval qw(ascii_html);
 use URI;
 our $TOR_URL = 'https://www.torproject.org/';
+our $TOR2WEB_URL = 'https://www.tor2web.org/';
 our $CODE_URL = 'https://public-inbox.org/';
 our $PROJECT = 'public-inbox';
 
@@ -96,6 +97,10 @@ sub _html_end {
        if ($urls =~ m!\b[^:]+://\w+\.onion/!) {
                $urls .= "\n note: .onion URLs require Tor: ";
                $urls .= qq[<a\nhref="$TOR_URL">$TOR_URL</a>];
+               if ($TOR2WEB_URL) {
+                       $urls .= "\n       or Tor2web: ";
+                       $urls .= qq[<a\nhref="$TOR2WEB_URL">$TOR2WEB_URL</a>];
+               }
        }
        my $url = PublicInbox::Hval::prurl($ctx->{env}, $CODE_URL);
        '<hr><pre>'.join("\n\n",