4 **gmid** - dead simple zero configuration gemini server
10 \[**-c** *cert.pem*]
12 \[**-k** *key.pem*]
13 \[**-l** *access.log*]
18 is a very simple and minimal gemini server.
19 It only supports serving static content, and strive to be as simple as
23 will strip any sequence of
27 in the requests made by clients, so it's impossible to serve content
30 directory by mistake, and will also refuse to follow symlink.
36 are used to ensure that
38 dosen't do anything else than read files from the given directory and
39 accept network connections.
41 It should be noted that
43 is very simple in its implementation, and so it may not be appropriate
44 for serving site with lots of users.
45 After all, the code is single threaded and use a single process
46 (multiple requests are handled concurrently thanks to async I/O.)
48 If a user request path is a directory,
52 file inside that directory.
53 If not found, it will return an error 51 (not found) to the user.
55 The options are as follows:
59 > The certificate to use, by default is
64 > The root directory to serve.
66 > won't serve any file that is outside that directory.
70 > Print the usage and exit.
74 > The key for the certificate, by default is
79 > log to the given file instead of the standard error.
87 If CGI scripts are enabled, when a file requested by a client is
88 marked as executable it is executed and its output fed to the client.
90 Note that since this give the chance to anybody to execute possibly
92 in the served directory, this option is disabled by default.
96 To quickly getting started
98 $ # generate a cert and a key
99 $ openssl req -x509 -newkey rsa:4096 -keyout key.pem \
100 -out cert.pem -days 365 -nodes
102 $ cat <<EOF > docs/index.gmi
106 $ gmid -c cert.pem -k key.pem -d docs
108 now you can visit gemini://localhost/ with your preferred gemini client.
112 * it doesn't support virtual hosts: the host part of the request URL is
115 * it doesn't fork in the background or anything like that.