]> Sergey Matveev's repositories - public-inbox.git/log
public-inbox.git
8 years agonntp: XHDR fixes for Message-ID lookups
Eric Wong [Tue, 22 Sep 2015 10:09:47 +0000 (10:09 +0000)]
nntp: XHDR fixes for Message-ID lookups

We'll require some modifications for HDR support, though.

8 years agonntp: implement OVER from RFC 3977
Eric Wong [Tue, 22 Sep 2015 10:09:46 +0000 (10:09 +0000)]
nntp: implement OVER from RFC 3977

This is just like the XOVER command, but allows a single Message-ID
to be given.

8 years agonntp: avoid setting Bytes and Lines headers
Eric Wong [Tue, 22 Sep 2015 10:09:45 +0000 (10:09 +0000)]
nntp: avoid setting Bytes and Lines headers

These are internal metadata should be calculated, so avoid
leaking it into the header.

8 years agonntp: ensure body lines end with CRLF
Eric Wong [Tue, 22 Sep 2015 10:09:44 +0000 (10:09 +0000)]
nntp: ensure body lines end with CRLF

It's common for mail bodies to end with LF-only, so end them with
CRLF to avoid triggering errors in clients.

8 years agonntp: support YYYYMMDD dates for commands
Eric Wong [Tue, 22 Sep 2015 10:09:43 +0000 (10:09 +0000)]
nntp: support YYYYMMDD dates for commands

RFC 3977 supports YYYYMMDD dates while retaining backwards
compatibility for old YYMMDD dates.

8 years agot/nntpd.t: fix fcntl test to ensure no failures
Eric Wong [Tue, 22 Sep 2015 10:09:42 +0000 (10:09 +0000)]
t/nntpd.t: fix fcntl test to ensure no failures

We need to run the syscall before testing for its failure :x

8 years agonntp: proper UTF-8 support (hopefully?)
Eric Wong [Mon, 21 Sep 2015 11:11:12 +0000 (11:11 +0000)]
nntp: proper UTF-8 support (hopefully?)

RFC 3977 stipulates the use of UTF-8 as the default charset,
so we shall try using that and hopefully not mangle things.

8 years agoremove bytes:: for length checks
Eric Wong [Mon, 21 Sep 2015 11:11:11 +0000 (11:11 +0000)]
remove bytes:: for length checks

Apparently, my mental model of Perl internals is still incorrect
after all these years.  I am but a simple *nix programmer:
everything is a bag of bytes to me.

This fixes a problem with UTF-8 headers from Xapian (via
"XHDR Subject [range]") triggering partial writes and writing an
extra newline to the outputs.

8 years agot/nntpd.t: improve test runnability
Eric Wong [Mon, 21 Sep 2015 11:11:10 +0000 (11:11 +0000)]
t/nntpd.t: improve test runnability

The created socket FD number may not be 3 in the test,
force it to be so inside the child process.

8 years agonntp: speed up xover slightly
Eric Wong [Mon, 21 Sep 2015 11:11:09 +0000 (11:11 +0000)]
nntp: speed up xover slightly

Reserializing the message to a string to check size wastes
considerable time and should be able to get by with slightly
less accuracy.

8 years agonntp: speed up XHDR Xref for rtin
Eric Wong [Mon, 21 Sep 2015 11:11:08 +0000 (11:11 +0000)]
nntp: speed up XHDR Xref for rtin

We could also start displaying Xref in XOVER as rtin seems to
prefer it.  Anyways this is nearly 100 times faster now and
requires no DB changes.

8 years agomsgmap: minor cleanup to move constant declaration
Eric Wong [Mon, 21 Sep 2015 11:11:07 +0000 (11:11 +0000)]
msgmap: minor cleanup to move constant declaration

This doesn't actually change anything as the constant is still
usable in other subroutines, but helps with consistency and
readability IMHO.

8 years agonntp: add "newsgroup" parameter and sort grouplist
Eric Wong [Sun, 20 Sep 2015 09:34:52 +0000 (09:34 +0000)]
nntp: add "newsgroup" parameter and sort grouplist

