about summary refs log tree commit homepage
path: root/t
DateCommit message (Collapse)
2019-05-08t/purge.t: fix unreferenced variable
2019-05-08Merge remote-tracking branch 'origin/danga-bundle'
* origin/danga-bundle: DS: epoll: fix misordered EPOLL_CTL_DEL call DS: drop unused "_undef" sub syscall: drop readahead wrapper build: do not manify DS and Syscall pods DS: handle EINTR in IO::Poll path, too DS: workaround IO::Kqueue EINTR (mis-)handling DS: drop profiling support DS: remove unused fields and functions listener: use EPOLLEXCLUSIVE for listen sockets bundle Danga::Socket and Sys::Syscall
2019-05-06index: warn with info about the message as context
This can help users track down the source of warnings when presented with imperfect emails. While we're at it, make the __WARN__ callback in t/v2writable.t a no-op since we don't check for warnings, there.
2019-05-05t/search.t: fix permissions check on FreeBSD
FreeBSD does not allow non-root users to set S_ISGID; so git skips this bit on FreeBSD and Debian/kFreeBSD platforms.
2019-05-04bundle Danga::Socket and Sys::Syscall
These modules are unmaintained upstream at the moment, but I'll be able to help with the intended maintainer once/if CPAN ownership is transferred. OTOH, we've been waiting for that transfer for several years, now... Changes I intend to make: * EPOLLEXCLUSIVE for Linux * remove unused fields wasting memory * kqueue bugfixes e.g. https://rt.cpan.org/Ticket/Display.html?id=116615 * accept4 support And some lower priority experiments: * switch to EV_ONESHOT / EPOLLONESHOT (incompatible changes) * nginx-style buffering to tmpfile instead of string array * sendfile off tmpfile buffers * io_uring maybe?
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.