-# Copyright (C) 2020 all contributors <meta@public-inbox.org>
+# Copyright (C) 2020-2021 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
# generates manifest.js.gz for grokmirror(1)
use IO::Compress::Gzip qw(gzip);
use HTTP::Date qw(time2str);
-our $json = PublicInbox::Config::json();
+my $json = PublicInbox::Config::json();
# called by WwwListing
sub url_regexp {
my ($ctx, $ALL, $ibx) = @_;
if (my $data = $ALL->misc->inbox_data($ibx)) {
$data = $json->decode($data);
+ delete $data->{''}; # private
while (my ($url_path, $ent) = each %$data) {
inject_entry($ctx, $url_path, $ent);
}
sub ibx_entry {
my ($ctx, $ibx) = @_;
- my $ALL = $ctx->{www}->{pi_config}->ALL;
+ my $ALL = $ctx->{www}->{pi_cfg}->ALL;
if ($ALL) {
eidx_manifest_add($ctx, $ALL, $ibx);
} else {
'Content-Length', bytes::length($out) ], [ $out ] ]
}
+sub per_inbox {
+ my ($ctx) = @_;
+ # only one inbox, slow is probably OK
+ slow_manifest_add($ctx, $ctx->{ibx});
+ psgi_triple($ctx);
+}
+
1;