]> Sergey Matveev's repositories - public-inbox.git/log
public-inbox.git
7 years agoTODO: updates based on git@vger mirror experience
Eric Wong [Sun, 14 Aug 2016 11:30:32 +0000 (11:30 +0000)]
TODO: updates based on git@vger mirror experience

Plenty more to do!

7 years agowww: do not double-clean Message-IDs from internal DBs
Eric Wong [Sun, 14 Aug 2016 10:21:10 +0000 (10:21 +0000)]
www: do not double-clean Message-IDs from internal DBs

Ensure we usually strip one level of '<>' from Message-IDs,
since our internal SQLite, Xapian, and SHA-1 storage all
assume that.

Realistically, we screw up if somebody has '<<' or '>>',
but those are screwed up mail clients and we can deal with
it another time.  Currently, this means some messages with
'>>' in References or Message-Id are not handled correctly,
yet, but we match the behavior of Mail::Thread in keeping
the extra '>'.

7 years agowww: do not unecessarily escape some chars in paths
Eric Wong [Sun, 14 Aug 2016 10:21:09 +0000 (10:21 +0000)]
www: do not unecessarily escape some chars in paths

Based on reading RFC 3986, it seems '@', ':', '!', '$', '&',
"'", '; '(', ')', '*', '+', ',', ';', '=' are all allowed
in path-absolute where we have the Message-ID.

In any case, it seems '@' is fairly common in path components
nowadays and too common in Message-IDs.

7 years agowww: ensure XML validity for some odd ASCII chars
Eric Wong [Sun, 14 Aug 2016 10:21:17 +0000 (10:21 +0000)]
www: ensure XML validity for some odd ASCII chars

I've seen 0x1b (\e) in at least one message and some other
possibly non-printable chars.  In any case, make sure they're
valid XML with us-ascii encoding as far as xmlstarlet(1) thinks
so.

7 years agomid: no wide characters for sha1_hex
Eric Wong [Sun, 14 Aug 2016 10:21:11 +0000 (10:21 +0000)]
mid: no wide characters for sha1_hex

Apparently there are some really screwed up In-Reply-To
fields out there.

7 years agosearch: gracefully handle lookup_message failure
Eric Wong [Sun, 14 Aug 2016 10:21:15 +0000 (10:21 +0000)]
search: gracefully handle lookup_message failure

We can't blindly assume a ghost even exists in the DB, as the
rules can change internally for some corner-case Message-IDs.

7 years agoview: remove redundant pre closing tag
Eric Wong [Sun, 14 Aug 2016 10:21:13 +0000 (10:21 +0000)]
view: remove redundant pre closing tag

7 years agoview: allow for missing In-Reply-To mapping
Eric Wong [Sun, 14 Aug 2016 10:21:12 +0000 (10:21 +0000)]
view: allow for missing In-Reply-To mapping

Because buggy mail clients exist and generate invalid
In-Reply-To headers we cannot handle across the board...

7 years agosearchidx: do not release Xapian lock while (only) Msgmap is indexing
Eric Wong [Sun, 14 Aug 2016 10:21:08 +0000 (10:21 +0000)]
searchidx: do not release Xapian lock while (only) Msgmap is indexing

SQLite might index quickly, so we hold the lock used by Xapian
for the duration.  This probably needs to be reworked entirely,
actually.

7 years agoimport_slrnspool: reimplement using fast-import
Eric Wong [Sun, 14 Aug 2016 10:21:07 +0000 (10:21 +0000)]
import_slrnspool: reimplement using fast-import

I needed to use this to resurrect some messages missing
from my initial downloads from gmane...

7 years agonewswww: include body text in 404 response
Eric Wong [Sun, 14 Aug 2016 10:16:55 +0000 (10:16 +0000)]
newswww: include body text in 404 response

Some browsers do not give any indication of the HTTP error
code on errors, so show the error text to the user like we
do in the top-level WWW module.

7 years agoextmsg: reorder and add a more Message-ID lookup services
Eric Wong [Sat, 13 Aug 2016 00:22:01 +0000 (00:22 +0000)]
extmsg: reorder and add a more Message-ID lookup services

gmane is down at the moment, so lower that in priority
(hopefully it will be brought back up, again).  Wikipedia also
lists a few more project-specific list providers, so include
those as well: https://en.wikipedia.org/wiki/Message-ID

7 years agowatch: respect altid for incremental watch changes
Eric Wong [Fri, 12 Aug 2016 22:08:50 +0000 (22:08 +0000)]
watch: respect altid for incremental watch changes

