4 f224a3fe 2021-08-24 xhr twind is a simple daemon serving static files over the gemini protocol. It is
5 f224a3fe 2021-08-24 xhr intended to have as few knobs as possible and has no support for a
6 97aee1f8 2021-08-24 xhr configuration file. twind is named after the latin word for gemini - twins.
8 97aee1f8 2021-08-24 xhr twind is known to run on OpenBSD, FreeBSD and Linux and currently supports
10 97aee1f8 2021-08-24 xhr * Serving static gemini files
11 97aee1f8 2021-08-24 xhr * Virtual hosts
12 97aee1f8 2021-08-24 xhr * MIME handling
13 97aee1f8 2021-08-24 xhr * IPv4 and IPv6 support
15 97aee1f8 2021-08-24 xhr It doesn't support CGI handling and probably never will. There are more
16 97aee1f8 2021-08-24 xhr advanced gemini servers out there if you look for fancy stuff.
21 f224a3fe 2021-08-24 xhr twind is written in plain C and you need to have the following software
24 97aee1f8 2021-08-24 xhr * A C compiler (tested with clang >= 11 and GCC >= 9)
25 f224a3fe 2021-08-24 xhr * LibreSSL or OpenSSL
26 f224a3fe 2021-08-24 xhr * POSIX compatible libc with pthreads support
27 f224a3fe 2021-08-24 xhr * make (both BSD and GNU make will work)
29 f224a3fe 2021-08-24 xhr twind needs a dedicated user called '_twind' and directory to run. The
30 f224a3fe 2021-08-24 xhr Makefile contains a command to create the user. Note that you shall not change
31 c67880d6 2021-08-24 xhr the user's name and the directory twind needs! By default, the user ID for
32 c67880d6 2021-08-24 xhr _twind is set to 4000. If you need another user ID, change the UID variable
33 c67880d6 2021-08-24 xhr in the Makefile.
36 f224a3fe 2021-08-24 xhr # make install
39 f224a3fe 2021-08-24 xhr TLS certificates
40 f224a3fe 2021-08-24 xhr ----------------
42 f224a3fe 2021-08-24 xhr twind expects to find a X509 certificate and a corresponding private key
43 f224a3fe 2021-08-24 xhr under the following locations (which cannot be changed):
45 f224a3fe 2021-08-24 xhr * /etc/twind/twind.cert.pem
46 f224a3fe 2021-08-24 xhr * /etc/twind/twind.key.pem
48 f224a3fe 2021-08-24 xhr Either copy your existing keys to these locations or generate a new key and
49 c67880d6 2021-08-24 xhr certificate by using the Makefile. Note that the command overwrites any existing
50 f224a3fe 2021-08-24 xhr key without warning! To generate both key and certificate use the following
51 f224a3fe 2021-08-24 xhr command and provide the hostname via the HN variable. If you don't provide the
52 f224a3fe 2021-08-24 xhr hostname the command will fail!
54 f224a3fe 2021-08-24 xhr # make setuptls HN=example.com
59 f224a3fe 2021-08-24 xhr twind has support for virtual hosts. If your gemini server is called
60 f224a3fe 2021-08-24 xhr example.com you have to create a dedicated sub directory under /var/twind:
62 f224a3fe 2021-08-24 xhr # cd /var/twind
63 f224a3fe 2021-08-24 xhr # mkdir example.com
64 f224a3fe 2021-08-24 xhr # <copy files into the example.com directory>
66 f224a3fe 2021-08-24 xhr In case your server is also reachable via gemini.example.com and you want to
67 f224a3fe 2021-08-24 xhr serve the same content as on example.com you can create a symlink. In case you
68 f224a3fe 2021-08-24 xhr want to serve different content, you have to create a dedicated sub directory.
70 f224a3fe 2021-08-24 xhr twind needs root permissions to start and will drop its privileges as soon as
71 f224a3fe 2021-08-24 xhr possible. It will also chroot to /var/twind.
75 f224a3fe 2021-08-24 xhr For debugging purposes, you can start twind with -df option so that debugging
76 f224a3fe 2021-08-24 xhr and running in the foreground is enabled.
81 60333239 2021-08-24 xhr Please send feedback, patches by email to git()xosc.org. Send git formatted
82 60333239 2021-08-24 xhr patches, see https://git-send-email.io/ for more information.