Using non-hierarchical mailing list names for newsgroups
might confuse traditional newsreader software and perhaps
some humans.  Allow administrators to configure newsgroups
names and hierarchies to their liking.

Sorting the grouplist alphabetically should probably be
done anyways to improve usability for some clients which
won't sort themselves.

8 years agonewsgroup: use only the first address
Eric Wong [Sun, 20 Sep 2015 09:33:45 +0000 (09:33 +0000)]
newsgroup: use only the first address

public-inboxen may be aliased to multiple email addresses,
and we have always favored the first.

8 years agonntp: fix handling of trickled responses
Eric Wong [Sun, 20 Sep 2015 03:36:11 +0000 (03:36 +0000)]
nntp: fix handling of trickled responses

We cannot use the push_back_read functionality of Danga::Socket
since it will trigger event_read on buffered data.  This would
allow a malicious (or badly implemented) client to burn CPU
without actually sending us anything.

So we still do buffering ourselves and play some tricks with
timers re-enable readability.

8 years agonntp: do not re-enable reads during long responses
Eric Wong [Sun, 20 Sep 2015 03:11:09 +0000 (03:11 +0000)]
nntp: do not re-enable reads during long responses

Long responses may leave the buffer momentarily empty,
but we must prevent read events from firing at that point.

8 years agonntpd: support systemd FD inheritance + signals
Eric Wong [Sat, 19 Sep 2015 08:42:58 +0000 (08:42 +0000)]
nntpd: support systemd FD inheritance + signals

Avoid depending on IO::Socket::INET if we can help it,
we do not need to bloat ourselves with lot of that
functionality.

8 years agonntp: article lookups by Message-ID may cross newsgroups
Eric Wong [Sat, 19 Sep 2015 02:03:40 +0000 (02:03 +0000)]
nntp: article lookups by Message-ID may cross newsgroups

Lynx seems to rely on this behavior for "ARTICLE <message-id>"

Tested with Lynx Version 2.8.8dev.12 (22 Feb 2012) on Debian wheezy.

8 years agonntp: log to FDs given by the Nntpd module
Eric Wong [Sat, 19 Sep 2015 02:03:39 +0000 (02:03 +0000)]
nntp: log to FDs given by the Nntpd module

This will allow us to redirect stdout/stderr more easily
for logging.

8 years agonntp: fix ARTICLE/HEAD/BODY/STAT
Eric Wong [Sat, 19 Sep 2015 02:03:38 +0000 (02:03 +0000)]
nntp: fix ARTICLE/HEAD/BODY/STAT

Article number is optional, but we need to update the
article number of the client connection if it was specified
(but not if it was given a Message-ID) as stipulated by
RFC 977

8 years agonntp: fix logging of long responses
Eric Wong [Sat, 19 Sep 2015 02:03:37 +0000 (02:03 +0000)]
nntp: fix logging of long responses

It's misleading to show short times on long responses.
Instead, show the long response as a separate entry on
completion or failure.

8 years agonntp: implement XPATH
Eric Wong [Sat, 19 Sep 2015 02:03:36 +0000 (02:03 +0000)]
nntp: implement XPATH

This may be helpful for sorting out duplicates.

8 years agonntp: implement XROVER, speed up XHDR for some cases
Eric Wong [Sat, 19 Sep 2015 02:03:35 +0000 (02:03 +0000)]
nntp: implement XROVER, speed up XHDR for some cases

Using Xapian allows us to implement XROVER without forking
new processes.

8 years agonntp: speed up XHDR for the Message-ID case
Eric Wong [Sat, 19 Sep 2015 02:03:34 +0000 (02:03 +0000)]
nntp: speed up XHDR for the Message-ID case

We can use our msgmap database to implement "XHDR Message-ID [range]"
commands quickly.  This helps immensely with slrnpull, which prefers
XHDR to LISTGROUP for some reason...

8 years agonntp: XOVER does not require range
Eric Wong [Sat, 19 Sep 2015 02:03:33 +0000 (02:03 +0000)]
nntp: XOVER does not require range