We need to pass the Inbox object to SearchIdx to get altid
mappings properly for incremental imports.

TODO: use the Inbox object in more places where it makes sense
to do so.

7 years agowww: allow including links to NNTP sites in HTML footer
Eric Wong [Fri, 12 Aug 2016 19:52:35 +0000 (19:52 +0000)]
www: allow including links to NNTP sites in HTML footer

Improve the discoverability of NNTP endpoints for users
who still know what NNTP is.

==> ~/.public-inbox/config <==
; aliases for the locally-run nntpd can be specified in
; the "publicinbox" section:
[publicinbox]
nntpserver = nntp://ou63pmih66umazou.onion/
nntpserver = news.public-inbox.org

; NNTPS is not supported natively, yet,
; but one can use haproxy or similar
; nntpserver = nntps://news.public-inbox.invalid/

; mirrors for specific inboxes may be specified either as full
; NNTP (or NNTPS) URLs, or with the server name only if the
; newsgroup name is specfied for a local NNTP server
[publicinbox "git"]
...
newsgroup = inbox.a.b.c
nntpmirror = nntp://czquwvybam4bgbro.onion/
nntpmirror = hjrcffqmbrq6wope.onion

; there may be a mirror on a different server with a
; different name:
nntpmirror = nntp://news.example.com/differently.named.group

; (And I really need to write manpages for all this...)

7 years agopublic-inbox-watch: support reloading config with SIGHUP
Eric Wong [Thu, 11 Aug 2016 19:15:23 +0000 (19:15 +0000)]
public-inbox-watch: support reloading config with SIGHUP

This can be useful for adding new lists, as restarting is
expensive (but still non-lossy).

7 years agoconfig: do not nest multi-value altid arrays
Eric Wong [Fri, 12 Aug 2016 02:15:55 +0000 (02:15 +0000)]
config: do not nest multi-value altid arrays

Oops.  We will inevitably need to support multiple altids for a
public-inbox one day.

7 years agosearch: support alt-ID for mapping legacy serial numbers
Eric Wong [Thu, 11 Aug 2016 00:23:48 +0000 (00:23 +0000)]
search: support alt-ID for mapping legacy serial numbers

For some existing mailing list archives, messages are identified
by serial number (such as NNTP article numbers in gmane).  Those
links may become inaccessible (as is the current case for
gmane), so ensure users can still search based on old serial
numbers.

Now, I run the following periodically to get article numbers
from gmane (while news.gmane.org remains):

NNTPSERVER=news.gmane.org
export NNTPSERVER
GROUP=gmane.comp.version-control.git
perl -I lib scripts/xhdr-num2mid $GROUP --msgmap=/path/to/gmane.sqlite3

(I might integrate this further with public-inbox-* scripts one day).

My ~/.public-inbox/config as an added "altid" snippet which now
looks like this:

[publicinbox "git"]
address = git@vger.kernel.org
mainrepo = /path/to/git.vger.git
newsgroup = inbox.comp.version-control.git

; relative pathnames expand to $mainrepo/public-inbox/$file
altid = serial:gmane:file=gmane.sqlite3

And run "public-inbox-index --reindex /path/to/git.vger.git"
periodically.

This ought to allow searching for "gmane:12345" to work for
Xapian-enabled instances.

Disclaimer: while public-inbox supports NNTP and stable article
serial numbers, use of those for public links is discouraged
since it encourages centralization.

7 years agosearchidx: allow searching Message-IDs in free-form text
Eric Wong [Tue, 9 Aug 2016 23:59:10 +0000 (23:59 +0000)]
searchidx: allow searching Message-IDs in free-form text

It is not unheard of for users to attempt finding messages by
entering Message-IDs into the "Search" box instead of using the
existing URL structure.  So make it possible for them.

Fwiw, I've definitely encountered users who enter entire URLs
into generic search engines.

7 years agowww: avoid misinterpreting '&' and ';' in query parameters
Eric Wong [Tue, 9 Aug 2016 01:55:19 +0000 (01:55 +0000)]
www: avoid misinterpreting '&' and ';' in query parameters

Oops, we must unescape each key=value pair in a QUERY_STRING
individually; otherwise we cannot interpret '&' or ';' in
query parameter values.

7 years agosearchidx: avoid holding Xapian lock in cat-file
Eric Wong [Tue, 9 Aug 2016 00:41:37 +0000 (00:41 +0000)]
searchidx: avoid holding Xapian lock in cat-file

