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.
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)
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.
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.
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.
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.
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.
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.
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).
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.
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).
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'}
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.
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.
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.
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.
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: ")
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
Eric Wong [Fri, 25 Dec 2015 09:35:38 +0000 (09:35 +0000)]
view: move thread info near top of single view
Most framed mail viewing software has message ancestry
information near the top instead of bottom (mutt, gmane,
sylpheed, thunderbird) as it can help improve context.
Traditional netiquette also favors writing replies below
quoted (older) text for this reason; so move the thread
summary to the top of the message for context.
Since threads may be long, add a "skip" anchor link to jump to
the message body quickly, and align the date to the left column
so it's easier to tell the relative age of messages.
While we're at it, remove quotes from "id" attributes to
improve ease-of-grep-ability.
Eric Wong [Thu, 17 Dec 2015 05:37:31 +0000 (05:37 +0000)]
git: cat-file wrapper enhancements
The "cat_file" sub now allows a block to be passed for partial
processing. Additionally, a new "check" method is added to
retrieve only object metadata: (SHA-1 identifier, type, size)