about summary refs log tree commit homepage
path: root/t
DateCommit message (Collapse)
2019-04-19t/hl_mod: workaround w3m not handling '
This fixes a test failure on my Debian buster system. Bug report filed for w3m to handle "'": https://bugs.debian.org/927409 and for "highlight" to favor "'" in case other browsers fail: https://bugs.debian.org/927410
2019-04-18linkify: require parentheses pairs in URLs
Dangling parentheses with trailing punctuation usually means the parentheses is not intended as part of the URL.
2019-04-18linkify: don't get confused by URLs in Perl code, at least
The URLs at the top of WwwStream.pm weren't getting linkified correctly.
2019-04-18git: calculate modified time of repository
This will be used for generating an HTML listing for v1 inboxes, at least. The logic for this follows that of grokmirror, and we may dynamically generate manifest.js.gz natively...
2019-04-16cleanup: use '$ibx' consistently when referring to Inbox refs
'$inbox' is more human-readable, so that is for the more human-readable name in most cases. Making our variable naming more consistent should make the code easier-to-review and harder to screw up.
2019-04-04spawn: require soft and hard entries in RLIMIT_* handling
Our high-level config already treats single limits as a soft==hard limit for limiters; so stop handling that redundant in the low-level spawn() sub.
2019-04-04spawn: support RLIMIT_CPU, RLIMIT_DATA and RLIMIT_CORE
We'll be spawning cgit and git-diff, which can take gigantic amounts of CPU time and/or heap given the right (ermm... wrong) input. Limit the damage that large/expensive diffs can cause.
2019-04-04git: add "commit_title" method
This will be useful for extracting titles/subjects from commit objects when displaying commits.
2019-02-13ensure bytes::length is available to callers
We were relying on Danga::Socket using the "bytes" pragma, previously. Nowadays, the "bytes" pragma is not recommended in general, but bytes::length remains acceptable for getting the byte-size of a scalar.
2019-02-07t/perf-msgview.t: fix broken performance test
WwwStream started depending on the WWW::style method for configurable CSS, so mock ::style so the benchmark runs properly. Fixes: f026dbdd392c9dd5 ('www: admin-configurable CSS via "publicinbox.css"')
2019-02-07t/perf-msgview: don't warn about --unordered if skipping
No point in making noise about something that isn't used.
2019-02-05hlmod: support "```$LANG" blocks in text
This is compatible with Markdown; but we still keep the WYSIWYG nature of plain-text with this. This is only intended for use with our documentation. Enabling any type of Markdown support for emails can lead to incompatibilities or interopability problems with alternative implementations.
2019-02-05hlmod: make into a singleton
It turns out there's no point in having multiple instances of this or having to worry about destruction or destruction ordering. This will make it easier to reuse the one instance we have across different modules.
2019-02-05hlmod: hoist out do_hl_lang sub
We'll want to use to support highlighting syntax used by Markdown and possibly other markup languages (while retaining the raw plain-text layout and formatting).
2019-02-05viewvcs: cleanup utf8 handling
Favor in-place utf8::decode since it's a bit faster without method dispatch overhead; and don't care about validity just yet. HlMod->do_hl itself should return "utf8" strings, since other parts of our code can use it, so it's not the job of ViewVCS to post-process HlMod output.
2019-02-01newswww: add /$MESSAGE_ID global redirector endpoint
This is the fallback for the normal WWW endpoint. Adding this to the top-level seems to be alright, since lynx and w3m both understand nntp://<HOSTNAME>/<Message-ID> anyways. If newsgroup and inbox names conflict, then consider it the fault of the original sender. Since NewsWWW is intended to support buggy linkifiers in mail clients, they can interpret nntp:// URLs as http://<HOSTNAME>/<Message-ID> Inbox ordering from the config file is preserved since commit cfa8ff7c256e20f3240aed5f98d155c019788e3b ("config: each_inbox iteration preserves config order"), so admins can rely on that to configure how scanning works. Requested-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> cf. https://public-inbox.org/meta/20190107190719.GE9442@pure.paranoia.local/ nntp://news.public-inbox.org/20190107190719.GE9442@pure.paranoia.local
2019-02-01linkify: support proto://hostname without trailing slash
Sometimes users will write "http://example.com" without the trailing slash, which every browser and tool I've tested seems to understand.
2019-02-01hval: routines for attribute escaping
We'll use HTML attributes + anchor links to link to filenames in coming commits.
2019-01-31Merge remote-tracking branch 'origin/purge'
* origin/purge: implement public-inbox-purge tool v2writable: read epoch on purge v2writable: cleanup processes when done v2writable: purge ignores non-existent git epoch directories v2writable: ->purge returns undef on no-op import: purge: reap fast-export process hoist out resolve_repo_dir from -index
2019-01-31inbox: drop psgi.url_scheme requirement from base_url
This will make it easier to make command-line tools from SolverGit.
2019-01-31solvergit: allow searching on longer-than-needed OIDs
public-inbox can only index the abbreviated object_ids in emails, not the full or even longer-than-necessary object_ids. So retry failed object_ids if they're longer than 7 hex characters.
2019-01-31inbox: perform cleanup of Git objects for coderepos
Otherwise, long-running but idle git processes may keep unlinked packs around indefinitely and waste disk space.
2019-01-30t/config.t: test PublicInbox::Git sharing between inboxes
We need to ensure we don't introduce unnecessary processes and memory usage for mapping multiple inboxes to the same code repos.
2019-01-30Merge remote-tracking branch 'origin/viewvcs' into master
* origin/viewvcs: (66 commits) solvergit: deal with alternative diff prefixes solvergit: extract mode from diff headers properly solvergit: avoid "Wide character" warnings solvergit: do not show full path names to "git apply" css/216dark: add comments and tweak highlight colors viewvcs: avoid segfault with highlight.pm at shutdown solvergit: do not solve blobs twice t/check-www-inbox: disable history t/check-www-inbox: don't follow mboxes t/check-www-inbox: replace IPC::Run with PublicInbox::Spawn hval: add src_escape for highlight post-processing viewvcs: wire up syntax-highlighting for blobs hlmod: disable enclosing <pre> tag t/hl_mod: extra check to ensure we escape HTML wwwhighlight: read_in_full returns undef on errors solver: crank up max patches to 9999 viewvcs: do not show final error message twice qspawn: decode $? for user-friendliness solver: reduce "git apply" invocations solver: hold patches in temporary directory ...
2019-01-29t/check-www-inbox: disable history
WWW::Mechanize keeps an infinitely large stack, which was leading to OOM errors on my system.
2019-01-29t/check-www-inbox: don't follow mboxes
They can be extremely large with no limit, so can lead to OOM errors.
2019-01-29t/check-www-inbox: replace IPC::Run with PublicInbox::Spawn
Because WWW::Mechanize uses truckload of memory, fork needs to prepare all that memory for CoW, which ends up bailing with ENOMEM.
2019-01-29mid: filter out 'y', 'n', and email addresses from references()
Looking at git@vger history, several emails had broken References/In-Reply-To pointing to <y>, <n> and email addresses as Message-IDs in References and In-Reply-To headers. This was causing too many unrelated messages to be linked together in the same thread.
2019-01-28hval: add src_escape for highlight post-processing
We need to post-process "highlight" output to ensure it doesn't contain odd bytes which cause "wide character" warnings or require odd glyphs in source form.
2019-01-27hlmod: disable enclosing <pre> tag
We already have a <pre> tag in ViewVCS, and nesting <pre> inside the pre-existing <pre> overrides the "white-space:pre" we use to align line numbers.
2019-01-27t/hl_mod: extra check to ensure we escape HTML
Otherwise, it's open season on our users :<
2019-01-27qspawn: decode $? for user-friendliness
The raw value of $? isn't very useful, generally.
2019-01-26solver: rewrite to use Qspawn->psgi_qx and pi-httpd.async
The psgi_qx routine in the now-abandoned "repobrowse" branch allows us to break down blob-solving at each process execution point. It reuses the Qspawn facility for git-http-backend(1), allowing us to limit parallel subprocesses independently of Perl worker count. This is actually a 2-3% slower a fully-synchronous execution; but it is fair to other clients as it won't monopolize the server for hundreds of milliseconds (or even seconds) at a time.
2019-01-26t/qspawn.t: psgi_qx stderr test
2019-01-21t/check-www-inbox: trap SIGINT for File::Temp destruction
Otherwise, temporary GDBM files don't get unlinked when I SIGINT the process.
2019-01-21highlight: initial wrapper and PSGI service
I'll probably expose the PSGI service for cgit; but it could be useful to others as well.
2019-01-21t/check-www-inbox: warn on missing Content-Type
Oops, I might've left it out, somewhere.
2019-01-20config: each_inbox iteration preserves config order
For cross-inbox Message-ID resolution; having some sort of stable ordering makes the most sense. Relying on the order of the config file seems most natural and allows us to avoid introducing yet another configuration knob.
2019-01-20t/check-www-inbox: use xmlstarlet to validate Atom if available
I almost forgot about this script; but remembering to test it against real-world data can be useful to hunt for bugs.
2019-01-20www: admin-configurable CSS via "publicinbox.css"
Maybe we'll default to a dark theme to promote energy savings... See contrib/css/README for details
2019-01-19git: add git_quote
It'll be helpful for displaying progress in SolverGit output.
2019-01-19solver: initial Perl implementation
This will lookup git blobs from associated git source code repositories. If the blobs can't be found, an attempt to "solve" them via patch application will be performed. Eventually, this may become the basis of a type-agnostic frontend similar to "git show"
2019-01-19t/perf-msgview: add test to check msg_html performance
This will be necessary to ensure we maintain reasonable performance when we add diff-highlighting support.
2019-01-18t/git.t: do not pass "-b" to git-repack(1)
Allows t/git.t to run on older versions of git without "-b" and avoids incurring extra I/O traffic for bitmaps.
2019-01-18git: git_unquote handles double-quote and backslash
We need to work with 0x22 (double-quote) and 0x5c (backslash); even if they're oddball characters in filenames which wouldn't be used by projects I'd want to work on.
2019-01-18t/git.t: avoid passing read-only value to git_unquote
Older versions of Perl (tested 5.14.2 on Debian wheezy(*), reported by Konstantin on Perl 5.16.3) considered the result of concatenating two string literals to be a constant value. (*) not that other stuff works on wheezy, but t/git.t should. Reported-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-01-15config: inbox name checking matches git.git more closely
Actually, it turns out git.git/remote.c::valid_remote_nick rules alone are insufficient. More checking is performed as part of the refname in the git.git/refs.c::check_refname_component I also considered rejecting URL-unfriendly inbox names entirely, but realized some users may intentionally configure names not handled by our WWW endpoint for archives they don't want accessible over HTTP.
2019-01-15git_unquote: perform modifications in-place
This function doesn't have a lot of callers at the moment so none of them are affected by this change. But the plan is to use this in our WWW code for things, so do it now before we call it in more places. Results from a Thinkpad X200 with a Core2Duo P8600 @ 2.4GHz: Benchmark: timing 10 iterations of cp, ip... cp: 12.868 wallclock secs (12.86 usr + 0.00 sys = 12.86 CPU) @ 0.78/s (n=10) ip: 10.9137 wallclock secs (10.91 usr + 0.00 sys = 10.91 CPU) @ 0.92/s (n=10) Note: I mainly care about unquoted performance because that's the common case for the target audience of public-inbox. Script used to get benchmark results against the Linux source tree: ==> bench_unquote.perl <== use strict; use warnings; use Benchmark ':hireswallclock'; my $nr = 50; my %GIT_ESC = ( a => "\a", b => "\b", f => "\f", n => "\n", r => "\r", t => "\t", v => "\013", ); sub git_unquote_ip ($) { return $_[0] unless ($_[0] =~ /\A"(.*)"\z/); $_[0] = $1; $_[0] =~ s/\\([abfnrtv])/$GIT_ESC{$1}/g; $_[0] =~ s/\\([0-7]{1,3})/chr(oct($1))/ge; $_[0]; } sub git_unquote_cp ($) { my ($s) = @_; return $s unless ($s =~ /\A"(.*)"\z/); $s = $1; $s =~ s/\\([abfnrtv])/$GIT_ESC{$1}/g; $s =~ s/\\([0-7]{1,3})/chr(oct($1))/ge; $s; } chomp(my @files = `git -C ~/linux ls-tree --name-only -r v4.19.13`); timethese(10, { cp => sub { for (0..$nr) { git_unquote_cp($_) for @files } }, ip => sub { for (0..$nr) { git_unquote_ip($_) for @files } }, });
2019-01-11implement public-inbox-purge tool
Expose the ->purge functionality of V2Writable for rewriting git history to permanently purge messages from history. This may be necessary for legal reasons. Usage: # requires ~/.public-inbox/config public-inbox-purge --all </path/to/message-to-purge # good for testing with unconfigured inboxes: public-inbox-purge $INBOX_DIR </path/to/message-to-purge
2019-01-11v2writable: ->purge returns undef on no-op
And doesn't try to access undef as an array ref.