We must ensure cat-file process is launched before Xapian
grabs lock, too.  Our use of "git cat-file --batch" has
the same problem as "git log" did, (which was fixed in
commit 3713c727cda431a0dc2865a7878c13ecf9f21851)
"searchidx: release Xapian FDs before spawning git log"

7 years agosearchidx: release Xapian FDs before spawning git log
Eric Wong [Tue, 9 Aug 2016 00:22:52 +0000 (00:22 +0000)]
searchidx: release Xapian FDs before spawning git log

This will allow us to release and re-acquire Xapian locks
due to the lack of FD_CLOEXEC on some FDs.

7 years agosearchidx: persist the PublicInbox::Git object
Eric Wong [Tue, 9 Aug 2016 00:22:51 +0000 (00:22 +0000)]
searchidx: persist the PublicInbox::Git object

We can cheaply keep the object around nowadays since it
spawns expensive processes only on an as-needed basis.

7 years agosearchidx: remove unused $git parameters
Eric Wong [Tue, 9 Aug 2016 00:22:50 +0000 (00:22 +0000)]
searchidx: remove unused $git parameters

We do not need to pass the PublicInbox::Git object to
various callbacks.

7 years agowww: use <hr> to delimit messages in /new.html view, too
Eric Wong [Sat, 6 Aug 2016 21:00:40 +0000 (21:00 +0000)]
www: use <hr> to delimit messages in /new.html view, too

This is necessary to delimit messages when viewed without
threading.

7 years agombox: be fair to other HTTP clients
Eric Wong [Sat, 6 Aug 2016 01:58:47 +0000 (01:58 +0000)]
mbox: be fair to other HTTP clients

At least for public-inbox-httpd, this allows us to avoid having
a client monopolize one event loop tick of the server for too
long.  It hurts throughput for the /all.mbox.gz endpoint, but I
doubt anybody cares and the latency improvement for other
clients would be appreciated.

We already do the same fairness thing for HTML pages.

7 years agoview: do not introduce excessive </pre> in $MID/t/ view
Eric Wong [Sat, 6 Aug 2016 00:26:38 +0000 (00:26 +0000)]
view: do not introduce excessive </pre> in $MID/t/ view

When using <ul><li>..., we already setup <pre> tags
in thread_index_entry, so having an extra </pre> tag
causes validation errors.

Fixes: 6ef9b216156c ("view: use <hr> to delineate in /$MID/T/ view")
7 years agosearch: disable batching in newer versions of Xapian, for now
Eric Wong [Fri, 5 Aug 2016 22:07:25 +0000 (22:07 +0000)]
search: disable batching in newer versions of Xapian, for now

This warrants further investigation, but it appears we cannot
release Xapian reliably after forking "git log" due to the
lack of a close-on-exec flag on the Xapian flintlock FD

7 years agoview: use <hr> to delineate in /$MID/T/ view
Eric Wong [Fri, 5 Aug 2016 18:10:50 +0000 (18:10 +0000)]
view: use <hr> to delineate in /$MID/T/ view

The sacrifice in vertical space might be worth it to improve
ease-of-reading, as it's unreasonable to expect an entire
message thread to be able to fit into a single window.

https://public-inbox.org/git/20160805093544.scvl4yshkfg2l26p@sigill.intra.peff.net/

Cc: Jeff King <peff@peff.net>
7 years agohttp: do not allow bad getline+close responses to kill us
Eric Wong [Thu, 4 Aug 2016 23:36:34 +0000 (23:36 +0000)]
http: do not allow bad getline+close responses to kill us

PSGI applications (like our WWW :P) can fail unpredictability,
but lets try to avoid bringing the entire process down when this
happens.

7 years agothread: avoid recursion in Mail::Thread::recurse_down
Eric Wong [Fri, 5 Aug 2016 00:24:18 +0000 (00:24 +0000)]
thread: avoid recursion in Mail::Thread::recurse_down

Yet another monkey patch to fix a problem encountered in upstream
Mail::Thread.

ref:
- https://rt.cpan.org/Ticket/Display.html?id=116727
- http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=833479

7 years agoview: do not fail on empty In-Reply-To
Eric Wong [Thu, 4 Aug 2016 21:58:40 +0000 (21:58 +0000)]
view: do not fail on empty In-Reply-To

Sometimes messages have an empty In-Reply-To header which throws
threaders off.  This actually causes public-inbox-httpd to die,
which is probably bad and will be fixed elsewhere.