XOVER uses the current article if no range is given as
stipulated in RFC 2980.

8 years agonntp: implement command argument checking
Eric Wong [Sat, 19 Sep 2015 02:03:32 +0000 (02:03 +0000)]
nntp: implement command argument checking

Validate commands to make sure we do not accidentally screw up
some things or leave out some argument checking.

8 years agonntp: use long response API for LISTGROUP
Eric Wong [Sat, 19 Sep 2015 02:03:31 +0000 (02:03 +0000)]
nntp: use long response API for LISTGROUP

LISTGROUP can be expensive for giant groups, too.  Use the
long response API to improve fairness and prevent excessive
buffering.

8 years agonntp: introduce long response API for streaming
Eric Wong [Sat, 19 Sep 2015 02:03:30 +0000 (02:03 +0000)]
nntp: introduce long response API for streaming

XOVER, NEWNEWS, XHDR responses may be arbitrarily long and cause
memory usage via buffering.  This problem would exist even if we
were to optimize them by caching headers for fast retrieval and
search.

Introduce a generic API to handle all of these commands fairly
without triggering excessive buffering and unfairness of the
existing implementation.

Generating these responses is still expensive for now, but at least
the implementation is fair to other clients and prevents one client
from using one of these commands to monopolize resources away from
other clients.

8 years agonntp: use write_buf_size instead write_buf
Eric Wong [Sat, 19 Sep 2015 02:03:29 +0000 (02:03 +0000)]
nntp: use write_buf_size instead write_buf

It is shorter code and probably faster than checking an
array.

8 years agoread-only NNTP server
Eric Wong [Fri, 18 Sep 2015 01:37:53 +0000 (01:37 +0000)]
read-only NNTP server

Implementing NEWNEWS, XHDR, XOVER efficiently will require
additional caching on top of msgmap.

This seems to work with lynx and slrnpull, haven't tried clients.

DO NOT run in production, yet, denial-of-service vulnerabilities
await!

8 years agoview: do not shorten top-level messages in thread view
Eric Wong [Wed, 16 Sep 2015 10:05:13 +0000 (10:05 +0000)]
view: do not shorten top-level messages in thread view

The thread root is usually the most important, and should
be displayed in full.

8 years agoadd cgit commit-filter example
Eric Wong [Tue, 15 Sep 2015 22:01:37 +0000 (22:01 +0000)]
add cgit commit-filter example

public-inbox has search functionality, so take advantage of
good commit messages with proper titles to lookup discussion.

8 years agoINSTALL: document DBD::SQLite and DBI dependencies
Eric Wong [Tue, 15 Sep 2015 01:08:04 +0000 (01:08 +0000)]
INSTALL: document DBD::SQLite and DBI dependencies

They're optional, but probably highly useful.

8 years agoextmsg: wire up to use msgmap for prefixes
Eric Wong [Tue, 15 Sep 2015 01:08:03 +0000 (01:08 +0000)]
extmsg: wire up to use msgmap for prefixes

DBI + DBD::SQLite has much better handling of prefix lookups
than Xapian.  While we're at it, avoid linking blatantly wrong
Message-IDs to external services.

8 years agosearchidx: sync Msgmap database along with Xapian
Eric Wong [Tue, 15 Sep 2015 01:08:02 +0000 (01:08 +0000)]
searchidx: sync Msgmap database along with Xapian

We can avoid duplicating work of extracting messages from git if we
tie this to Xapian.  Of course, this ties the two features together,
but it's probably reasonable to expect that anybody who wants to use
public-inbox to serve messages to front-end users will have both.

8 years agosearchidx: hoist out rlog code
Eric Wong [Tue, 15 Sep 2015 01:08:01 +0000 (01:08 +0000)]
searchidx: hoist out rlog code

We'll be reusing this for loading msgmap.

8 years agomsgmap: add message mapping via SQLite
Eric Wong [Tue, 15 Sep 2015 01:08:00 +0000 (01:08 +0000)]
msgmap: add message mapping via SQLite

This will allow us to maintain stable article numbers for an
NNTP server independently of Xapian.

