]> Sergey Matveev's repositories - public-inbox.git/log
public-inbox.git
8 years agofixup Plack-related requires
Eric Wong [Mon, 29 Feb 2016 10:58:39 +0000 (10:58 +0000)]
fixup Plack-related requires

We do not need to load Plack::Request outside of WWW anymore.

8 years agot/init.t: avoid spewing directory names in output
Eric Wong [Mon, 29 Feb 2016 08:21:40 +0000 (08:21 +0000)]
t/init.t: avoid spewing directory names in output

This is a step towards having consistent, reproducible
test output. (ugh, but each %hash usage screws that up).

8 years agot/search.t: use transactions to reduce I/O load
Eric Wong [Mon, 29 Feb 2016 02:48:45 +0000 (02:48 +0000)]
t/search.t: use transactions to reduce I/O load

In case folks do not use eatmydata or tmpfs for testing,
use transactions to reduce the number of fsync calls
made and hopefully prevent drives from wearing out.

8 years agogit-http-backend: fixes for mod_perl
Eric Wong [Mon, 29 Feb 2016 01:34:33 +0000 (01:34 +0000)]
git-http-backend: fixes for mod_perl

Apache2 mod_perl does not give us a real file handle, so
we must translate that before giving that to git-http-backend(1).

Also, parse the Status: correctly for errors since we failed to
set %ENV properly before the previous fix for SpawnPP

8 years agospawnpp: use env(1) for mod_perl compatibility
Eric Wong [Mon, 29 Feb 2016 01:32:24 +0000 (01:32 +0000)]
spawnpp: use env(1) for mod_perl compatibility

We cannot modify %ENV directly under mod_perl (even after forking!),
so use env(1) instead to pass the environment.

8 years agogit-http-backend: stricter parsing of CRLF
Eric Wong [Mon, 29 Feb 2016 01:05:16 +0000 (01:05 +0000)]
git-http-backend: stricter parsing of CRLF

It is not needed as we know git uses CRLF termination.

8 years agofavor procedural calls for most private functions
Eric Wong [Mon, 29 Feb 2016 00:56:20 +0000 (00:56 +0000)]
favor procedural calls for most private functions

This makes for better compile-time checking and also helps
document which calls are private for HTTP and NNTP.

While we're at it, use IO::Handle::* functions procedurally,
too, since we know we're working with native glob handles.

8 years agodistinguish error messages intended for users vs developers
Eric Wong [Mon, 29 Feb 2016 00:41:02 +0000 (00:41 +0000)]
distinguish error messages intended for users vs developers

For error messages intended to show user error (e.g. giving
invalid options), we add a newline ("\n") at the end to
polluting the output with location information.

However, for diagnosing non-user-triggered errors, we should
show the location of where the error occured.

8 years agohttp: avoid needless time2str calls
Eric Wong [Mon, 29 Feb 2016 00:29:03 +0000 (00:29 +0000)]
http: avoid needless time2str calls

Checking the time is nearly free on modern systems with
vDSO/vsyscall/similar while sprintf is always expensive.

8 years agohttp: document event_write usage
Eric Wong [Mon, 29 Feb 2016 00:13:43 +0000 (00:13 +0000)]
http: document event_write usage

It may not be obvious where we are when we enter the event_write
callback.  Hopefully this clarifies things.

8 years agohttp: error check for sysseek on input
Eric Wong [Mon, 29 Feb 2016 00:11:23 +0000 (00:11 +0000)]
http: error check for sysseek on input

Just in case we screwed up somewhere, we need to match up
syswrite to sysseek and we also favor procedural calls for
native types.

8 years agoexamples/public-inbox.psgi: relax license to GPL-3.0+
Eric Wong [Sun, 28 Feb 2016 23:06:31 +0000 (23:06 +0000)]
examples/public-inbox.psgi: relax license to GPL-3.0+

Using the AGPL for server config files is probably overkill.
GPL-3.0+ still requires appliance vendors to disclose
configurations which seems desirable for end users.

8 years agoexamples: various Apache-related doc updates
Eric Wong [Sun, 28 Feb 2016 23:03:52 +0000 (23:03 +0000)]
examples: various Apache-related doc updates

