about summary refs log tree commit homepage
path: root/extras
DateCommit message (Collapse)
2016-09-26move website to https://yhbt.net/yahns/
HTTPS adds some level of privacy protection and helps marketing (because we care soooo much about good marketing! :P). Performance-wise, this reduces subjectAltName bloat when negotiating connections and will also speed up occasional certificate renewals when/if we drop the old name. Also, not occupying the document root of a domain will make it easier to add alternative site locations in the future, because centralization sucks and I don't like the idea of anybody paying ICANN or similar entities for domain names.
2016-08-05extras/exec_cgi: fix for HTTPoxy vulnerability
Bad clients may set the Proxy: header in the response and cause any CGI programs we execute to use the value of that header as the HTTP proxy. This affects folks calling code which respects the HTTP_PROXY environment variable in CGI programs. ref: https://httpoxy.org/
2016-07-26fix rack 2.x compatibility bugs
rack 2.x has some incompatible changes an deprecations; support it but remain compatible with rack 1.x for the next few years.
2016-07-05extras: include status messages in responses
This is mainly to benefit curl(1) users who forget to use '-f' to show failures. Not sure if I want to keep this change, it seems like bloat; but Rack::ShowStatus pages are totally overkill...
2016-06-22extras/try_gzip_static: resolve symlinks
Static gzip files may not exist for symlinks, but they could resolve to a file for which a pre-gzipped file exists.
2016-06-05extras/try_gzip_static: do not show backtrace on syscall errors
On ENAMETOOLONG and perhaps other system errors which we can do nothing about, we should not spew a giant backtrace which could be used as an easy DoS vector.
2016-04-30extras/exec_cgi: document cgit example
Apparently this can be useful to some people.
2016-02-14extras/autoindex: support hiding dotfiles
Switch option initialization to using a keyword hash since yet-another boolean is too much. Using kwargs won't work under Ruby 1.9.3 which we still support (for now). Note: being a part of extras/, there's no API stability guarantees but this should've maintained it.
2016-01-03extras/exec_cgi: fix frozen string error on slow responses
Oops, we need to duplicate our buffer in case the CGI executable returns just the header :x
2016-01-02copyright updates for 2016
Using the 'update-copyright' script from gnulib[1]: git ls-files | UPDATE_COPYRIGHT_HOLDER='all contributors' \ UPDATE_COPYRIGHT_USE_INTERVALS=2 \ xargs /path/to/gnulib/build-aux/update-copyright We're also switching to 'GPL-3.0+' as recommended by SPDX to be consistent with our gemspec and other metadata (as opposed to the longer but equivalent "GPLv3 or later"). [1] git://git.savannah.gnu.org/gnulib.git
2016-01-02enable frozen_string_literal for Ruby 2.3+
There are likely yet-to-be-discovered bugs in here. Also, keeping explicit #freeze calls for 2.2 users, since most users have not migrated to 2.3, yet.
2015-10-13copyright updates
Future updates may use the update-copyright script in gnulib: git ls-files | UPDATE_COPYRIGHT_HOLDER='all contributors' \ UPDATE_COPYRIGHT_USE_INTERVALS=2 \ xargs /path/to/gnulib/build-aux/update-copyright
2015-08-14extras/try_gzip_static: require readability on HEAD requests
Files may exist and be stat-able, but not readable. Return a 403 response for non-readable files.
2015-05-11extras/proxy_pass: remove compatibility note
We'll have to support both, it seems.
2015-05-09proxy_pass: favor literal hash over arrays for error responses
Arrays are less verbose, but they have more bytecode overhead which actually matters at runtime.
2015-04-07extras/proxy_pass: reinstate synchronous version
Since yahns/proxy_pass is not a drop-in replacement, reinstate the old, synchronous version to avoid breaking existing setups which require Rack middleware support.
2015-03-14proxy_pass: officially become a part of yahns
This will rely on rack.hijack in the future to support asynchronous execution without tying up a thread when waiting for upstreams. For now, this allows simpler code with fewer checks and the use of monotonic time on newer versions of Ruby.
2015-03-14extras/proxy_pass: support Unix domain sockets as backends
Of course, some users will prefer to bind HTTP application servers to Unix domain sockets for better isolation and (maybe) better performance.
2015-03-14extras/proxy_pass: implicit $fullpath expansion for upstreams
This is slightly more nginx-style behavior and allows simpler configuration.
2015-03-13avoid unnecessary calls #to_sym for __send__
No point in bloating our bytecode for single-use variables.
2015-03-13extras/proxy_pass: remove ERROR_502 constant
Some middlewares may attempt to modify the response body in place, so sharing this is not a good idea. We shouldn't really care about rare 502 error paths, either.
2015-03-12extras/proxy_pass: remove unused CHUNK_SIZE constant
It was never used.
2015-03-03extras/proxy_pass: flesh out upload support + tests
This module will probably become an official part of yahns soon, so finally add tests for this module.
2015-03-03extras/proxy_pass: log exceptions leading to 502
It may be useful for us to track down potential errors in our code or log when an upstream misbehaves.
2015-03-03extras/proxy_pass: do not name unused variable
"ruby -w" warns on it.
2015-02-10extras/proxy_pass: save memory in String#split arg
This saves over 400 bytes of memory in a cold code path.
2014-12-02extras/autoindex: simplify checking non-.gz
We only want to strip one ".gz" suffix to check for the original, so avoid a needless use of gsub! and use sub! instead. While we're at it, note the use of "dup.sub!" (vs plain "sub") to ensure we only handle files with a .gz suffix.
2014-09-20extras/autoindex: integrate with TryGzipStatic
This keeps autoindex-generated indices from being cluttered with redundant .gz files while still showing stuff like tar.gz files without a plain .tar companion.
2014-09-20extras/autoindex: fix misnamed variable
Oops.
2014-09-01extras/autoindex: do not link beyond top-level
No need to waste space on this (and trigger "Bad partial reference!" warnings on lynx)
2014-04-21extras/exec_cgi: pass SCRIPT_NAME from Rack env
Using the full, filesystem path name to our script is wrong and not according to RFC 3875.
2014-04-21extras/exec_cgi: allow passing custom env
Sometimes a CGI script wants to run with some environment variables set or overridden. Allow it.
2013-12-30extras/*: use binary path names
Proper POSIX filesystems are encoding-agnostic.
2013-12-22extras/exec_cgi: skip GATEWAY_INTERFACE from Rack env
We will override it internally regardless of middlewares.
2013-12-19extras/exec_cgi: document dependency on current rack.git
This was causing zombies on the bogomips.org cgit instance.
2013-11-16extras/exec_cgi: split head from body properly
The body may contain extra repeated newlines, of course
2013-11-15try_gzip_static: set no-transform on non-text types
This allows yahns to continue using sendfile when clients request gzipped/bzipped tarballs on my server.
2013-11-15extras/try_gzip_static: account for Rack::Deflater use
Clients may be requesting gzipped files through Rack::Deflater, which will attempt to further compress files.
2013-11-15encoding: binary for everything
This is mainly needed for the regexp in extras/try_gzip_static.rb (POSIX filesystem paths have no encoding, it's just a bag of bytes). Since we host apps of all types and for all (human) languages/encodings, all of our internals must be encoding-agnostic.
2013-11-12exec_cgi: drop chunk/content-length
Leave that up to Rack::Chunked/Rack::ContentLength. Chunking ourselves interacts badly with Rack::Deflater, since Deflater will blindly deflate already-chunked portions.
2013-11-12extras/*: log full backtraces for errors
In case we have bugs, this can help us find bugs in our code.
2013-11-12extras/try_gzip_static: return 404 on ENOTDIR
Some attackers may try /path/to/file/foo where /path/to/file is actually a valid path to a regular file. Of course, requests like this work on dynamic websites, but not static file mappings because Unix directories and files cannot be the same thing.
2013-11-10test: exec_cgi test uses worker_processes
Following our own advice in commit a79a6d8775171ad5cceda9bb3a77946ba60e26ce (doc: recommend worker_processes if the app uses SIGCHLD)
2013-11-07exec_cgi: release pipe/pid sooner
We don't want to leave extra resources lying around when slow clients read from us and yahns is forced to buffer. yahns delays the close of the request body until the request is fully written so response loggers can have an accurate time of how long it takes.
2013-11-06http_response: reorder wbuf_maybe on successful early flush
We can use the wbuf_close return value instead to ensure we close tmpio properly and follow the same code path as a normal (:wait_writable-triggering) buffered response would. Add a few tests to ensure we properly close the response body for exec_cgi, where I noticed zombies and started me down this rabbit hole looking for places where the response body was not closed properly.
2013-11-05extras: add proxy_pass Rack app
This is an ad-hoc reverse proxy solution. This is fully-Rack compatible at the moment, so it's synchronous. This is also only very lightly tested but I don't use it for any important serving, yet.
2013-11-05extras: add autoindex module
Unlike Rack::Directory, this this also avoids tables and CSS for preformatted HTML. This is meant to resemble nginx autoindex and index functionality (combined).
2013-11-05extras: add README
Describe the intent of the extras/ subdirectory.
2013-11-02add extras for exec_cgi and try_gzip_static
These applications are what I'll be using to run on yahns on my personal server. Including them here will be helpful for me to find bugs. I've already found some, the following commits were directly the result of playing with these extras: * stream_file: only close FDs we opened ourselves * worker-less server should not waitpid indiscriminately * http: do not drop Content-Range from response headers