X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FWwwStream.pm;h=01f7b31ba186001723d21dcbe2d3291e5f4383bc;hb=21f5b7a8bcd942b19475c1c0c265f39dfdf93608;hp=9ed25e1d047f6fed024ba95ead017399bbc0b020;hpb=50c1b933afec4937ebc99e1d372cef2dc6b295c2;p=public-inbox.git diff --git a/lib/PublicInbox/WwwStream.pm b/lib/PublicInbox/WwwStream.pm index 9ed25e1d..01f7b31b 100644 --- a/lib/PublicInbox/WwwStream.pm +++ b/lib/PublicInbox/WwwStream.pm @@ -8,9 +8,11 @@ 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'; +# noop for HTTP.pm (and any other PSGI servers) sub close {} sub new { @@ -31,10 +33,12 @@ sub _html_top ($) { my $desc = ascii_html($obj->description); my $title = $ctx->{-title_html} || $desc; my $upfx = $ctx->{-upfx} || ''; + my $help = $upfx.'_/text/help'; my $atom = $ctx->{-atom} || $upfx.'new.atom'; my $tip = $ctx->{-html_tip} || ''; my $top = "$desc"; - my $links = "Atom feed"; + my $links = "help / ". + "Atom feed"; if ($obj->search) { my $q_val = $ctx->{-q_value_html}; if (defined $q_val && $q_val ne '') { @@ -94,24 +98,29 @@ sub _html_end { if ($urls =~ m!\b[^:]+://\w+\.onion/!) { $urls .= "\n note: .onion URLs require Tor: "; $urls .= qq[$TOR_URL]; + if ($TOR2WEB_URL) { + $urls .= "\n or Tor2web: "; + $urls .= qq[$TOR2WEB_URL]; + } } my $url = PublicInbox::Hval::prurl($ctx->{env}, $CODE_URL); '
'.join("\n\n",
 		$desc,
 		$urls,
-		'Code for this site: '.
+		'AGPL code for this site: '.
 		qq(git clone $url $PROJECT)
 	).'
'; } +# callback for HTTP.pm (and any other PSGI servers) sub getline { my ($self) = @_; my $nr = $self->{nr}++; return _html_top($self) if $nr == 0; - if (my $mid = $self->{cb}) { # middle - $mid = $mid->($nr, $self->{ctx}) and return $mid; + if (my $middle = $self->{cb}) { + $middle = $middle->($nr, $self->{ctx}) and return $middle; } delete $self->{cb} ? _html_end($self) : undef;