7 years agosearchmsg: add git object ID to doc_data
Eric Wong [Tue, 2 Aug 2016 10:02:54 +0000 (10:02 +0000)]
searchmsg: add git object ID to doc_data

Doing git tree lookups based on the SHA-1 of the Message-ID
is expensive as trees get larger, instead, use the SHA-1
object ID directly.  This drastically reduces the amount
of time spent in the "git cat-file --batch" process for
fetching the /$INBOX/all.mbox.gz endpoint on the ~800MB
git@vger.kernel.org mirror

This retains backwards compatibility and allows existing
indices to be transparently upgraded without performance
degradation.

7 years agosearch: improve reindexing behavior
Eric Wong [Tue, 2 Aug 2016 08:32:09 +0000 (08:32 +0000)]
search: improve reindexing behavior

For reindexing, fresh Xapian DBs do not count as a reindex,
allowing users to blindly use --reindex on the first
run on a clean repo.

While we're at it, allow indexing to override HEAD ref for
multi-head git repos.

7 years agowwwstream: prioritize search in top title bar
Eric Wong [Tue, 2 Aug 2016 01:47:55 +0000 (01:47 +0000)]
wwwstream: prioritize search in top title bar

search is probably more useful so users should be able to select
it sooner.  Put it on its own line so it won't get scrolled off
the edge for non-CSS users.

Fix a minor spacing bug in the input tag while we're at it, too

7 years agodaemon: do not chdir unless daemonizing
Eric Wong [Tue, 2 Aug 2016 01:47:54 +0000 (01:47 +0000)]
daemon: do not chdir unless daemonizing

As far as most process managers are concerned (e.g. systemd),
they should already start in '/'.  So avoid making our daemon
more complex to run by requiring absolute paths during
development.

7 years agosearch: support reindexing existing search indices
Eric Wong [Sun, 31 Jul 2016 00:02:06 +0000 (00:02 +0000)]
search: support reindexing existing search indices

This should make tweaking the way we search more efficiet
by allowing us to avoid doubling destroying the index every
time we want to change something.

We also give priority to incremental indexing via
public-inbox-{watch,mda} and have manual invocations of
public-inbox-index perform batch updates while releasing
ssoma.lock.

7 years agomsgmap: fix use of transactions
Eric Wong [Sun, 31 Jul 2016 00:02:05 +0000 (00:02 +0000)]
msgmap: fix use of transactions

We want transactions to be the responsibility of the
caller when possible; this fixes the potential for
the msgmap to internally become inconsistent when
using it from inside searchidx.

7 years agot/config_limiter: fix check for identical Git object
Eric Wong [Sat, 30 Jul 2016 23:33:11 +0000 (23:33 +0000)]
t/config_limiter: fix check for identical Git object

If we completely undef an object, it is likely possible
to have the same scalar address as the original object
even if they are different.  So keep the same object
around and only force creation of the same reference.
Tested on Perl 5.14.2 on Debian 7.x wheezy.

7 years agodaemon: re-enable SIGWINCH without setsid
Eric Wong [Fri, 29 Jul 2016 18:58:51 +0000 (18:58 +0000)]
daemon: re-enable SIGWINCH without setsid

This allows systemd users to use SIGWINCH to temporarily
(and gracefully) stop an instance of a service without
doing a code reload to bring it back up:

# start temporary new service code
systemctl start public-inbox-nntpd@2.service

# momentarily paralyze original service
systemctl kill -s WINCH public-inbox-nntpd@1.service

if new_code_at_2_sucks
then
# restart original workers
systemctl kill -s HUP public-inbox-nntpd@1.service
else # new is better than old, replace original instance
systemctl restart public-inbox-nntpd@1.service
fi

# cleanup the temporary service
systemctl stop public-inbox-nntpd@2.service

This partially reverts commit 73d274e83b7d300f31e0cc1ceeacbf73c6c2a1e4
("daemon: disable SIGWINCH unless explicitly daemonized")

7 years agoadd scripts/xhdr-num2mid example
Eric Wong [Thu, 28 Jul 2016 22:00:08 +0000 (22:00 +0000)]
add scripts/xhdr-num2mid example

This is used to quickly generate an article number to Message-ID
mapping.

Usage:

NNTPSERVER=news.example.org ./scripts/xhdr-num2mid GROUP >file

7 years agofix manifest
Eric Wong [Thu, 28 Jul 2016 21:16:56 +0000 (21:16 +0000)]
fix manifest