8 years agosearchview: do not link Atom feed by relevance
Eric Wong [Mon, 14 Sep 2015 00:04:30 +0000 (00:04 +0000)]
searchview: do not link Atom feed by relevance

Atom feeds only make sense when sorted by time, not when our
search indexing rules change and affect relevance.  So do not
include the relevance option when linking to Atom feeds.

However, we shall still honor the 'r' query parameter in case
somebody wants to manually include that in the URL for
testing/experimental purposes.  We simply will not advertise
it.

8 years agoview: jump to anchor of current message on References
Eric Wong [Sun, 13 Sep 2015 23:31:58 +0000 (23:31 +0000)]
view: jump to anchor of current message on References

Otherwise it could be a bit disorienting to jump to the
first message in the thread without navigation context.

8 years agoview: do not show References unless a message has them
Eric Wong [Sun, 13 Sep 2015 23:29:54 +0000 (23:29 +0000)]
view: do not show References unless a message has them

It's a waste of space and potentially confusing.

8 years agoview: use header_obj to avoid extra method calls
Eric Wong [Sun, 13 Sep 2015 23:28:53 +0000 (23:28 +0000)]
view: use header_obj to avoid extra method calls

Email::MIME will call the header_obj each time anyways, avoid
the extra method lookups and hit header_obj directly for the
header lookup.

8 years agoview: extra Atom feed link in standalone message view
Eric Wong [Sun, 13 Sep 2015 23:25:05 +0000 (23:25 +0000)]
view: extra Atom feed link in standalone message view

It might be helpful if user agents do not display the <link>
element in <head>.

8 years agoview: add Atom links in headers for per-message links
Eric Wong [Sun, 13 Sep 2015 22:35:47 +0000 (22:35 +0000)]
view: add Atom links in headers for per-message links

Some user agents will advertise the presence of a feed this
way for users to subscribe to individual topics.

8 years agosearchview: implement Atom feed for search results
Eric Wong [Sun, 13 Sep 2015 22:35:46 +0000 (22:35 +0000)]
searchview: implement Atom feed for search results

This can be helpful for folks who want to subscribe
to a particular topic or keyword.

8 years agofeed: consolidate updated tag generation
Eric Wong [Sun, 13 Sep 2015 22:35:45 +0000 (22:35 +0000)]
feed: consolidate updated tag generation

We'll be reusing this code further in the next commit.

8 years agosearchview: support displaying entire threads
Eric Wong [Sat, 12 Sep 2015 01:23:32 +0000 (01:23 +0000)]
searchview: support displaying entire threads

This hopefully makes it easy to perform queries to display
an entire thread.  Raise the limit in the threaded view to
display more results and hopefully improve the output of
thread display.

8 years agosearchview: hoist out subroutines for clarity
Eric Wong [Sat, 12 Sep 2015 01:23:31 +0000 (01:23 +0000)]
searchview: hoist out subroutines for clarity

We'll be expanding the search view to handle expanded views.

8 years agoview: more consistent prefix for ghost links
Eric Wong [Sat, 12 Sep 2015 01:23:30 +0000 (01:23 +0000)]
view: more consistent prefix for ghost links

This will be reused for search views.

8 years agoexamples/public-inbox.psgi: optional deflater
Eric Wong [Fri, 11 Sep 2015 05:42:40 +0000 (05:42 +0000)]
examples/public-inbox.psgi: optional deflater

The deflater middleware isn't standard Plack, so don't require
potential users install it.

8 years agoconstent X?HTML MIME type filtering
Eric Wong [Thu, 10 Sep 2015 00:59:08 +0000 (00:59 +0000)]
constent X?HTML MIME type filtering

Filter and View should reject X?HTML the same way.

8 years agoview: change References link to expand thread
Eric Wong [Mon, 7 Sep 2015 07:02:20 +0000 (07:02 +0000)]
view: change References link to expand thread

The expanded thread view is generally more useful.  Having links
to more links at the bottom seems to a waste of navigation time.
However, keep the '#r' anchor in case people rely on it for
links.

