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.
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.
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
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.
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.