7 years agoadd script used for importing git from download.gmane.org
Eric Wong [Thu, 28 Jul 2016 20:44:57 +0000 (20:44 +0000)]
add script used for importing git from download.gmane.org

In case others want to use it...

7 years agolocalize $/ when using chomp
Eric Wong [Wed, 27 Jul 2016 22:28:26 +0000 (22:28 +0000)]
localize $/ when using chomp

Callers may have localized $/ to something else, so make sure
we chomp the expected character(s) when calling chomp.

7 years agomda: always call Import::done, even on dupes
Eric Wong [Tue, 26 Jul 2016 01:00:31 +0000 (01:00 +0000)]
mda: always call Import::done, even on dupes

We don't want to leave fast_import_crash_* dumps
around on duplicates.

7 years agolearn: fix uninitialized variable
Eric Wong [Tue, 26 Jul 2016 00:46:52 +0000 (00:46 +0000)]
learn: fix uninitialized variable

Oops :x

7 years agomda: fix address matching in address lists
Eric Wong [Tue, 26 Jul 2016 00:35:02 +0000 (00:35 +0000)]
mda: fix address matching in address lists

This is common when multiple participants are in a thread.

7 years agowww: redefinable project name and URL
Eric Wong [Thu, 21 Jul 2016 01:55:48 +0000 (01:55 +0000)]
www: redefinable project name and URL

This should make it easier for folks to run their own forks.

7 years agowww: a note .onion URLs require the usage of Tor
Eric Wong [Thu, 21 Jul 2016 01:50:01 +0000 (01:50 +0000)]
www: a note .onion URLs require the usage of Tor

Not everybody knows what .onion URLs are, so refer them to Tor.

7 years agoview: split up --cc args for git-send-email
Eric Wong [Thu, 21 Jul 2016 01:23:03 +0000 (01:23 +0000)]
view: split up --cc args for git-send-email

Having long Cc: lines is inevitable for large threads
with many participants, and git-send-email only gained
the ability to recognize ',' in the "--cc" arg recently
with the release of git v2.6.0 in September 2015.

7 years agowww: label sections and hopefully improve navigation
Eric Wong [Thu, 21 Jul 2016 01:23:02 +0000 (01:23 +0000)]
www: label sections and hopefully improve navigation

Clearly label "Thread overview" and "Reply instructions"
so users can quickly skip stuff they're not interested in.

Additionally, note the fact the thread view allows quick
navigation within the thread to avoid extra network requests
and improve the display for single-message threads.

Finally, use <hr> to better-delineate sections of each page.

7 years agoextmsg: favor user-provided URL on partial matches
Eric Wong [Sun, 17 Jul 2016 23:27:02 +0000 (23:27 +0000)]
extmsg: favor user-provided URL on partial matches

While an inbox may have multiple URLs, we will favor
the existing URL for the current inbox on partial matches
to avoid confusing users or slowing them down by requiring
a new TCP connection.

7 years agoview: conditionally anchor to thread skeleton
Eric Wong [Sun, 10 Jul 2016 01:24:08 +0000 (01:24 +0000)]
view: conditionally anchor to thread skeleton

We only care about the thread skeleton if we have
multiple messages in a thread, single message threads
can just go to the top of the message.

7 years agoINSTALL: postfix and spamassassin are optional for HTTP mirrors
Eric Wong [Sun, 10 Jul 2016 00:47:14 +0000 (00:47 +0000)]
INSTALL: postfix and spamassassin are optional for HTTP mirrors

Not everybody needs to run an -mda or -watch

7 years agoview: add "infourl" for reply information
Eric Wong [Sat, 9 Jul 2016 23:55:44 +0000 (23:55 +0000)]
view: add "infourl" for reply information

7 years agoview: show most recently updated topics, first
Eric Wong [Sat, 9 Jul 2016 08:01:17 +0000 (08:01 +0000)]
view: show most recently updated topics, first

This probably makes the most sense as it's structured like
a changelog.

7 years agoview: improve grouping for topic view
Eric Wong [Sat, 9 Jul 2016 07:53:17 +0000 (07:53 +0000)]
view: improve grouping for topic view

This reduces the amount of mbox/Atom links while keeping
better track of overall thread count.  We no longer loop
to fill up slots to simplify the code a bit and hopefully
get better grouping.

7 years agohttpd/async: reinstate D::S timer usage for cleanup
Eric Wong [Sat, 9 Jul 2016 04:51:37 +0000 (04:51 +0000)]
httpd/async: reinstate D::S timer usage for cleanup