8 years agopublic-inbox-init: use absolute path
Eric Wong [Sun, 6 Sep 2015 07:15:26 +0000 (07:15 +0000)]
public-inbox-init: use absolute path

We actually have no business expanding (e.g. translating ~ to
$HOME) paths from the command-line argument, the shell does
that.

However, we need to make the path absolute instead.

8 years agoupdate copyright headers and email addresses
Eric Wong [Sun, 6 Sep 2015 06:59:13 +0000 (06:59 +0000)]
update copyright headers and email addresses

In the future, it should be possible to use this:

    git ls-files | UPDATE_COPYRIGHT_HOLDER='all contributors' \
      UPDATE_COPYRIGHT_USE_INTERVALS=2 \
      xargs /path/to/gnulib/build-aux/update-copyright

8 years agoMakefile.PL: conform to naming conventions
Eric Wong [Sun, 6 Sep 2015 06:51:44 +0000 (06:51 +0000)]
Makefile.PL: conform to naming conventions

Not that we actually have a bare PublicInbox module, yet.
Maybe MID can be it.

8 years agoextmsg: add note about the deficiency of the implementation
Eric Wong [Sat, 5 Sep 2015 09:16:19 +0000 (09:16 +0000)]
extmsg: add note about the deficiency of the implementation

ref: http://public-inbox.org/meta/20150905091457.GA27857@dcvr.yhbt.net/

8 years agosearchview: link users to permalink instead of thread
Eric Wong [Sat, 5 Sep 2015 09:04:53 +0000 (09:04 +0000)]
searchview: link users to permalink instead of thread

The permalink should load faster if the user had a good query
and users can easily find the rest of the message in the thread.

8 years agoextmsg: fall back to partial Message-ID matching
Eric Wong [Sat, 5 Sep 2015 08:56:54 +0000 (08:56 +0000)]
extmsg: fall back to partial Message-ID matching

In case a URL gets truncated (as is common with long URLs),
we can rely on Xapian for partial matches and bring the user
to their destination.

8 years agosearch: tweak parsing for internal queries
Eric Wong [Sat, 5 Sep 2015 08:00:12 +0000 (08:00 +0000)]
search: tweak parsing for internal queries

We should not need to use QueryParser for internal queries,
but rather for external ones.

We'll also be exposing searching Message-IDs with the "mid:" prefix
for broken mids on some servers, and enabling partial searching
with 'm' to help with URL truncations.

Since thread IDs may be volatile, they cannot be exposed to the
public, there's no reason to expose them to the query parser,
either.

Also, add 's:' as an alternative probabilistic prefix to 'subject'
as it is shorter.

8 years agosearch: note why we do not support FLAG_PURE_NOT
Eric Wong [Sat, 5 Sep 2015 07:42:44 +0000 (07:42 +0000)]
search: note why we do not support FLAG_PURE_NOT

Perhaps this can be optionally enabled in the future for smaller
sites.

8 years agosearchview: error description for invalid queries
Eric Wong [Sat, 5 Sep 2015 07:23:43 +0000 (07:23 +0000)]
searchview: error description for invalid queries

Xapian may raise exceptions on some queries.  Pass the error
along to the user so they can read Xapian documentation.

8 years agosearch: use relevance as secondary sort by default
Eric Wong [Sat, 5 Sep 2015 07:22:55 +0000 (07:22 +0000)]
search: use relevance as secondary sort by default

Might as well give relevance some weight if the timestamp is tied.

8 years agosearchview: factor out dump_mset subroutine
Eric Wong [Sat, 5 Sep 2015 07:02:14 +0000 (07:02 +0000)]
searchview: factor out dump_mset subroutine

We'll be moving atom and thread display support inline
and reducing endpoints.  Maybe it makes sense, maybe not.

8 years agosearchview: improve footer navigation
Eric Wong [Sat, 5 Sep 2015 05:54:26 +0000 (05:54 +0000)]
searchview: improve footer navigation

Aallow navigating backwards and forwards, as some pages will be
bookmarked or some browsers may not have history.  Also add a
link back to the index where they presumably came from.