Plack::Handler::Apache2 exists and seems to work very well.

8 years agoexamples/cgi-webrick.rb: set CGIPathEnv, update comments
Eric Wong [Sun, 28 Feb 2016 22:40:22 +0000 (22:40 +0000)]
examples/cgi-webrick.rb: set CGIPathEnv, update comments

webrick clears PATH otherwise, and we rely on git commands.

8 years agoexamples/: PSGI example updates
Eric Wong [Sun, 28 Feb 2016 22:28:50 +0000 (22:28 +0000)]
examples/: PSGI example updates

Users wanting to customize their installation should know
to about the usability of STDOUT for logging.
(and we still need manpages for -nntpd and -httpd)

8 years agospawnpp: die instead of exit on exec failure
Eric Wong [Sun, 28 Feb 2016 23:39:12 +0000 (23:39 +0000)]
spawnpp: die instead of exit on exec failure

Perl may complain about exit not being executed, but not die.

8 years agonewswww: set Content-Type properly
Eric Wong [Sun, 28 Feb 2016 23:36:45 +0000 (23:36 +0000)]
newswww: set Content-Type properly

Oops :x

8 years agohttp: support graceful shutdown like nntp
Eric Wong [Sun, 28 Feb 2016 20:57:57 +0000 (20:57 +0000)]
http: support graceful shutdown like nntp

HTTP responses may be long-running or requests may be slow or
pipelined.  Ensure we don't kill them off prematurely.

8 years agoreduce calls to close unless error checks are needed
Eric Wong [Sun, 28 Feb 2016 11:28:33 +0000 (11:28 +0000)]
reduce calls to close unless error checks are needed

We can rely on timely auto-destruction based on reference
counting; reducing the chance of redundant close(2) calls
which may hit the wront FD.

We do care about certain close calls (e.g. writing to a buffered
IO handle) if we require error-checking for write-integrity.  In
other cases, let things go out-of-scope so it can be freed
automatically after use.

8 years agosearchidx: use defined for checking EOF behavior
Eric Wong [Sun, 28 Feb 2016 11:28:32 +0000 (11:28 +0000)]
searchidx: use defined for checking EOF behavior

While empty or "0" should never appear, this allows the
reviewer to think and know less about the context in which
this check is done.

8 years agot/: remove unnecessary Dumper use
Eric Wong [Sun, 28 Feb 2016 11:28:31 +0000 (11:28 +0000)]
t/: remove unnecessary Dumper use

No point in loading Data::Dumper if we do not use it
in the tests.

8 years agosearchmsg: update + fix license header
Eric Wong [Sun, 28 Feb 2016 05:26:38 +0000 (05:26 +0000)]
searchmsg: update + fix license header

Not sure how, but this should've always been AGPL-3.0+ like
the rest of the code, not GPL-3.0+

8 years agoMANIFEST: update (generate via "git ls-files")
Eric Wong [Sun, 28 Feb 2016 05:22:07 +0000 (05:22 +0000)]
MANIFEST: update (generate via "git ls-files")

It's been a while...

8 years agohttpd: allow running if ReverseProxy is missing
Eric Wong [Sun, 28 Feb 2016 00:57:11 +0000 (00:57 +0000)]
httpd: allow running if ReverseProxy is missing

Not everybody will be running this behind a ReverseProxy;
but it's probably the likely configuration.  Anyways,
warn about this and also about Deflater being missing.

8 years agospawn: disable popen optimization for non-vfork
Eric Wong [Sun, 28 Feb 2016 04:27:11 +0000 (04:27 +0000)]
spawn: disable popen optimization for non-vfork

This is necessary since we want to be able to do arbitrary redirects
via the popen interface.  Oh well, we'll be a little slower for now
for users without vfork.  vfork users will get all the performance
benefits.

8 years agospawnpp: fix error message for stderr redirect failing
Eric Wong [Sun, 28 Feb 2016 04:27:10 +0000 (04:27 +0000)]
spawnpp: fix error message for stderr redirect failing

Oops :x

8 years agodaemon: refresh before forking
Eric Wong [Sat, 27 Feb 2016 22:36:32 +0000 (22:36 +0000)]
daemon: refresh before forking