EvCleanup::asap events are not guaranteed to run after
Danga::Socket closes sockets at the event loop.  Thus we
must use slower Danga::Socket timers which are guaranteed
to run at the end of the event loop.

7 years agohttpd/async: do not attempt future writes on closed sockets
Eric Wong [Sat, 9 Jul 2016 04:51:36 +0000 (04:51 +0000)]
httpd/async: do not attempt future writes on closed sockets

Danga::Socket::close does not clear the write_buf_size field,
so it's conceivable we could attempt to queue up data and
callbacks we can never flush out.

7 years agowww: add configurable limiters
Eric Wong [Sat, 9 Jul 2016 03:18:35 +0000 (03:18 +0000)]
www: add configurable limiters

Currently only for git-http-backend use, this allows limiting
the number of spawned processes per-inbox or by group, if there
are multiple large inboxes amidst a sea of small ones.

For example, a "big" repo limiter could be used for big inboxes:
which would be shared between multiple repos:

[limiter "big"]
max = 4
[publicinbox "git"]
address = git@vger.kernel.org
mainrepo = /path/to/git.git
; shared limiter with giant:
httpbackendmax = big
[publicinbox "giant"]
address = giant@project.org
mainrepo = /path/to/giant.git
; shared limiter with git:
httpbackendmax = big

; This is a tiny inbox, use the default limiter with 32 slots:
[publicinbox "meta"]
address = meta@public-inbox.org
mainrepo = /path/to/meta.git

7 years agoqspawn: allow configurable limiters
Eric Wong [Sat, 9 Jul 2016 03:18:34 +0000 (03:18 +0000)]
qspawn: allow configurable limiters

And bump the default limit to 32 so we match git-daemon
behavior.  This shall allow us to configure different levels
of concurrency for different repositories and prevent clones
of giant repos from stalling service to small repos.

7 years agocleanup some unnecessary use/requires
Eric Wong [Sat, 9 Jul 2016 03:18:33 +0000 (03:18 +0000)]
cleanup some unnecessary use/requires

Hopefully this can reduce memory overhead for people that
use one-shot CGI.

7 years agofeed: remove dead code and unneeded use
Eric Wong [Sat, 9 Jul 2016 03:18:32 +0000 (03:18 +0000)]
feed: remove dead code and unneeded use

We've cleaned up our code in recent days and WwwStream
provides a consistent header for our HTML pages.

7 years agowww: cleanup parameter passing
Eric Wong [Sat, 9 Jul 2016 03:18:31 +0000 (03:18 +0000)]
www: cleanup parameter passing

Reduce the size of hashes a bit and drops some unneeded hash
lookups for uncommon paths.

7 years agowww: drop unused constants
Eric Wong [Sat, 9 Jul 2016 03:18:30 +0000 (03:18 +0000)]
www: drop unused constants

We no longer generate our footer, here.  We are not currently
advertising ssoma, here.

7 years agonntp: return if a client drops on us
Eric Wong [Sat, 9 Jul 2016 00:00:11 +0000 (00:00 +0000)]
nntp: return if a client drops on us

Danga::Socket::write will set the closed flag on a socket,
automatically, and we do not need to bring down an entire
server when one client breaks the connection :P

7 years agoexamples: add logrotate sample to show USR1 reopening
Eric Wong [Fri, 8 Jul 2016 21:12:26 +0000 (21:12 +0000)]
examples: add logrotate sample to show USR1 reopening

Same as nginx :>

7 years agoexamples: minimize differences for systemd examples
Eric Wong [Fri, 8 Jul 2016 21:08:33 +0000 (21:08 +0000)]
examples: minimize differences for systemd examples

Our nntpd and httpd are similar so configuration differences
should be minimized

7 years agohttp: drop extra newline in error message
Eric Wong [Fri, 8 Jul 2016 18:20:44 +0000 (18:20 +0000)]
http: drop extra newline in error message

We already add the extra newline when we call print.

7 years agohttp: additional info for write failures
Eric Wong [Thu, 7 Jul 2016 20:09:39 +0000 (20:09 +0000)]
http: additional info for write failures

There was a spurious test failure in t/httpd-corner.t
which I have not been able to reproduce.

7 years agonntpd: avoid exiting subroutine via next
Eric Wong [Thu, 7 Jul 2016 19:55:29 +0000 (19:55 +0000)]
nntpd: avoid exiting subroutine via next

