From 7d9d627d6efec748fd6de2a162e2cb5a0b1685e8 Mon Sep 17 00:00:00 2001 From: Jeffrey Armstrong Date: Fri, 29 May 2020 12:20:55 -0400 Subject: Initial code commit, and it actually works --- README.md | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 README.md (limited to 'README.md') diff --git a/README.md b/README.md new file mode 100644 index 0000000..409a40a --- /dev/null +++ b/README.md @@ -0,0 +1,57 @@ +# GNC: A Gemini Server for inetd + +GNC is a pure-Fortran implementation of a simple Gemini server for UNIX-like +systems. The server requires the inetd super-server (or compatible system +like xinetd) to work. GNC will handle all the TLS nonsense, and, if given a +root directory to work with, should provide some mild security that only +files in that directory will be served (no promises, though!). + +## Requirements + +GNC requires almost nothing: + + * A modern Fortran compiler (GNU Fortran > 7) + * OpenSSL + * The *file* command (for computing MIME types) + * inetd or equivalent (Debian calls it inetutils-inetd) + +There is a makefile provided to compile it (makefile.gnu) and a Simply +Fortran project if you're rad. + +## Usage + +These directions will focus on just getting everything running on plain, old +BSD-esque inetd. Users can probably extrapolate for other systems. + +You'll first need to set up the Gemini protocol in the file /etc/services: + +``` +gemini 1965/tcp # Gemini... +``` + +Next, you can add a nice line to inetd.conf: + +``` +gemini stream tcp nowait root /path/to/gnc gnc -pub /path/to/certs/cer +t.pem -priv /path/to/certs/key.pem -root /path/to/files/to/serve -l /path/to/logfile +``` + +Note that if you don't provide a logfile (the "-l" option), GNC will write to +/tmp/gnc.log all the time. + +The inetd.conf line above implies using *root* as the user for GNC which is super- +unecessary. Users should probably set up a sensible user instead. + +The "-root" option isn't mandatory. If you don't provide it, though, GNC will just +serve your **entire filesystem**, so maybe you should provide it... + +After that, it should just work. + +Paths ending in a slash will actually attempt to open a file "index.gmi" without +letting the end user know. You might want one of those in your root directory +from which you're serving. + +## License + +GNC is Copyright (c) 2020 Jeffrey Armstrong , and the software +is licensed under the JSON license. See LICENSE.txt for more details. -- cgit v1.2.3