This means we always load the PSGI server code early for
-httpd.  This may make things less compatible with existing
PSGI/Plack apps, but we prioritize our httpd for the uses
of public-inbox itself, first.

And any existing PSGI/Plack app which wants to may adapt
themselves to being preload-friendly.

8 years agospawn: fail properly if Inline fails
Eric Wong [Sat, 27 Feb 2016 22:18:04 +0000 (22:18 +0000)]
spawn: fail properly if Inline fails

We must stash the error correctly when nesting evals, oops :x

8 years agomove executables to script/ directory
Eric Wong [Sat, 27 Feb 2016 21:57:57 +0000 (21:57 +0000)]
move executables to script/ directory

This seems to match more closely with what is expected of Perl
packages based on how blib is used.  Hopefully makes the top-level
source tree less cluttered and things easier-to-find.

8 years agogit: use built-in spawn implementation for vfork
Eric Wong [Sat, 27 Feb 2016 21:31:24 +0000 (21:31 +0000)]
git: use built-in spawn implementation for vfork

This should reduce overhead of spawning git processes
from our long-running httpd and nntpd servers.

8 years agoinitial spawn implementation using vfork
Eric Wong [Sat, 27 Feb 2016 02:14:23 +0000 (02:14 +0000)]
initial spawn implementation using vfork

Under Linux, vfork maintains constant performance as
parent process size increases.  fork needs to prepare pages
for copy-on-write, requiring a linear scan of the address
space.

8 years agohttp: simplify offset calculation slightly
Eric Wong [Sat, 27 Feb 2016 02:14:21 +0000 (02:14 +0000)]
http: simplify offset calculation slightly

No point in comparing an empty string; length() is only
potentially expensive on big strings.

8 years agopsgi: enable ReverseProxy middleware by default
Eric Wong [Fri, 26 Feb 2016 09:15:36 +0000 (09:15 +0000)]
psgi: enable ReverseProxy middleware by default

ReverseProxy is the common way to run Perl applications,
so enable it by default and don't care too much about fake
requests because we don't handle any sensitive information
or rely on authentication (everything is read-only from
the WWW interface and will remain so).

8 years agodaemon: update comment about usage in httpd
Eric Wong [Fri, 26 Feb 2016 09:14:21 +0000 (09:14 +0000)]
daemon: update comment about usage in httpd

Writing a read-only IMAP server isn't out-of-scope, either,
but I've never studiied the IMAP protocol, much, unlike HTTP/1.x
or even NNTP.

8 years agohttpd: avoid loading our WWW-specific code early
Eric Wong [Fri, 26 Feb 2016 03:51:47 +0000 (03:51 +0000)]
httpd: avoid loading our WWW-specific code early

We want this to be usable as a generic httpd for other Free Software
projects, so do not force users to load our WWW code at
compile-time.

8 years agowww: add News* wrappers to preload
Eric Wong [Fri, 26 Feb 2016 03:44:23 +0000 (03:44 +0000)]
www: add News* wrappers to preload

We want to preload as much as possible in -httpd when forking
to save memory via CoW.

8 years agowww: workaround for malformed NNTP links
Eric Wong [Fri, 26 Feb 2016 01:57:57 +0000 (01:57 +0000)]
www: workaround for malformed NNTP links

Some linkifiers to create invalid HTTP links when it sees a
link intended for NNTP services.  This means we may see links
to news.public-inbox.org/inbox.comp.mail.public-inbox.meta
point to "http://" on port 80 instead of 119.  Try to
redirect users to http://public-inbox.org/meta/ in this case.

8 years agosupport protocol-relative URLs in publicinbox.$LISTNAME.url
Eric Wong [Fri, 26 Feb 2016 01:57:56 +0000 (01:57 +0000)]
support protocol-relative URLs in publicinbox.$LISTNAME.url

All URL generation in dynamic HTTP pages should be capable of
generating "https" or "http" URLs depending on the user's
preference.

8 years agogit-http-backend: extract input_to_file function
Eric Wong [Fri, 26 Feb 2016 01:57:54 +0000 (01:57 +0000)]
git-http-backend: extract input_to_file function

This will allow us to more easily read and test later.

