Blob


2 # NAME
4 **gmid** - dead simple 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.
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 The options are as follows:
48 **-c** *cert.pem*
50 > The certificate to use, by default is
51 > *cert.pem*
53 **-d** *docs*
55 > The root directory to serve.
56 > **gmid**
57 > won't serve any file that is outside that directory.
59 **-h**
61 > Print the usage and exit
63 **-k** *key.pem*
65 > The key for the certificate, by default is
66 > *key.pem*
68 # EXAMPLES
70 To quickly getting started
72 $ # generate a cert and a key
73 $ openssl req -x509 -newkey rsa:4096 -keyout key.pem \
74 -out cert.pem -days 365 -nodes
75 $ mkdir docs
76 $ cat <<EOF > docs/index.gmi
77 # Hello world
78 test paragraph...
79 EOF
80 $ gmid -c cert.pem -k key.pem -d docs
82 now you can visit gemini://localhost/ with your preferred gemini client.
84 # CAVEATS
86 * it doesn't support virtual host: the host part of the request URL is
87 completely ignored.
89 * it doesn't fork in the background or anything like that.