From 1e6ef76203967b4981542a1b8472736b854605ad Mon Sep 17 00:00:00 2001 From: Michael Lazar Date: Mon, 23 Sep 2019 00:44:02 -0400 Subject: [PATCH] Update README.md --- README.md | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/README.md b/README.md index d44544a..8a1278d 100644 --- a/README.md +++ b/README.md @@ -147,6 +147,62 @@ optional response body on subsequent lines. The bytes generated by the CGI script will be forwarded *verbatim* to the gemini client, without any additional modificiation by the server. +## Example Configuration + +Jetforce is intended to be run behind a process manager that handles +*daemonizing* the script, redirecting output to system logs, etc. I prefer +to use [systemd](https://www.freedesktop.org/wiki/Software/systemd/) for this +because it's installed on my operating system and easy to set up. + +Here's how I configure my server over at **gemini://mozz.us**: + +``` +# /etc/systemd/system/jetforce.service +[Unit] +Description=Jetforce Server + +[Service] +Type=simple +Restart=always +RestartSec=5 +Environment="PYTHONUNBUFFERED=1" +ExecStart=/usr/local/bin/jetforce \ + --host 0.0.0.0 \ + --port 1965 \ + --hostname mozz.us \ + --dir /var/gemini \ + --tls-certfile /etc/letsencrypt/live/mozz.us/fullchain.pem \ + --tls-keyfile /etc/letsencrypt/live/mozz.us/privkey.pem \ + --tls-cafile /etc/pki/tls/jetforce_client/ca.cer + +[Install] +WantedBy=default.target +``` + +- ``--host 0.0.0.0`` allows the server to accept external connections from any + IP address over IPv4. +- ``PYTHONUNBUFFERED=1`` disables buffering `stderr` and is sometimes necessary + for logging to work. +- ``--tls-certfile`` and ``--tls-keyfile`` point to my WWW server's Let's Encrypt + certificate chain. +- ``--tls-cafile`` points to a self-signed CA that I created in order to test + accepting client TLS connections. + +With this service installed, I can start and stop the server using + +``` +systemctl start jetforce +systemctl stop jetforce +``` + +And I can view the server logs using + +``` +journalctl -u jetforce -f +``` + + + ## License This project is licensed under the [Floodgap Free Software License](https://www.floodgap.com/software/ffsl/license.html).