8 years agoextmsg: do not modify shared array via prurl
Eric Wong [Fri, 26 Feb 2016 02:35:04 +0000 (02:35 +0000)]
extmsg: do not modify shared array via prurl

We cannot modify elements in any shared data strucutures
shared between requests.  Oops!

8 years agoextmsg: allow returning 404 responses
Eric Wong [Fri, 26 Feb 2016 01:57:55 +0000 (01:57 +0000)]
extmsg: allow returning 404 responses

We will be falling back and cascading to newsgroup lookups, later.

8 years agohttpd: fill in missing Danga::Socket callbacks
Eric Wong [Thu, 25 Feb 2016 05:26:23 +0000 (05:26 +0000)]
httpd: fill in missing Danga::Socket callbacks

Danga::Socket will die on us if we hit the base implementations.

8 years agogit-http-backend: avoid multi-arg print statemtents
Eric Wong [Thu, 25 Feb 2016 04:37:25 +0000 (04:37 +0000)]
git-http-backend: avoid multi-arg print statemtents

Even with output buffering disabled via IO::Handle::autoflush,
writes are not atomic unless it is a single argument passed to
"print".  Multiple arguments to "print" will show up as multiple
calls to write(2) instead of a single, atomic writev(2).

8 years agogit-http-backend: start async API for streaming
Eric Wong [Thu, 25 Feb 2016 04:02:37 +0000 (04:02 +0000)]
git-http-backend: start async API for streaming

git-http-backend may take a while, ensure we can process other
requests while waiting on it.  We currently do this via
Danga::Socket in public-inbox-httpd; but avoid exposing this
internal implementation detail to the PSGI interface and
instead only expose a callback via: $env->{'pi-httpd.async'}

8 years agogit-http-backend: start refactoring to use callback
Eric Wong [Thu, 25 Feb 2016 04:02:36 +0000 (04:02 +0000)]
git-http-backend: start refactoring to use callback

Designing for asynchronous, non-blocking operations makes
adapting for synchronous, blocking operation easy.

Going the other way around is not easy, so do it now and
allow us to be more easily adapted for non-blocking use
in the next commit...

8 years agouse pipe for git-http-backend output
Eric Wong [Thu, 25 Feb 2016 04:02:35 +0000 (04:02 +0000)]
use pipe for git-http-backend output

This allows us to stream the output to the client without buffering
everything up-front.  Next, we'll let Danga::Socket (or AE in the
future) wait for readability.

8 years agohval: implement common UI for protocol-relative URLs
Eric Wong [Thu, 25 Feb 2016 03:57:16 +0000 (03:57 +0000)]
hval: implement common UI for protocol-relative URLs

This allows users to avoid HTTPS -> HTTP downgrade warnings,
but we will also avoid encouraging them towards HTTPS, for now.

IMHO: the CA system gives a false sense of security,
TLS libraries (e.g. OpenSSL) can introduce new bugs and
problems (even to attack clients), and TLS libraries
also eats memory on cheap servers.

8 years agowww: make interface more OO
Eric Wong [Thu, 25 Feb 2016 03:10:51 +0000 (03:10 +0000)]
www: make interface more OO

This allows multiple instances the WWW app from
running within the same process space

8 years agoremove direct CGI.pm support
Eric Wong [Thu, 25 Feb 2016 03:10:50 +0000 (03:10 +0000)]
remove direct CGI.pm support

Relying on Plack::Handler::CGI is much easier for long-term
maintenance and development.

Nowadays, we even include our own httpd implementation to
facilitate easier deployment with PSGI/Plack.

8 years agowww: support $MESSAGE_ID/R/ endpoint for replies
Eric Wong [Tue, 23 Feb 2016 06:52:09 +0000 (06:52 +0000)]
www: support $MESSAGE_ID/R/ endpoint for replies

Setting the "In-Reply-To:" header via mailto: links is not
well-supported and should probably not be encouraged unless
the client situation improves.

So instead, teach users more widely-supported ways of setting
the In-Reply-To: header to ensure proper threading of replies.

8 years agoview: capture header object early
Eric Wong [Tue, 23 Feb 2016 06:52:08 +0000 (06:52 +0000)]
view: capture header object early

