Commit Diff


commit - bf7596f477a81a46d19c23d8427c65e850003042
commit + d3670d7f2e67bb41b8278d330329010f0d2f274c
blob - 348b71baf585024b5a34338751c524b7a8b825e4 (mode 644)
blob + /dev/null
--- SPECS
+++ /dev/null
@@ -1,25 +0,0 @@
-
-URLs
-
-gemini://
-
-spaces are encoded as %20
-
-Request is terminated with URL CR LF
-
-response
-
-https://gemini.circumlunar.space/docs/specification.html
-
-port 1965
-
-DESIGN
-
-deamonize
-bind to port 1965
-how to handle multiple connections? threads, procs?
-parse url
-read file content if file for URL exists
-send content back as reponse to requester
-close connection
-
blob - /dev/null
blob + 423f4babe9aaca49d8fb8f9c50a42d311cd3d01f (mode 644)
--- /dev/null
+++ README
@@ -0,0 +1,64 @@
+twind
+=====
+
+twind is a simple daemon serving static files over the gemini protocol.  It is
+intended to have as few knobs as possible and has no support for a
+configuration file.
+
+Installation
+------------
+
+twind is written in plain C and you need to have the following software
+installed:
+
+* A C compiler (tested with clang and GCC)
+* LibreSSL or OpenSSL
+* POSIX compatible libc with pthreads support
+* make (both BSD and GNU make will work)
+
+twind needs a dedicated user called '_twind' and directory to run.  The
+Makefile contains a command to create the user.  Note that you shall not change
+the user's name and the directory twind needs!
+
+$ make
+# make install
+# make user
+
+TLS certificates
+----------------
+
+twind expects to find a X509 certificate and a corresponding private key
+under the following locations (which cannot be changed):
+
+* /etc/twind/twind.cert.pem
+* /etc/twind/twind.key.pem
+
+Either copy your existing keys to these locations or generate a new key and
+certificate via the Makefile.  Note that the command overwrites any existing
+key without warning!  To generate both key and certificate use the following
+command and provide the hostname via the HN variable.  If you don't provide the
+hostname the command will fail!
+
+# make setuptls HN=example.com
+
+Usage
+-----
+
+twind has support for virtual hosts.  If your gemini server is called
+example.com you have to create a dedicated sub directory under /var/twind:
+
+# cd /var/twind
+# mkdir example.com
+# <copy files into the example.com directory>
+
+In case your server is also reachable via gemini.example.com and you want to
+serve the same content as on example.com you can create a symlink.  In case you
+want to serve different content, you have to create a dedicated sub directory.
+
+twind needs root permissions to start and will drop its privileges as soon as
+possible.  It will also chroot to /var/twind.
+
+# twind
+
+For debugging purposes, you can start twind with -df option so that debugging
+and running in the foreground is enabled.
blob - c886d77f29f8015b18daa323aefd4d3d8ced23a4 (mode 644)
blob + /dev/null
--- TODO
+++ /dev/null
@@ -1,10 +0,0 @@
-# Protocol support
-
-* Handle error conditions better
-
-# twind features
-
-* add unveil support
-* security hardening
-	toctou - erst open, dann stat
-	process limiting