From: Eric Wong Date: Sun, 5 May 2019 23:28:02 +0000 (+0000) Subject: Merge remote-tracking branch 'origin/wwwlisting' X-Git-Tag: v1.2.0~301 X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=e1ed79d1e99e2c58b3edb370e60904cf656dd823;hp=-c Merge remote-tracking branch 'origin/wwwlisting' * origin/wwwlisting: www: support listing of inboxes start depending on Perl 5.10.1+ --- e1ed79d1e99e2c58b3edb370e60904cf656dd823 diff --combined Documentation/public-inbox-config.pod index 29150220,17b8bac7..d44c8f30 --- a/Documentation/public-inbox-config.pod +++ b/Documentation/public-inbox-config.pod @@@ -188,6 -188,14 +188,14 @@@ be treated as the default value Default: 25 + =item publicinbox..hide + + A comma-delimited list of listings to hide the inbox from. + + Valid values are currently "www". + + Default: none + =item coderepo..dir The path to a git repository for "publicinbox..coderepo" @@@ -217,15 -225,35 +225,44 @@@ directive is configured Default: /var/www/htdocs/cgit/cgit.cgi or /usr/lib/cgit/cgit.cgi +=item publicinbox.cgitdata + +A path to the data directory used by cgit for storing static files. +Typically guessed based the location of C (from +C, but may be overridden. + +Default: basename of C, /var/www/htdocs/cgit/ +or /usr/share/cgit/ + + =item publicinbox.wwwlisting + + Enable a HTML listing style when the root path of the URL '/' is accessed. + Valid values are: + + =over 8 + + =item all + + Show all inboxes + + =item 404 + + Return a 404 page. This is useful to allow customization with + L + + =item match=domain + + Only show inboxes with URLs which belong to the domain of the HTTP + request + + =for TODO comment + + support showing cgit listing + + =back + + Default: 404 + =back =head2 NAMED LIMITER (PSGI) diff --combined MANIFEST index ed8ff491,881d2f07..4bdcda3c --- a/MANIFEST +++ b/MANIFEST @@@ -19,7 -19,6 +19,7 @@@ Documentation/public-inbox-overview.po Documentation/public-inbox-v1-format.pod Documentation/public-inbox-v2-format.pod Documentation/public-inbox-watch.pod +Documentation/standards.perl Documentation/txt2pre HACKING INSTALL @@@ -39,7 -38,6 +39,7 @@@ examples/apache2_perl.con examples/apache2_perl_old.conf examples/cgi-webrick.rb examples/cgit-commit-filter.lua +examples/cgit-wwwhighlight-filter.lua examples/cgit.psgi examples/highlight.psgi examples/logrotate.conf @@@ -129,6 -127,7 +129,7 @@@ lib/PublicInbox/WatchMaildir.p lib/PublicInbox/WwwAtomStream.pm lib/PublicInbox/WwwAttach.pm lib/PublicInbox/WwwHighlight.pm + lib/PublicInbox/WwwListing.pm lib/PublicInbox/WwwStream.pm lib/PublicInbox/WwwText.pm sa_config/Makefile diff --combined lib/PublicInbox/WwwStream.pm index ea7aaad0,c708c21f..2893138d --- a/lib/PublicInbox/WwwStream.pm +++ b/lib/PublicInbox/WwwStream.pm @@@ -12,6 -12,7 +12,6 @@@ 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'; @@@ -70,6 -71,12 +70,12 @@@ sub _html_top ($) "". $top . $tip; } + sub code_footer ($) { + my ($env) = @_; + my $u = PublicInbox::Hval::prurl($env, $CODE_URL); + qq(AGPL code for this site: git clone $u $PROJECT) + } + sub _html_end { my ($self) = @_; my $urls = 'Archives are clonable:'; @@@ -133,13 -140,15 +139,11 @@@ EO 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,
- 		'AGPL code for this site: '.
- 		qq(git clone $url $PROJECT)
+ 		code_footer($ctx->{env})
  	).'
'; }