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 OpenBSD,
31 pledge(3)
32 and
33 unveil(3)
34 are used to ensure that
35 **gmid**
36 dosen't do anything else than read files from the given directory and
37 accept network connections.
39 It should be noted that
40 **gmid**
41 is very simple in its implementation, and so it may not be appropriate
42 for serving site with lots of users.
43 After all, the code is single threaded and use a single process.
45 The options are as follows:
47 **-c** *cert.pem*
49 > The certificate to use, by default is
50 > *cert.pem*
52 **-d** *docs*
54 > The root directory to serve.
55 > **gmid**
56 > won't serve any file that is outside that directory.
58 **-h**
60 > Print the usage and exit
62 **-k** *key.pem*
64 > The key for the certificate, by default is
65 > *key.pem*
67 # EXAMPLES
69 To quickly getting started
71 $ # generate a cert and a key
72 $ openssl req -x509 -newkey rsa:4096 -keyout key.pem \
73 -out cert.pem -days 365 -nodes
74 $ mkdir docs
75 $ cat <<EOF > docs/index.gmi
76 # Hello world
77 test paragraph...
78 EOF
79 $ gmid -c cert.pem -k key.pem -d docs
81 now you can visit gemini://localhost/ with your preferred gemini client.
83 # CAVEATS
85 * it doesn't support virtual host: the host part of the request URL is
86 completely ignored.
88 * it doesn't fork in the background or anything like that.
90 OpenBSD 6.8 - October 2, 2020