Fixes: 33cef7f24d3d ("config: introduce each_inbox for iteration")
7 years agoview: per-message view links to real previous sibling
Eric Wong [Thu, 7 Jul 2016 03:03:38 +0000 (03:03 +0000)]
view: per-message view links to real previous sibling

This is closer to the behavior of thread-aware MUAs.

7 years agoview: preserve attribution for current message
Eric Wong [Thu, 7 Jul 2016 02:32:23 +0000 (02:32 +0000)]
view: preserve attribution for current message

It should be harmless if the "[this message]" text goes past
the boundary as we bold the entire line to make it stand out.

7 years agoview: reduce visual noise in conversation view
Eric Wong [Thu, 7 Jul 2016 02:25:55 +0000 (02:25 +0000)]
view: reduce visual noise in conversation view

No need for ' / ' delimiters on lines dedicated for hyperlinks.

7 years agowww: remove old footer generation code and normalize new.html
Eric Wong [Thu, 7 Jul 2016 01:39:37 +0000 (01:39 +0000)]
www: remove old footer generation code and normalize new.html

We now generate all of our HTML using WwwStream which
forces us to have consistent headers and footers in
the HTML itself.

This also makes the search-capable vs search-less installs
go to the new.html endpoint to maintain consistency
(in case an admin decides to enable Xapian).

7 years agoinbox: cleanup and consolidate object weakening
Eric Wong [Thu, 7 Jul 2016 01:39:36 +0000 (01:39 +0000)]
inbox: cleanup and consolidate object weakening

This fixes some layering violations and consolidates
the cleanup into the inbox object itself.  Keeping in
mind weakening does not work at all without our PSGI
server.

7 years agot/git-http-backend: check BSD::Resource availability
Eric Wong [Thu, 7 Jul 2016 01:39:35 +0000 (01:39 +0000)]
t/git-http-backend: check BSD::Resource availability

We should not fail tests when this is not available.

7 years agogithttpbackend: avoid intermediate array creation from stat
Eric Wong [Thu, 7 Jul 2016 01:39:34 +0000 (01:39 +0000)]
githttpbackend: avoid intermediate array creation from stat

No need to keep an extra array around for this.

7 years agofeed: fix links to attachments in Atom feed
Eric Wong [Wed, 6 Jul 2016 02:43:41 +0000 (02:43 +0000)]
feed: fix links to attachments in Atom feed

Oops...

7 years agowww: use HTML <hr> instead of XHTML <hr />
Eric Wong [Wed, 6 Jul 2016 02:32:07 +0000 (02:32 +0000)]
www: use HTML <hr> instead of XHTML <hr />

We only need XHTML-compatibility inside Atom feeds, as
anecdotally, feed readers are stricter than normal browsers and
some do not support HTML, only XHTML.  So we will continue to
accomodate them.  However we favor HTML elsewhere since it
tends to be smaller than the equivalent well-formed XHTML.

7 years agoview: fix double-escaping of ghost links
Eric Wong [Wed, 6 Jul 2016 02:05:50 +0000 (02:05 +0000)]
view: fix double-escaping of ghost links

Oops :x

7 years agoextmsg: switch to wwwstream for partial match, too
Eric Wong [Wed, 6 Jul 2016 01:37:20 +0000 (01:37 +0000)]
extmsg: switch to wwwstream for partial match, too

Another step towards a consistent WWW UI...

7 years agoextmsg: disable automatic inbox switching
Eric Wong [Wed, 6 Jul 2016 01:21:17 +0000 (01:21 +0000)]
extmsg: disable automatic inbox switching

Automatic inbox switching was a potentially deceptive pattern
and surprises readers who do not check the URL bar closely.
Furthermore, a message could be cross-posted to multiple lists,
too.

7 years agowwwstream: allow undef noop callback
Eric Wong [Wed, 6 Jul 2016 01:18:06 +0000 (01:18 +0000)]
wwwstream: allow undef noop callback

This can be use to specify a small response using -html_tip.

7 years agoaddress: attempt to handle comments somewhat
Eric Wong [Wed, 6 Jul 2016 00:36:59 +0000 (00:36 +0000)]
address: attempt to handle comments somewhat

They're uncommon, fortunately, but we make no attempt to
handle nested comments (which would open us up to things
like CVE-2015-7686) or use the comment in place of a
missing name.

7 years agohval: get rid of unused parameter for new_msgid
Eric Wong [Tue, 5 Jul 2016 22:39:54 +0000 (22:39 +0000)]
hval: get rid of unused parameter for new_msgid

