Date | Commit message (Collapse) |
|
We've distilled the daemon code into one public function ("run"),
so avoid polluting the main namespace and just have users
prefix with the full package name for this rarely-used class.
|
|
This should make identifiying leftover directories
due to SIGKILL-ed tests easier.
|
|
Ugh, this enabled-iff-xapian-is-available code really
needs better testing...
|
|
Message-IDs should not be MIME encoded, but in case they are,
use the raw form for compatibility with ssoma and possibly
other tools. This prevents a potential problem where a
malicious client could confuse our storage layer into indexing
incorrect contents.
|
|
Better to throw the error back to the client ASAP if we're
out-of-descriptors. We will need to implement idle client
expiration for long-lived HTTP connections.
|
|
Vestigial pieces from the nntpd code which aren't needed because
the psgi env already has the "psgi.errors" key.
|
|
We'll have to use it some more before deciding it is a public
interface. I do hope for it to be a usable public interface
one day for other users.
|
|
We need to ensure close on handles tied to this class
get the same errors a normal "close" in Perl gets.
|
|
It seems common for users to end statements with URLs,
while it is rare for a URL itself to end with a '.' or ';'.
So make a guess and assume the URL was intended to not
include the trailing '.' or ';'
|
|
This will allow us to more easily reuse it elsewhere.
|
|
Ugh, I wonder if we can/should generate this automatically...
|
|
We now keep intermediate blank lines in messages, since it
could be used to denote logical gaps in the message
(such as giving readers a chance to opt out of "spoiler"
information).
However leading blank lines, trailing blank lines, and
trailing whitespace have no useful value we can discern;
so drop those entirely to prevent clients from eating up
vertical whitespace.
|
|
It's often not that much information and may be useful
to reduce HTTP requests a reader will want to make.
|
|
We do not need to load Plack::Request outside of WWW anymore.
|
|
This is a step towards having consistent, reproducible
test output. (ugh, but each %hash usage screws that up).
|
|
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.
|
|
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
|
|
We cannot modify %ENV directly under mod_perl (even after forking!),
so use env(1) instead to pass the environment.
|
|
It is not needed as we know git uses CRLF termination.
|
|
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.
|
|
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.
|
|
Checking the time is nearly free on modern systems with
vDSO/vsyscall/similar while sprintf is always expensive.
|
|
It may not be obvious where we are when we enter the event_write
callback. Hopefully this clarifies things.
|
|
Just in case we screwed up somewhere, we need to match up
syswrite to sysseek and we also favor procedural calls for
native types.
|
|
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.
|
|
Plack::Handler::Apache2 exists and seems to work very well.
|
|
webrick clears PATH otherwise, and we rely on git commands.
|
|
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)
|
|
Perl may complain about exit not being executed, but not die.
|
|
Oops :x
|
|
HTTP responses may be long-running or requests may be slow or
pipelined. Ensure we don't kill them off prematurely.
|
|
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.
|
|
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.
|
|
No point in loading Data::Dumper if we do not use it
in the tests.
|
|
Not sure how, but this should've always been AGPL-3.0+ like
the rest of the code, not GPL-3.0+
|
|
It's been a while...
|
|
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.
|
|
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.
|
|
Oops :x
|
|
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.
|
|
We must stash the error correctly when nesting evals, oops :x
|
|
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.
|
|
This should reduce overhead of spawning git processes
from our long-running httpd and nntpd servers.
|
|
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.
|
|
No point in comparing an empty string; length() is only
potentially expensive on big strings.
|
|
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).
|
|
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.
|
|
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.
|
|
We want to preload as much as possible in -httpd when forking
to save memory via CoW.
|
|
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.
|