]> Sergey Matveev's repositories - public-inbox.git/commitdiff
Merge remote-tracking branch 'origin/wwwlisting'
authorEric Wong <e@80x24.org>
Sun, 5 May 2019 23:28:02 +0000 (23:28 +0000)
committerEric Wong <e@80x24.org>
Sun, 5 May 2019 23:28:02 +0000 (23:28 +0000)
* origin/wwwlisting:
  www: support listing of inboxes
  start depending on Perl 5.10.1+

1  2 
Documentation/public-inbox-config.pod
MANIFEST
lib/PublicInbox/WwwStream.pm

index 291502205e0618c974d2e04732a92d7b05fe27f0,17b8bac70987dab9ede2fef3e6d29bae4f2eb79d..d44c8f30777adb03c04f63e4fab121938a2da0d6
@@@ -188,6 -188,14 +188,14 @@@ be treated as the default value
  
  Default: 25
  
+ =item publicinbox.<name>.hide
+ A comma-delimited list of listings to hide the inbox from.
+ Valid values are currently "www".
+ Default: none
  =item coderepo.<nick>.dir
  
  The path to a git repository for "publicinbox.<name>.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<cgit.cgi> (from
 +C<publicinbox.cgitbin>, but may be overridden.
 +
 +Default: basename of C<publicinbox.cgitbin>, /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<Plack::App::Cascade(3pm)>
+ =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 ed8ff49140ce67d8251d53081e963786333e0835,881d2f07c5711859e20896ca3732e1ba47e6dfdb..4bdcda3cb8f535662729e4a4146907d7512515da
+++ 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
index ea7aaad0a76024ec7a04adb75a84c9b913d15810,c708c21f21741b43f04b51caab59e6d63f6cd966..2893138d563abafa4ffbf4a8bfe612e801413621
@@@ -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 ($) 
                "</head><body>". $top . $tip;
  }
  
+ sub code_footer ($) {
+       my ($env) = @_;
+       my $u = PublicInbox::Hval::prurl($env, $CODE_URL);
+       qq(AGPL code for this site: git clone <a\nhref="$u">$u</a> $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[<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",
                $desc,
                $urls,
-               'AGPL code for this site: '.
-               qq(git clone <a\nhref="$url">$url</a> $PROJECT)
+               code_footer($ctx->{env})
        ).'</pre></body></html>';
  }