libpxd
libpxd (pollux-daemon) is a Gemini server library written in C. It contains a server implementation, polluxd, that exercises most (all?) of libpxd's capabilities in various forms.
If you want to run a Gemini server, check out:
Features
polluxd (server implementation) features:
- Designed with security in mind.
- CGI support (can run chrooted and as alternative users); uses security features to isolate CGI environments from any server key data.
- Path hierarchies can be checked for client certificate existence and/or whitelist matching
- Supports data streaming. The server can read from pipes and sockets in addition to regular files.
- Properly uses TLS close-notify messages so you can be sure you got your files in-tact without out-of-band confirmation.
Library features:
- Asynchronous IO with a poll-compatible interface.
- Simple interface - examples/serve_file.c is a simple async-capable server written in ~180loc
- Adjustable settings for server behaviors and hooks for TLS and Gemini events.
libpxd is released under the 3-clause BSD license.
Perhaps unsurprisingly, this capsule is powered by libpxd.
Building
This project uses standard Makefiles. You need to either copy libpxd.so to a standard library location (e.g. /usr/lib) or set the LD_LIBRARY_PATH variable before running polluxd.
tar -xf libpxd-xxxx.tar.gz cd libpxd-xxxx make LD_LIBRARY_PATH=$PWD/libpxd ./polluxd/polluxd -f /path/to/config/file
Documentation
polluxd is simple - it takes only 3 options:
-fspecifies the configuration file to use -D causes polluxd to not daemonize -V causes polluxd to print its version information and exit
Source code
A tildegit repo has been set up