For future changes, this will allow us to more quickly notice
if we keep the heavy Email::MIME object around too long.

It has the side effect of avoiding extra method calls with
Email::MIME which forwards header calls to the header_obj.

8 years agot/httpd-corner: test HTTP chunking with curl
Eric Wong [Tue, 23 Feb 2016 23:17:01 +0000 (23:17 +0000)]
t/httpd-corner: test HTTP chunking with curl

Just in case my knowledge of chunking is wrong.

8 years agoinitial public-inbox-httpd implemenation
Eric Wong [Tue, 23 Feb 2016 02:52:18 +0000 (02:52 +0000)]
initial public-inbox-httpd implemenation

This is meant to provide an easy starting point for server admins.
It provides a basic HTTP server for admins unfamiliar with
configuring PSGI applications as well as being an identical
interface for management as our nntpd implementation.

This HTTP server may also be a generic Plack/PSGI server for
existing Plack/PSGI applications.

8 years agoextmsg: support "//" protocol-relative URLs
Eric Wong [Mon, 22 Feb 2016 01:36:27 +0000 (01:36 +0000)]
extmsg: support "//" protocol-relative URLs

Avoid unintentionally switching protocols if the external site
we're linking to supports both HTTP and HTTPS.

We do not want to force HTTPS everywhere because potential
bugs and performance problems in the TLS stack may outweigh
the privacy benefits.  Leave up to site authors and users
to decide whether they want HTTPS or plain old HTTP.

8 years agowww: document "git clone --mirror" usage
Eric Wong [Sat, 13 Feb 2016 23:20:20 +0000 (23:20 +0000)]
www: document "git clone --mirror" usage

Not everybody is willing to install or run ssoma; but at least
document "git clone --mirror" usage to promote data distribution.

It's wasteful to clone without "--mirror", so we'll suggest that
to avoid wasting disk space and inodes.

8 years agoexamples/public-inbox.psgi: document ReverseProxy
Eric Wong [Sat, 13 Feb 2016 23:11:44 +0000 (23:11 +0000)]
examples/public-inbox.psgi: document ReverseProxy

Running behind a ReverseProxy is a popular deployment,
so document it for users.

8 years agowww: advertise clone-ability over http/https
Eric Wong [Sat, 13 Feb 2016 23:03:32 +0000 (23:03 +0000)]
www: advertise clone-ability over http/https

All public-inbox instances shall be clone-able.

8 years agofeed: favor relative URL to Atom feed in HTML
Eric Wong [Sat, 13 Feb 2016 22:34:37 +0000 (22:34 +0000)]
feed: favor relative URL to Atom feed in HTML

Normal browsers should understand relative path names.
Atom feeds may be hosted externally and seems to need
full URLs.

8 years agoREADME: fix broken link to dc-dlvr-spam-flow
Eric Wong [Fri, 12 Feb 2016 09:56:09 +0000 (09:56 +0000)]
README: fix broken link to dc-dlvr-spam-flow

Reported-by: Jordi Bunster <jordi@bunster.org>
8 years agoview: fix link to top-level ghost parent
Eric Wong [Mon, 8 Feb 2016 18:11:54 +0000 (18:11 +0000)]
view: fix link to top-level ghost parent

In an single-message thread with a ghost parent, we need to
go up level from the current Message-ID before appending the
parent message to us.

8 years agoview: simplify topic handling based on subjects
Eric Wong [Mon, 8 Feb 2016 11:20:59 +0000 (11:20 +0000)]
view: simplify topic handling based on subjects

Dropping "[FOO]" prefixes for the purposes of summarization
is tricky and we end up with odd display behavior.
Just show Subject line changes as the writer intended
(with the exception of normalization to strip the "Re: ")

8 years agofeed: declare alternate link to HTML interface
Eric Wong [Mon, 8 Feb 2016 07:37:43 +0000 (07:37 +0000)]
feed: declare alternate link to HTML interface

It seems we need to declare "alternate" and "text/html" at least
for feed readers.

8 years agosupport smart HTTP cloning
Eric Wong [Sun, 7 Feb 2016 08:35:29 +0000 (08:35 +0000)]
support smart HTTP cloning

This requires POST and (small file) upload support from the
PSGI/Plack web server.  CGI.pm is currently not supported with
this feature.

