Date | Commit message (Collapse) |
|
This lets us one-line git commands easily like ``, but without
having to remember --git-dir or escape arguments.
|
|
Allow users to do wacky things here if they really wish...
It's bad practice, but at least allow other readers to
mock users of these headers :P
|
|
We currently do not display links to snapshots, but may in the
future (optionally, like cgit). However, support snapshots for
compatibility reasons in case people had cached URLs or
auto-generated them somewhere.
We won't natively support xz and bzip2 just yet, but will
document (at least in comments) how to enable these expensive
compression schemes via git-config(1). Also, support disabling
certain archive types to twart URL guessing or old cached links
from spiders burning bandwidth.
In retrospect, enabling snapshots for my own cgit views was a
bad idea since it wastes bandwidth from crawlers and is
is often not useful for users with maintainer-built files
(e.g. "configure" from "configure.ac" for autoconf, where
only the latter is stored in git and the former is
generated in release tarballs).
|
|
Not sure of a better way around this, but the Plack::Test
manpage documents this variable so it should be supported.
|
|
It seems incompatible with Starman and probably confuses other
HTTP/1.0-only servers, too. Our -httpd will respect it and
requires it for persistent connections.
Followup-to: dca2724e0aeb ("examples: disable Chunked response in PSGI example")
|
|
Use Plack::Test::ExternalServer to simplify our test code
and prepare to add more tests for future changes.
Add a check for patch generation while we're at it, since
patch generation may use our internal "pi.async" API.
|
|
We can reuse the existing code for cloning ssoma repositories
to serve normal git repos for repobrowse.
Also, this finally adds a test to fallback to dumb cloning when
http.uploadPack is disabled for the git repository to save
CPU/memory on the host machine.
|
|
...From PI_REPOBROWSE_CONFIG. The "PI_" prefix is
a bit too long and "repobrowse" is nearly an independent
project at this point from a user-perspective.
|
|
We'll be moving to Danga::Socket for giant diff generation in
future commits. So this is a step towards being more
callback-driven...
|
|
This should allow us to avoid polluting stderr output when
HTTP clients inevitably request broken revisions.
|
|
Mostly following cgit, except we do not serve redundant
text-only output which wastes bandwidth and doesn't preserve
pre-formatting layout which is critical to some messages.
|
|
We shall save clients the overhead of making extra HTTP requests
to follow partial paths. This ought to improve cache hit
effectiveness on both the server and client side by reducing
the potential different pages we may set.
|
|
We need to preserve the query string to avoid breakage.
|
|
We'll be UTF-8 imperialists for now and assume all of our
textual output is UTF-8 for the benefit of browsers.
|
|
We'll use HTML attributes + anchor links to link to filenames
in coming commits.
|
|
We want to use 'repobrowse' terminology consistently despite
it being longer. Furthermore, "repo-config" is an old git
command (nowadays git-config(1)) which may confuse some old
git users.
|
|
For human-visible HTML pages, avoid the trailing slash as that
can reduce cache hits in both the server (using varnish) and
clients. Typical web browsers are all capable of following
301 redirects without difficulty or human interaction.
We do not redirect for endpoints which may be consumed by
automated tools as that may cause compatibility problems. For
example, curl(1) does not automatically follow redirects and
needs the "-L" flag to do so.
|
|
We mainly call it "repobrowse" (all lowercase), so do not imply
it is two separate words by capitalizing "Browse".
|
|
We need to ensure failure detection works.
|
|
We use the same path: header at the top and allow jumping
back to the tree when displaying blobs.
|
|
This is similar to the "blob" endpoint, except it shows
trees as a directory.
|
|
This lets us one-line git commands easily like ``, but without
having to remember --git-dir or escape arguments.
|
|
We need to parse diffs with all manner of funky file names :<
|
|
This allows us to reduce installation dependencies while
retaining performance as it favors HTTP::Parser::XS when
it is installed and available.
PLACK_HTTP_PARSER_PP may be set to 1 to force a pure Perl
parser for testing.
|
|
We cannot risk using all of a users' disk space buffering
gigantic requests. Use the defaults git gives us since
we primarily host git repositories.
|
|
HTTP::Parser::XS::PP does not reject excessively large
headers like the XS version. Ensure we reject headers
over 16K since public-inbox should never need such large
request headers.
|
|
This means we can avoid false-positives when inheriting multiple
Unix domain sockets.
|
|
Non-socket activation users will want to install Net::Server
for daemonization, pid file writing, and user/group switching.
|
|
Due to the deterministic way reference counting works,
we do not want to drop references to existing FDs
even if we no longer need the glob reference; the actual
FD is all we can pass through on exec.
|
|
Just to ensure we hit the code path independently of
WWW code.
|
|
Listening on Unix domain sockets can be convenient for running
behind reverse proxies, avoiding port conflicts, limiting access,
or avoiding the overhead (if any) of TCP over loopback.
|
|
This allows us to share more code between daemons and avoids
having to make additional syscalls for preparing REMOTE_HOST
and REMOTE_PORT in the PSGI env in -httpd.
This will also make supporting HTTP (and NNTP) over Unix sockets
easier in a future commit.
|
|
This should make identifiying leftover directories
due to SIGKILL-ed tests easier.
|
|
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 ';'
|
|
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.
|
|
HTTP responses may be long-running or requests may be slow or
pipelined. Ensure we don't kill them off prematurely.
|
|
No point in loading Data::Dumper if we do not use it
in the tests.
|
|
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.
|
|
Just in case my knowledge of chunking is wrong.
|
|
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.
|
|
This should not be dependent on what is in the users'
$HOME config, oops.
|
|
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.
|
|
Sometimes users forget trailing slashes; but we should not punish
them with infinite loops.
|
|
Fixes commit 83fedde4cde6539386c9d3ecf37fb99d74af8d93
("tests: fixup requirements for tests")
|
|
We should be able to run tests on bare bones systems more easily.
|
|
HTTP/1.1 clients will want persistent connections and
need to know response terminations.
|
|
We'll be using it for more than just cat-file.
Adding a `popen' API for internal use allows us to save a bunch
of code in other places.
|