While we're at it, limit the number of results we have to 25
for now to avoid making the page too big and wasting clients
memory for irrelevant results.

8 years agoview: preliminary HTML search interface
Eric Wong [Sat, 5 Sep 2015 02:52:47 +0000 (02:52 +0000)]
view: preliminary HTML search interface

This hopefully makes it easier to find things without resorting
to proprietary external services.

8 years agoview: fix broken link to ghost fallback
Eric Wong [Fri, 4 Sep 2015 08:56:30 +0000 (08:56 +0000)]
view: fix broken link to ghost fallback

Once again, the regression was introduced in
commit 16ca6b7a57266fcb466ffff005bc1d644bad14c1
(view: avoid attempting to find "subject dummy")

8 years agowww: extra redirects for the '/'-challenged
Eric Wong [Fri, 4 Sep 2015 08:49:29 +0000 (08:49 +0000)]
www: extra redirects for the '/'-challenged

Omitting a slash should not be fatal if unambiguous.  Add
fallbacks so users who expect a directory structure-like
experience can have it at the cost of one extra HTTP
request/response pair.

This matches behavior of static sites.

8 years agoview: thread view expands focused message
Eric Wong [Fri, 4 Sep 2015 08:27:45 +0000 (08:27 +0000)]
view: thread view expands focused message

Non-top-level messages still deserve to be shown in full
if they're the message in the URL.

8 years agoview: indentation adjustments for collapsed headers
Eric Wong [Fri, 4 Sep 2015 05:59:59 +0000 (05:59 +0000)]
view: indentation adjustments for collapsed headers

This makes the layout between the permalink threads and
index threads more consistent; hopefully.

8 years agoview: reduce redundant attributions in permalink refs
Eric Wong [Fri, 4 Sep 2015 05:33:17 +0000 (05:33 +0000)]
view: reduce redundant attributions in permalink refs

No point in repeating authorship when PATCH messages are
threaded and it's obvious from the top message who the author
is of the series:

 [this message] - John Smith @ 2015-09-04 00:04:20 UTC
  ` [PATCH 1/4] view: eliminate redundant [threaded|flat] link
  ` [PATCH 2/4] view: one line for thread subjects
  ` [PATCH 3/4] view: adjust spacing and indentation of index threads
  ` [PATCH 4/4] view: add missing newline to inline dump

8 years agoview: add missing newline to inline dump
Eric Wong [Fri, 4 Sep 2015 05:19:26 +0000 (05:19 +0000)]
view: add missing newline to inline dump

This fixes a regression introduced in
commit 16ca6b7a57266fcb466ffff005bc1d644bad14c1
(view: avoid attempting to find "subject dummy")

8 years agoview: adjust spacing and indentation of index threads
Eric Wong [Fri, 4 Sep 2015 05:06:03 +0000 (05:06 +0000)]
view: adjust spacing and indentation of index threads

Avoid wasting precious horizontal space by indenting children
excessively relative to the top-level parent.

8 years agoview: one line for thread subjects
Eric Wong [Fri, 4 Sep 2015 04:58:42 +0000 (04:58 +0000)]
view: one line for thread subjects

We truncate subjects in the Xapian document anyways,
so lines should not be too long and it hopefully won't
throw off the vertical display.

8 years agoview: eliminate redundant [threaded|flat] link
Eric Wong [Fri, 4 Sep 2015 03:53:52 +0000 (03:53 +0000)]
view: eliminate redundant [threaded|flat] link

We do not need to waste space with that link when
we have it conveniently placed where every message
is located.

8 years agoview: do not generate anchors in thread views
Eric Wong [Fri, 4 Sep 2015 02:18:11 +0000 (02:18 +0000)]
view: do not generate anchors in thread views

They're unused, and they can have namespace conflicts if
there's multiple full messages in the thread view.

8 years agoSearchMsg: avoid encoding Message-IDs
Eric Wong [Fri, 4 Sep 2015 02:18:10 +0000 (02:18 +0000)]
SearchMsg: avoid encoding Message-IDs

Spaces may be added when using header_str with Email::MIME->create,
so use the normal "header" parameter when setting Message-IDs
and References.