We'll serve everything git can handle by default for performance
in the general case.

To avoid introducing cognitive overhead for sysadmins managing
existing HTTP backends, we do not introduce new configuration
directives.

Thus, setting http.uploadpack=false in the relevant git config
file for each public-inbox (ssoma) git repo will disable smart
HTTP for CPU/memory-constrained systems.

Technically we could support http.receivepack to allow posting
messages to a public-inbox over HTTP(S), but that breaks
the public-inbox model of encouraging users to Cc: everyone.
Again, we encourage users to Cc: everyone to reduce the chance
of a public-inbox becoming a centralized point of
failure/censorship.

8 years agot/cgi.t: fix broken test for dumb HTTP
Eric Wong [Thu, 4 Feb 2016 09:15:54 +0000 (09:15 +0000)]
t/cgi.t: fix broken test for dumb HTTP

This should not be dependent on what is in the users'
$HOME config, oops.

8 years agowww: support git cloning via dumb HTTP
Eric Wong [Tue, 2 Feb 2016 04:00:08 +0000 (04:00 +0000)]
www: support git cloning via dumb HTTP

This is enabled by default, for now.
Smart HTTP cloning support will be added later, but it will
be optional since it can be highly CPU and memory intensive.

8 years agodoc: misc cleanups and whitespace additions
Eric Wong [Mon, 1 Feb 2016 04:06:08 +0000 (04:06 +0000)]
doc: misc cleanups and whitespace additions

Add a few newlines for readability (perhaps at the expense of
economy).  Stop mentioning "Open Source" as it is redundant
and "Free Software" fits our goals, better.

8 years agoview: reference ghost parent in permalink view
Eric Wong [Mon, 1 Feb 2016 01:35:24 +0000 (01:35 +0000)]
view: reference ghost parent in permalink view

We should not hide the parent Message-ID in this view;
give the user the option to find the message in other archives.

8 years agoview: cleanup permalink Thread: header display
Eric Wong [Sat, 30 Jan 2016 23:28:37 +0000 (23:28 +0000)]
view: cleanup permalink Thread: header display

The word "skip" can be confusing.  Instead, spell out "scroll down"
for the user to read and only display that text when the thread
is sufficiently long.

8 years agoview: do not kill whitespace in permalink thread timestamp
Eric Wong [Sat, 30 Jan 2016 23:27:18 +0000 (23:27 +0000)]
view: do not kill whitespace in permalink thread timestamp

There's no need to HTML escape a timestamp we generate ourselves.
We need to preserve the leading space and can't use the "oneline"
semantics to preserve alignment.

8 years agoview: explain why we do not use blockquote
Eric Wong [Sat, 16 Jan 2016 04:56:53 +0000 (04:56 +0000)]
view: explain why we do not use blockquote

Inevitably, somebody will care about semantic HTML; but
preserving the original intent of the email author is
important.

8 years agowww: fix redirection loops
Eric Wong [Sat, 9 Jan 2016 10:53:10 +0000 (10:53 +0000)]
www: fix redirection loops

Sometimes users forget trailing slashes; but we should not punish
them with infinite loops.

8 years agoview: fix Atom feed link in full message view page
Eric Wong [Sat, 9 Jan 2016 09:45:22 +0000 (09:45 +0000)]
view: fix Atom feed link in full message view page

Oops :x

8 years agohval: new should not strip leading spaces
Eric Wong [Sat, 9 Jan 2016 09:45:21 +0000 (09:45 +0000)]
hval: new should not strip leading spaces

We should be able to use this for ASCII art and paragraphs

8 years agohval: use more appropriate hvals for documentation
Eric Wong [Sat, 9 Jan 2016 09:45:20 +0000 (09:45 +0000)]
hval: use more appropriate hvals for documentation

Not needed, but this is good documentation.  Some of these values
should never have newlines.

8 years agoTODO: add a few more items
Eric Wong [Wed, 6 Jan 2016 00:08:59 +0000 (00:08 +0000)]
TODO: add a few more items

Sometimes I contribute to projects with centralization-inducing
things like reply-to-list and bug trackers.

I dislike those things myself, but most of the time I can deal with
them... for now.