Exposing compressed Message-IDs in URLs was a mistake,
remove a remnant of it.

7 years agodaemon: disable USR2/TTIN/TTOU/WINCH in workers
Eric Wong [Tue, 5 Jul 2016 13:05:41 +0000 (13:05 +0000)]
daemon: disable USR2/TTIN/TTOU/WINCH in workers

If using a master/worker setup, a careless user could be trying
to signal all processes using "killall".  This may trigger bad
side-effects; but try to limit the side-effects as much as
possible.

7 years agoscripts/dc-dlvr: ensure temporary files are removed
Eric Wong [Wed, 6 Jul 2016 01:52:07 +0000 (01:52 +0000)]
scripts/dc-dlvr: ensure temporary files are removed

Oops :x

7 years agoexamples/varnish-4.vcl: comments and tweaks
Eric Wong [Sun, 3 Jul 2016 01:14:24 +0000 (01:14 +0000)]
examples/varnish-4.vcl: comments and tweaks

Document and simplify things a bit.  The major functional change
is we no longer waste space caching objects from dumb HTTP
clones.

7 years agoexamples: remove X-Forwarded-For mentions
Eric Wong [Sun, 3 Jul 2016 01:04:10 +0000 (01:04 +0000)]
examples: remove X-Forwarded-For mentions

We don't need to care about client IPs anywhere.

7 years agoview: remove self-linkification in thread views
Eric Wong [Sun, 3 Jul 2016 00:59:07 +0000 (00:59 +0000)]
view: remove self-linkification in thread views

There is no point for diverting readers' attention with
an unnecessary link, here.

7 years agogithttpbackend: match Content-Type of git-http-backend(1)
Eric Wong [Sun, 3 Jul 2016 00:43:12 +0000 (00:43 +0000)]
githttpbackend: match Content-Type of git-http-backend(1)

This will allow cache proxies such as Varnish to avoid
caching data sent by us.

7 years agowwwstream: wording/grammar tweaks in trailer
Eric Wong [Sat, 2 Jul 2016 22:57:29 +0000 (22:57 +0000)]
wwwstream: wording/grammar tweaks in trailer

git.git documentation uses "clonable" so that's probably
a better term than "clone-able".  Also, shorten the section
for retrieving our code and remove an obvious typo.

7 years agonntp: respect 3 minute idle time for shutdown
Eric Wong [Sat, 2 Jul 2016 21:50:30 +0000 (21:50 +0000)]
nntp: respect 3 minute idle time for shutdown

This avoids breaking clients on graceful shutdown since
NNTP responses should usually be quick.

7 years agonntp: simplify update_idle_time
Eric Wong [Sat, 2 Jul 2016 21:50:29 +0000 (21:50 +0000)]
nntp: simplify update_idle_time

This ought to make things easier when we add TLS support.

7 years agoconfig: introduce each_inbox for iteration
Eric Wong [Sat, 2 Jul 2016 21:50:28 +0000 (21:50 +0000)]
config: introduce each_inbox for iteration

This fills in the internal lookup hashes and simplifies
callers.

7 years agolinkify: allow '!' in URLs
Eric Wong [Sat, 2 Jul 2016 08:25:13 +0000 (08:25 +0000)]
linkify: allow '!' in URLs

GoogleGroups URLs often contain '!' in them

7 years agowww: remove Plack::Request dependency entirely
Eric Wong [Sat, 2 Jul 2016 07:56:38 +0000 (07:56 +0000)]
www: remove Plack::Request dependency entirely

Lighter and ever-so-slightly faster!

Most importantly, this won't do non-obvious stuff behind our
backs like trying to parse a POST request body for a query
string param.

7 years agoview: rely on internal query parser for 'o' param
Eric Wong [Sat, 2 Jul 2016 07:56:37 +0000 (07:56 +0000)]
view: rely on internal query parser for 'o' param

Plack::Request will check the request body by merely
calling "param", totally unnecessary and sneaky.

7 years agowww: use PSGI env directly
Eric Wong [Sat, 2 Jul 2016 07:56:36 +0000 (07:56 +0000)]
www: use PSGI env directly

More work on on the Plack::Request/CGI.pm removal front,
No need to access the PSGI env through an extra hash lookup.

7 years agoextmsg: rework to use Inbox objects
Eric Wong [Sat, 2 Jul 2016 07:56:35 +0000 (07:56 +0000)]
extmsg: rework to use Inbox objects

This is less code and hopefully easier-to-understand.