8 years agoview: avoid attempting to find "subject dummy"
Eric Wong [Fri, 4 Sep 2015 02:18:09 +0000 (02:18 +0000)]
view: avoid attempting to find "subject dummy"

This is an internal Message-ID used by Mail::Thread, to group
messages with identical subjects but common parent.  Don't
attempt to redirect users to external sites when we cannot
find it.

8 years agoextmsg: close HTML tag in response
Eric Wong [Fri, 4 Sep 2015 02:18:08 +0000 (02:18 +0000)]
extmsg: close HTML tag in response

Oops, browsers normally render this fine, though.

8 years agoconsolidate thread sorting in view
Eric Wong [Fri, 4 Sep 2015 02:18:07 +0000 (02:18 +0000)]
consolidate thread sorting in view

This is a display subroutine so it should not be in our thread
monkey-patching package, but instead in the view package.

Hopefully one day in the future, Mail::Thread will be maintained
again and we'll no longer need PublicInbox::Thread at all.

8 years agoindex: use message threading if search is available
Eric Wong [Fri, 4 Sep 2015 02:18:06 +0000 (02:18 +0000)]
index: use message threading if search is available

This lets us merge topics with different subjects with a common parent
(common in "[PATCH 0/X]" threads).  This also lets us avoid forking for
the HTML index page, too.

8 years agodoc: design_www: more accessibility guidelines
Eric Wong [Fri, 4 Sep 2015 02:18:05 +0000 (02:18 +0000)]
doc: design_www: more accessibility guidelines

Despite best intentions, things like strike-throughs and italics
won't render well and will harm accessibility.

8 years agowww: move fallback after legacy matches
Eric Wong [Thu, 3 Sep 2015 08:28:54 +0000 (08:28 +0000)]
www: move fallback after legacy matches

We do not want to get legacy URLs swallowed up by our workaround
for weird and wonky servers that attempt to unescape PATH_INFO
before the app sees it.

8 years agofeed: use application/atom+xml for Content-Type
Eric Wong [Thu, 3 Sep 2015 08:27:42 +0000 (08:27 +0000)]
feed: use application/atom+xml for Content-Type

This is the correct Content-Type for Atom feeds, especially
since we updated to use ".atom" as the suffix.

8 years agoexamples/public-inbox.psgi: update with middlewares
Eric Wong [Thu, 3 Sep 2015 08:19:48 +0000 (08:19 +0000)]
examples/public-inbox.psgi: update with middlewares

HTML, text, and probably Atom feeds should be compressed.

8 years agowww: attempt to handle Message-IDs with slashes
Eric Wong [Thu, 3 Sep 2015 04:23:21 +0000 (04:23 +0000)]
www: attempt to handle Message-IDs with slashes

Unfortunately, some HTTP servers will try to be clever
with %2F and escape it to '/', making life difficult for
us.  Fortunately, not many Message-IDs have slashes in
them.

8 years agoget rid of Message-ID compression entirely
Eric Wong [Thu, 3 Sep 2015 03:00:28 +0000 (03:00 +0000)]
get rid of Message-ID compression entirely

Provide a fallback for legacy SHA-1 messages, but do not
advertise shorter URLs anymore for data portability concerns.

This fixes a regression introduced in
commit 81a9c1b476987d845b340ab9013d26cf4487cb9a
("search: disable Message-ID compression in Xapian")
which ended up breaking thread-related endpoints for
large Message-IDs, as lookups on the SHA-1 message no longer
worked.

8 years agoExtMsg: 300 to external mailing list archives
Eric Wong [Thu, 3 Sep 2015 01:57:12 +0000 (01:57 +0000)]
ExtMsg: 300 to external mailing list archives

Since cross-posting is inevitable, we shall link to external
message archives for interopability.

8 years agosearch: disable Message-ID compression in Xapian
Eric Wong [Thu, 3 Sep 2015 01:57:11 +0000 (01:57 +0000)]
search: disable Message-ID compression in Xapian

We'll continue to compress long Message-IDs in URLs (which we know
about), but we will store entire Message-IDs in the Xapian database
to facilitate ease-of-lookups in external databases.