8 years agoHACKING: more docs about our philosophy
Eric Wong [Wed, 6 Jan 2016 00:01:42 +0000 (00:01 +0000)]
HACKING: more docs about our philosophy

Reiterating reasons behind what we do might help drive our point
across better.

8 years agouse Perl POD instead of pandoc-flavored Markdown
Eric Wong [Mon, 4 Jan 2016 22:18:57 +0000 (22:18 +0000)]
use Perl POD instead of pandoc-flavored Markdown

This project is currently implemented in Perl, and pod2man is
probably more common among potential users and developers of
this project.

8 years agolistener: pass accepted address to post_accept
Eric Wong [Mon, 4 Jan 2016 20:18:46 +0000 (20:18 +0000)]
listener: pass accepted address to post_accept

We can avoid making getpeername syscalls this way.

8 years agodoc: add TODO.html to public website
Eric Wong [Mon, 4 Jan 2016 01:05:58 +0000 (01:05 +0000)]
doc: add TODO.html to public website

HTML has one major advantage over plain text: <a href=...> links
That's about it.

8 years agoview: label "relevance" in threaded search view
Eric Wong [Mon, 4 Jan 2016 01:01:41 +0000 (01:01 +0000)]
view: label "relevance" in threaded search view

The threaded search view is somewhat alien to new users,
so ensure we label the word "relevance" for them.

8 years agomisc doc updates
Eric Wong [Mon, 4 Jan 2016 00:56:07 +0000 (00:56 +0000)]
misc doc updates

Strongly emphasize decentralization, as that was actually the
main impetus for my interest in git.

8 years agowww: comments for denoting Plack::Request vs CGI
Eric Wong [Sun, 3 Jan 2016 23:49:49 +0000 (23:49 +0000)]
www: comments for denoting Plack::Request vs CGI

We'll probably want to continue supporting CGI for mod_perl
compatibility.

8 years agoexamples/public-inbox.psgi: shorten to simplify
Eric Wong [Sun, 3 Jan 2016 23:48:16 +0000 (23:48 +0000)]
examples/public-inbox.psgi: shorten to simplify

Enable deflater using a shorter string as we do with other
middlewares, and use single quotes to denote we do not need
interpolation.

8 years agowww: redirect with query string
Eric Wong [Sat, 2 Jan 2016 23:13:18 +0000 (23:13 +0000)]
www: redirect with query string

We use query strings for search and index pages, so
we should not drop them if somebody types a URL by hand
and omits the trailing slash.

8 years agoview: fixup indentation nesting in search
Eric Wong [Thu, 31 Dec 2015 07:37:17 +0000 (07:37 +0000)]
view: fixup indentation nesting in search

Oops, the rarely-accessed threaded search view was completely
broken.  Additionally, the normal threading depths were broken
when we attempted to go up-thread and replies got nested
improperly

Followup to commit be984ce279776d4513b4ca1bff05ebecafdd1bad
("view: thread using <ul> instead of <table>")

8 years agoview: "thread" in per-message view goes back to /t/
Eric Wong [Wed, 30 Dec 2015 22:31:49 +0000 (22:31 +0000)]
view: "thread" in per-message view goes back to /t/

Linking to the expanded thread page probably makes more sense
as it avoid unnecessary scanning for the thread summary.

8 years agoview: avoid excessive indentation in thread summary
Eric Wong [Wed, 30 Dec 2015 21:56:56 +0000 (21:56 +0000)]
view: avoid excessive indentation in thread summary

We already use "` " (backtick + space) to denote one indentation
level, so do not excessively indent and always pad with one
level less of spaces.

The 'x' operator in Perl handles negative values, so subtracting
one from level=0 will result in an empty string without spaces.

8 years agoview: thread using <ul> instead of <table>
Eric Wong [Wed, 30 Dec 2015 21:34:10 +0000 (21:34 +0000)]
view: thread using <ul> instead of <table>

On second viewing, this does render small cues which makes the
output more pleasant for lynx users.  We avoid injecting the
root (level=0) message into a list since it still wastes
precious horizontal whitespace on small displays.

This also results in small reductions in bandwidth usage as
it takes fewer tags/whitespace to render unordered lists.

