~int80h/gemserv unlisted

2388cbda — Jessica Stokes 3 months ago master
Handle macOS user paths when running on macOS

This updates the usrdir option to look in /Users/ rather than /home/ when running on macOS, as this is where users' home directories live on this OS.

It also updates the config file's description of the option to hopefully be home directory agnostic.
d68b815b — Jessica Stokes 3 months ago
Quote the "proxy_all" option

The "proxy_all" option from the sample configuration not being quoted was throwing this error when running the server:

    Config error: invalid TOML value, did you mean to use a quoted string? at line 38 column 13

This patch makes sure the program will run against the included example config.toml.
f9c41edc — Melody Horn 7 months ago
don't round-trip CGI response through UTF-8

this fixes sending binary files from a CGI script
Typo in ProxyRequestRefused meta
Avoid logging 0 characters
Updated lock and fixed dir list
Bump version and dependencies
Sort directory listings, grouped by dirs then files

Heya! Thanks for putting Gemserv out there!
This changes directory listings so that all directories are listed (sorted), then all filenames are listed (sorted). You can see the output of this patch running at gemini://gemini.freeradical.zone/log/ . The downside is that now you’ll temporarily have 2 copies of the directory listing in RAM during the request: one in `list`, and a second copy divided across `dirs` and `files`. It seems unlikely that anyone’s currently using Gemserv to serve directories that just barely fit in RAM, so that seems pretty low risk. 🙂
- Kirk
update config.toml and bumb version
Implement proxy_all for proxying entire domains

I wanted to add another domain behind a reverse proxy. The existing
reverse proxy functionality seemed to only work for subpaths so I
implemented this. (I'm happy with another better way if you can point one
to me.)

I also implemented streaming responses when reverse proxying. That way
the responses stay as similar as possible to the upstream server.
Stopped ignoring Cargo.lock in git
Bumped version number
Add CGI env parameter PATH_INFO

This means that a CGI script, say, /cgi-bin/foo can be requested using a
subpath like /cgi-bin/foo/bar/baz. In that case, PATH_INFO is set to
"/bar/baz". As it is easy to compute SCRIPT_NAME along with PATH_INFO,
we also refactor it. SCRIPT_NAME now contains the URL to the script, not
just the basename of it. This is typical CGI behavior.

Since the cgi handling code was needed in two places, it was refactored
a bit. Other parts of handle_connection could be refactored similarly.

The code now supports executables inside subdirectories of cgipath.
Previously the executable had to be in cgipath, subdirs not allowed.
Url encoding and decoding
Add lang option
Error handling
Updated Readme