Blob


2 # NAME
4 **gmid** - dead simple zero configuration gemini server
6 # SYNOPSIS
8 **gmid**
9 \[**-h**]
10 \[**-c** *cert.pem*]
11 \[**-d** *docs*]
12 \[**-k** *key.pem*]
14 # DESCRIPTION
16 **gmid**
17 is a very simple and minimal gemini server.
18 It only supports serving static content, and strive to be as simple as
19 possible.
21 **gmid**
22 will strip any sequence of
23 *../*
24 or trailing
25 *..*
26 in the requests made by clients, so it's impossible to serve content
27 outside the
28 *docs*
29 directory by mistake, and will also refuse to follow symlink.
30 Furthermore, on
31 OpenBSD,
32 pledge(2)
33 and
34 unveil(2)
35 are used to ensure that
36 **gmid**
37 dosen't do anything else than read files from the given directory and
38 accept network connections.
40 It should be noted that
41 **gmid**
42 is very simple in its implementation, and so it may not be appropriate
43 for serving site with lots of users.
44 After all, the code is single threaded and use a single process.
46 If a user request path is a directory,
47 **gmid**
48 will try to serve a
49 *index.gmi*
50 file inside that directory.
51 If not found, it will return an error 51 (not found) to the user.
53 The options are as follows:
55 **-c** *cert.pem*
57 > The certificate to use, by default is
58 > *cert.pem*.
60 **-d** *docs*
62 > The root directory to serve.
63 > **gmid**
64 > won't serve any file that is outside that directory.
66 **-h**
68 > Print the usage and exit.
70 **-k** *key.pem*
72 > The key for the certificate, by default is
73 > *key.pem*.
75 # EXAMPLES
77 To quickly getting started
79 $ # generate a cert and a key
80 $ openssl req -x509 -newkey rsa:4096 -keyout key.pem \
81 -out cert.pem -days 365 -nodes
82 $ mkdir docs
83 $ cat <<EOF > docs/index.gmi
84 # Hello world
85 test paragraph...
86 EOF
87 $ gmid -c cert.pem -k key.pem -d docs
89 now you can visit gemini://localhost/ with your preferred gemini client.
91 # CAVEATS
93 * it doesn't support virtual hosts: the host part of the request URL is
94 completely ignored.
96 * it doesn't fork in the background or anything like that.