8 years agoview: include ghost messages in thread views
Eric Wong [Thu, 3 Sep 2015 01:57:10 +0000 (01:57 +0000)]
view: include ghost messages in thread views

We'll be expanding our ghost message lookup facilities, so
it makes sense to generate links to them even if they are
currently unknown.

8 years agoimplement external Message-ID finder
Eric Wong [Wed, 2 Sep 2015 02:37:23 +0000 (02:37 +0000)]
implement external Message-ID finder

Currently, this looks at other public-inbox configurations
served in the same process.  In the future, it will generate
links to other Message-ID lookup endpoints.

8 years agoview: avoid links to unknown compressed Message-IDs
Eric Wong [Wed, 2 Sep 2015 02:37:22 +0000 (02:37 +0000)]
view: avoid links to unknown compressed Message-IDs

Compressed Message-IDs are irreversible and may not be used
at other sites.  So avoid compressing Message-IDs we do not
know about so users have a chance of finding the message in
other archives by doing a Message-ID lookup.

8 years agoview: pre-anchor entries for flat view
Eric Wong [Wed, 2 Sep 2015 02:37:21 +0000 (02:37 +0000)]
view: pre-anchor entries for flat view

This will allow users to navigate the flat view without making extra
HTTP requests.

8 years agoview: simplify parent anchoring code
Eric Wong [Wed, 2 Sep 2015 02:37:20 +0000 (02:37 +0000)]
view: simplify parent anchoring code

This will make things easier for the next commit to pre-populate
the `$seen' hash for linking within the flat view of a thread.

8 years agoview: account for missing In-Reply-To header
Eric Wong [Wed, 2 Sep 2015 02:37:19 +0000 (02:37 +0000)]
view: account for missing In-Reply-To header

Some mail clients do not generate In-Reply-To headers,
but do generate a proper References header.

This matches the behavior of Mail::Thread as well
as our SearchIdx code to link threads in the Xapian DB.

8 years agoview: optional flat view for recent messages
Eric Wong [Wed, 2 Sep 2015 02:37:18 +0000 (02:37 +0000)]
view: optional flat view for recent messages

For still-active threads, it will likely be easier to follow
them chronologically, especially if we have links to parent
messages.

8 years agoview: close possible race condition in thread view
Eric Wong [Wed, 2 Sep 2015 02:37:17 +0000 (02:37 +0000)]
view: close possible race condition in thread view

It's possible that the Xapian index and git HEAD can be out-of-sync
and a message which existed when we did the search is no longer
accessible by the time we get to rendering it.

8 years agoview: purge email address cache after rendering thread
Eric Wong [Tue, 1 Sep 2015 20:33:24 +0000 (20:33 +0000)]
view: purge email address cache after rendering thread

We cannot allow memory in the cache to grow at an unbounded
rate in between HTTP requests.

8 years agofeed: extra newline after nav footer if list footer exists
Eric Wong [Tue, 1 Sep 2015 20:33:23 +0000 (20:33 +0000)]
feed: extra newline after nav footer if list footer exists

It makes sense to distinguish the two a little.

8 years agoview: change wording to include "thread" in footer
Eric Wong [Tue, 1 Sep 2015 20:33:22 +0000 (20:33 +0000)]
view: change wording to include "thread" in footer

Hopefully make it more obvious we're downloading or following
just one thread and not everything else.

8 years agofeed: fix <updated> tag in Atom feed
Eric Wong [Tue, 1 Sep 2015 09:28:27 +0000 (09:28 +0000)]
feed: fix <updated> tag in Atom feed

Fixes commit d44ed46ee92c78aaaed64975c4d6846613963be4
("implement per-thread Atom feeds")

8 years agoview: add missing space
Eric Wong [Tue, 1 Sep 2015 08:58:27 +0000 (08:58 +0000)]
view: add missing space

This fixes a regression introduced in
commit 1b4b2c7b8b2f2df8f114617d2e875eaf5c839ce0
("completely revamp URL structure to shorten permalinks")