8 years agot/plack.t: fix test *with* plack installed... oops
Eric Wong [Sat, 26 Dec 2015 23:56:15 +0000 (23:56 +0000)]
t/plack.t: fix test *with* plack installed... oops

Fixes commit 83fedde4cde6539386c9d3ecf37fb99d74af8d93
("tests: fixup requirements for tests")

8 years agotests: fixup requirements for tests
e@80x24.org [Sat, 26 Dec 2015 23:38:17 +0000 (23:38 +0000)]
tests: fixup requirements for tests

We should be able to run tests on bare bones systems more easily.

8 years agodoc: minor updates to trim down the README
Eric Wong [Sat, 26 Dec 2015 22:01:16 +0000 (22:01 +0000)]
doc: minor updates to trim down the README

We'll continue developing and supporting ssoma, but it's unlikely to
gain much adoption in its current form; so stop cluttering up our
own README with it.

8 years agodoc: use ".html" instead of ".txt.html" for website
Eric Wong [Sat, 26 Dec 2015 22:00:07 +0000 (22:00 +0000)]
doc: use ".html" instead of ".txt.html" for website

Shorter URLs are easier to read, remember, and more efficient.

8 years agouse "Atom feed" consistently in headers/footers
Eric Wong [Sat, 26 Dec 2015 01:26:40 +0000 (01:26 +0000)]
use "Atom feed" consistently in headers/footers

While having the extra " feed" is noisy in the main topic
landing page, it is useful in headers/footers which have
plenty of space to be more descriptive.

8 years agosearchview: fix unclosed tags in threaded search results
Eric Wong [Sat, 26 Dec 2015 01:14:27 +0000 (01:14 +0000)]
searchview: fix unclosed tags in threaded search results

Oops, we've had this forever and we also lacked a space
between the this was noticed while adding an extra
line between the "Search results ordered by" header
and actual messages.

8 years agoview: reduce main landing page weight
Eric Wong [Sat, 26 Dec 2015 01:11:15 +0000 (01:11 +0000)]
view: reduce main landing page weight

Hopefully, "mbox.gz" is sufficiently understandabe that
we can get rid of the "title" attribute in <a> tags
(we already omitted the title in other pages).

Additionally, drop the '@' in front of the date.
The date should be obvious and is not necessary for
headers without author attribution.

8 years agosearchview: fix up Atom feed in search results
Eric Wong [Sat, 26 Dec 2015 01:01:52 +0000 (01:01 +0000)]
searchview: fix up Atom feed in search results

Oops :x  We need better testing...
Fixes: commit 4c2c2325d2948ec5340e2fcafbee798cf568f5fd
("rename 'GitCatFile' package to 'Git'")

8 years agosearchview: fixup stupid syntax error
Eric Wong [Sat, 26 Dec 2015 00:46:32 +0000 (00:46 +0000)]
searchview: fixup stupid syntax error

Fixes: commit 398e29344ecc43548a7d3998bb5d2fcee62d66cd
("view: favor whitespace wrap in <head>")

Oops.

8 years agoview: favor whitespace wrap in <head>
Eric Wong [Fri, 25 Dec 2015 11:48:27 +0000 (11:48 +0000)]
view: favor whitespace wrap in <head>

If we bite the bullet and rely on inline CSS, we might as well
only specify it once per page instead of inline in every <pre>
tag which may handle UGC.  So this actually saves us a small
amount of bandwith on most pages which have multiple <pre>
start tags.

8 years agoexamples/public-inbox.psgi: make output chunky by default
Eric Wong [Fri, 25 Dec 2015 11:21:40 +0000 (11:21 +0000)]
examples/public-inbox.psgi: make output chunky by default

HTTP/1.1 clients will want persistent connections and
need to know response terminations.

8 years agoview: fixup ghost message errors from threading tweaks
Eric Wong [Fri, 25 Dec 2015 10:55:58 +0000 (10:55 +0000)]
view: fixup ghost message errors from threading tweaks

Ghost message links didn't show up too well after
commit bc067a7562a586bed92401fe1084bbe423b9451a
("view: move thread info near top of single view")

Additionally, attribution lacked a space when subjects changed
mid-thread.