Blame


1 f28d96d3 2021-01-25 op .\" Copyright (c) 2021 Omar Polo <op@omarpolo.com>
2 3e4749f7 2020-10-02 op .\"
3 3e4749f7 2020-10-02 op .\" Permission to use, copy, modify, and distribute this software for any
4 3e4749f7 2020-10-02 op .\" purpose with or without fee is hereby granted, provided that the above
5 3e4749f7 2020-10-02 op .\" copyright notice and this permission notice appear in all copies.
6 3e4749f7 2020-10-02 op .\"
7 3e4749f7 2020-10-02 op .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8 3e4749f7 2020-10-02 op .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9 3e4749f7 2020-10-02 op .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10 3e4749f7 2020-10-02 op .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11 3e4749f7 2020-10-02 op .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12 3e4749f7 2020-10-02 op .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13 3e4749f7 2020-10-02 op .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14 e58a447a 2021-07-29 op .Dd $Mdocdate: July 29 2021$
15 3f47867e 2021-04-16 op .Dt GMID 1
16 3e4749f7 2020-10-02 op .Os
17 3e4749f7 2020-10-02 op .Sh NAME
18 3e4749f7 2020-10-02 op .Nm gmid
19 714685c1 2021-01-30 op .Nd simple and secure Gemini server
20 3e4749f7 2020-10-02 op .Sh SYNOPSIS
21 3e4749f7 2020-10-02 op .Nm
22 3e4749f7 2020-10-02 op .Bk -words
23 38d4db74 2021-02-04 op .Op Fl fnv
24 15902770 2021-01-15 op .Op Fl c Ar config
25 8b743dda 2021-06-29 op .Op Fl D Ar macro Ns = Ns Ar value
26 8e8b2e25 2021-04-28 op .Op Fl P Ar pidfile
27 38d4db74 2021-02-04 op .Ek
28 38d4db74 2021-02-04 op .Nm
29 38d4db74 2021-02-04 op .Bk -words
30 ba65dcc8 2021-06-29 op .Op Fl 6hVv
31 f28d96d3 2021-01-25 op .Op Fl d Pa certs-dir
32 f28d96d3 2021-01-25 op .Op Fl H Ar hostname
33 721e2325 2020-11-18 op .Op Fl p Ar port
34 f28d96d3 2021-01-25 op .Op Fl x Pa cgi
35 f28d96d3 2021-01-25 op .Op Pa dir
36 3e4749f7 2020-10-02 op .Ek
37 3e4749f7 2020-10-02 op .Sh DESCRIPTION
38 3e4749f7 2020-10-02 op .Nm
39 8ff40039 2021-05-24 op is a simple and minimal gemini server that can serve static files,
40 8ff40039 2021-05-24 op execute CGI scripts and talk to FastCGI applications.
41 eb699783 2021-01-18 op It can run without a configuration file with a limited set of features
42 eb699783 2021-01-18 op available.
43 3007f565 2021-02-04 op .Pp
44 3007f565 2021-02-04 op .Nm
45 3007f565 2021-02-04 op rereads the configuration file when it receives
46 3007f565 2021-02-04 op .Dv SIGHUP .
47 3e4749f7 2020-10-02 op .Pp
48 eb699783 2021-01-18 op The options are as follows:
49 f28d96d3 2021-01-25 op .Bl -tag -width 14m
50 eb699783 2021-01-18 op .It Fl c Pa config
51 f28d96d3 2021-01-25 op Specify the configuration file.
52 8b743dda 2021-06-29 op .It Fl D Ar macro Ns = Ns Ar value
53 8b743dda 2021-06-29 op Define
54 8b743dda 2021-06-29 op .Ar macro
55 8b743dda 2021-06-29 op to be set to
56 8b743dda 2021-06-29 op .Ar value
57 8b743dda 2021-06-29 op on the command line.
58 8b743dda 2021-06-29 op Overrides the definition of
59 8b743dda 2021-06-29 op .Ar macro
60 8b743dda 2021-06-29 op in the config file if present.
61 46af8c6c 2021-01-27 op .It Fl f
62 46af8c6c 2021-01-27 op Stays and logs on the foreground.
63 eb699783 2021-01-18 op .It Fl n
64 eb699783 2021-01-18 op Check that the configuration is valid, but don't start the server.
65 f0a01fc7 2021-10-09 op If specified two or more time, dump the configuration in addition to
66 f0a01fc7 2021-10-09 op verify it.
67 8e8b2e25 2021-04-28 op .It Fl P Pa pidfile
68 301e039d 2021-07-29 op Write daemon's pid to the given location.
69 2b520ad5 2021-07-09 op .Ar pidfile
70 2b520ad5 2021-07-09 op will also act as lock: if another process is holding a lock on that
71 2b520ad5 2021-07-09 op file,
72 8e8b2e25 2021-04-28 op .Nm
73 2b520ad5 2021-07-09 op will refuse to start.
74 eb699783 2021-01-18 op .El
75 3e4749f7 2020-10-02 op .Pp
76 eb699783 2021-01-18 op If no configuration file is given,
77 fab952e1 2020-10-03 op .Nm
78 f28d96d3 2021-01-25 op will look for the following options
79 f28d96d3 2021-01-25 op .Bl -tag -width 14m
80 85dff1f9 2021-01-11 op .It Fl 6
81 85dff1f9 2021-01-11 op Enable IPv6.
82 f28d96d3 2021-01-25 op .It Fl d Pa certs-path
83 f28d96d3 2021-01-25 op Directory where certificates for the config-less mode are stored.
84 301e039d 2021-07-29 op By default it is
85 f28d96d3 2021-01-25 op .Pa $XDG_DATA_HOME/gmid ,
86 f28d96d3 2021-01-25 op i.e.
87 f28d96d3 2021-01-25 op .Pa ~/.local/share/gmid .
88 71cf3975 2021-01-25 op .It Fl H Ar hostname
89 2b520ad5 2021-07-09 op The hostname
90 301e039d 2021-07-29 op .Po
91 2b520ad5 2021-07-09 op .Ar localhost
92 301e039d 2021-07-29 op by default
93 301e039d 2021-07-29 op .Pc .
94 f28d96d3 2021-01-25 op Certificates for the given
95 f28d96d3 2021-01-25 op .Ar hostname
96 f28d96d3 2021-01-25 op are searched inside the
97 f28d96d3 2021-01-25 op .Pa certs-dir
98 f28d96d3 2021-01-25 op directory given with the
99 f28d96d3 2021-01-25 op .Fl d
100 f28d96d3 2021-01-25 op option.
101 714685c1 2021-01-30 op They have the form
102 f28d96d3 2021-01-25 op .Pa hostname.cert.pem
103 f28d96d3 2021-01-25 op and
104 f28d96d3 2021-01-25 op .Pa hostname.key.pem .
105 301e039d 2021-07-29 op If a certificate or a key doesn't exist for a given hostname, they
106 301e039d 2021-07-29 op will be generated automatically.
107 ba65dcc8 2021-06-29 op .It Fl h , Fl -help
108 fab952e1 2020-10-03 op Print the usage and exit.
109 721e2325 2020-11-18 op .It Fl p Ar port
110 eb699783 2021-01-18 op The port to listen on, by default 1965.
111 ba65dcc8 2021-06-29 op .It Fl V , Fl -version
112 ba65dcc8 2021-06-29 op Print the version and exit.
113 8904fa0e 2021-01-27 op .It Fl v
114 3abf91b0 2021-02-07 op Verbose mode.
115 3abf91b0 2021-02-07 op Multiple
116 3abf91b0 2021-02-07 op .Fl v
117 3abf91b0 2021-02-07 op options increase the verbosity.
118 f28d96d3 2021-01-25 op .It Fl x Pa path
119 301e039d 2021-07-29 op Enable execution of
120 301e039d 2021-07-29 op .Sx CGI
121 301e039d 2021-07-29 op scripts.
122 eb699783 2021-01-18 op See the description of the
123 eb699783 2021-01-18 op .Ic cgi
124 301e039d 2021-07-29 op option in the
125 eb699783 2021-01-18 op .Sq Servers
126 301e039d 2021-07-29 op section below to learn how
127 f28d96d3 2021-01-25 op .Pa path
128 eb699783 2021-01-18 op is processed.
129 eb699783 2021-01-18 op Cannot be provided more than once.
130 f28d96d3 2021-01-25 op .It Pa dir
131 f28d96d3 2021-01-25 op The root directory to serve.
132 f28d96d3 2021-01-25 op By default the current working directory is assumed.
133 3e4749f7 2020-10-02 op .El
134 eb699783 2021-01-18 op .Sh CONFIGURATION FILE
135 8b743dda 2021-06-29 op The configuration file is divided into three sections:
136 eb699783 2021-01-18 op .Bl -tag -width xxxx
137 8b743dda 2021-06-29 op .It Sy Macros
138 8b743dda 2021-06-29 op User-defined variables may be defined and used later, simplifying the
139 8b743dda 2021-06-29 op configuration file.
140 eb699783 2021-01-18 op .It Sy Global Options
141 eb699783 2021-01-18 op Global settings for
142 eb699783 2021-01-18 op .Nm .
143 eb699783 2021-01-18 op .It Sy Servers
144 f28d96d3 2021-01-25 op Virtual hosts definition.
145 eb699783 2021-01-18 op .El
146 eb699783 2021-01-18 op .Pp
147 eb699783 2021-01-18 op Within the sections, empty lines are ignored and comments can be put
148 eb699783 2021-01-18 op anywhere in the file using a hash mark
149 eb699783 2021-01-18 op .Pq Sq # ,
150 eb699783 2021-01-18 op and extend to the end of the current line.
151 eb699783 2021-01-18 op A boolean is either the symbol
152 eb699783 2021-01-18 op .Sq on
153 eb699783 2021-01-18 op or
154 eb699783 2021-01-18 op .Sq off .
155 f28d96d3 2021-01-25 op A string is a sequence of characters wrapped in double quotes,
156 f28d96d3 2021-01-25 op .Dq like this .
157 eaf7f776 2021-06-29 op Multiple strings one next to the other are joined into a single
158 eaf7f776 2021-06-29 op string:
159 eaf7f776 2021-06-29 op .Bd -literal -offset indent
160 eaf7f776 2021-06-29 op # equivalent to "temporary-failure"
161 eaf7f776 2021-06-29 op block return 40 "temporary" "-" "failure"
162 eaf7f776 2021-06-29 op .Ed
163 8b743dda 2021-06-29 op .Pp
164 2b520ad5 2021-07-09 op Furthermore, quoting is necessary only when a string needs to contain
165 528f37cd 2021-07-09 op special characters
166 528f37cd 2021-07-09 op .Pq like spaces or punctuation ,
167 528f37cd 2021-07-09 op something that looks like a number or a reserved keyword.
168 2b520ad5 2021-07-09 op The last example could have been written also as:
169 2b520ad5 2021-07-09 op .Bd -literal -offset indent
170 2b520ad5 2021-07-09 op block return 40 temporary "-" failure
171 2b520ad5 2021-07-09 op .Ed
172 2b520ad5 2021-07-09 op .Pp
173 8b743dda 2021-06-29 op Strict ordering of the sections is not enforced, so that is possible
174 8b743dda 2021-06-29 op to mix macros, options and
175 8b743dda 2021-06-29 op .Ic server
176 8b743dda 2021-06-29 op blocks.
177 8b743dda 2021-06-29 op However, defining all the
178 8b743dda 2021-06-29 op .Ic server
179 8b743dda 2021-06-29 op blocks after the macros and the global options is recommended.
180 528f37cd 2021-07-09 op .Pp
181 528f37cd 2021-07-09 op Newlines are often optional, except around top-level instructions, and
182 528f37cd 2021-07-09 op semicolons
183 528f37cd 2021-07-09 op .Dq \&;
184 528f37cd 2021-07-09 op can also be optionally used to separate options.
185 528f37cd 2021-07-09 op .Pp
186 528f37cd 2021-07-09 op Additional configuration files can be included with the
187 528f37cd 2021-07-09 op .Ic include
188 528f37cd 2021-07-09 op keyword, for example:
189 528f37cd 2021-07-09 op .Bd -literal -offset indent
190 528f37cd 2021-07-09 op include "/etc/gmid.conf.local"
191 528f37cd 2021-07-09 op .Ed
192 8b743dda 2021-06-29 op .Ss Macros
193 8b743dda 2021-06-29 op Macros can be defined that will later be expanded in context.
194 8b743dda 2021-06-29 op Macro names must start with a letter, digit or underscore and may
195 8b743dda 2021-06-29 op contain any of those characters.
196 4f9a2760 2021-07-02 op Macros names may not be reserved words.
197 bfb076ed 2021-06-29 op Macros are not expanded inside quotes.
198 528f37cd 2021-07-09 op .Pp
199 528f37cd 2021-07-09 op Two kinds of macros are supported: variable-like and proper macros.
200 528f37cd 2021-07-09 op When a macro is invoked with a
201 528f37cd 2021-07-09 op .Dq $
202 528f37cd 2021-07-09 op before its name its expanded as a string, whereas when it's invoked
203 528f37cd 2021-07-09 op with a
204 528f37cd 2021-07-09 op .Dq @
205 528f37cd 2021-07-09 op its expanded in-place.
206 8b743dda 2021-06-29 op .Pp
207 8b743dda 2021-06-29 op For example:
208 8b743dda 2021-06-29 op .Bd -literal -offset indent
209 8b743dda 2021-06-29 op dir = "/var/gemini"
210 2d06ae62 2021-07-11 op certdir = "/etc/keys"
211 528f37cd 2021-07-09 op common = "lang it; auto index on"
212 8b743dda 2021-06-29 op
213 8b743dda 2021-06-29 op server "foo" {
214 ad15003b 2021-07-11 op root $dir "/foo" # -> /var/gemini/foo
215 2d06ae62 2021-07-11 op cert $certdir "/foo.crt" # -> /etc/keys/foo.crt
216 2d06ae62 2021-07-11 op key $certdir "/foo.pem" # -> /etc/keys/foo.pem
217 528f37cd 2021-07-09 op @common
218 8b743dda 2021-06-29 op }
219 8b743dda 2021-06-29 op .Ed
220 eb699783 2021-01-18 op .Ss Global Options
221 eb699783 2021-01-18 op .Bl -tag -width 12m
222 ae08ec7d 2021-01-25 op .It Ic chroot Pa path
223 ae08ec7d 2021-01-25 op .Xr chroot 2
224 ae08ec7d 2021-01-25 op the process to the given
225 ae08ec7d 2021-01-25 op .Pa path .
226 ae08ec7d 2021-01-25 op The daemon has to be run with root privileges and thus the option
227 ae08ec7d 2021-01-25 op .Ic user
228 714685c1 2021-01-30 op needs to be provided, so privileges can be dropped.
229 714685c1 2021-01-30 op Note that
230 ae08ec7d 2021-01-25 op .Nm
231 714685c1 2021-01-30 op will enter the chroot after loading the TLS keys, but before opening
232 714685c1 2021-01-30 op the virtual host root directories.
233 714685c1 2021-01-30 op It's recommended to keep the TLS keys outside the chroot.
234 ae08ec7d 2021-01-25 op Future version of
235 ae08ec7d 2021-01-25 op .Nm
236 1de92289 2021-04-15 op may enforce this.
237 2b92a447 2021-02-06 op .It Ic ipv6 Ar bool
238 2b520ad5 2021-07-09 op Enable or disable IPv6 support, off by default.
239 d19951cf 2021-07-09 op .It Ic map Ar mime-type Cm to-ext Ar file-extension
240 2b520ad5 2021-07-09 op Map
241 2b520ad5 2021-07-09 op .Ar mime-type
242 2b92a447 2021-02-06 op to the given
243 2b520ad5 2021-07-09 op .Ar file-extension .
244 2b92a447 2021-02-06 op Both argument are strings.
245 2b92a447 2021-02-06 op .It Ic port Ar portno
246 2b92a447 2021-02-06 op The port to listen on.
247 2b520ad5 2021-07-09 op 1965 by default.
248 a709ddf5 2021-02-07 op .It Ic prefork Ar number
249 a709ddf5 2021-02-07 op Run the specified number of server processes.
250 a709ddf5 2021-02-07 op This increases the performance and prevents delays when connecting to
251 a709ddf5 2021-02-07 op a server.
252 2b520ad5 2021-07-09 op When not in config-less mode,
253 a709ddf5 2021-02-07 op .Nm
254 2b520ad5 2021-07-09 op runs 3 server processes by default.
255 2c3e53da 2021-03-03 op The maximum number allowed is 16.
256 2b92a447 2021-02-06 op .It Ic protocols Ar string
257 2b92a447 2021-02-06 op Specify the TLS protocols to enable.
258 2b92a447 2021-02-06 op Refer to
259 2b92a447 2021-02-06 op .Xr tls_config_parse_protocols 3
260 2b92a447 2021-02-06 op for the valid protocol string values.
261 2b92a447 2021-02-06 op By default, both TLSv1.3 and TLSv1.2 are enabled.
262 2b92a447 2021-02-06 op Use
263 2b92a447 2021-02-06 op .Dq tlsv1.3
264 2b92a447 2021-02-06 op to enable only TLSv1.3.
265 ae08ec7d 2021-01-25 op .It Ic user Ar string
266 ae08ec7d 2021-01-25 op Run the daemon as the given user.
267 eb699783 2021-01-18 op .El
268 eb699783 2021-01-18 op .Ss Servers
269 eb699783 2021-01-18 op Every virtual host is defined by a
270 eb699783 2021-01-18 op .Ic server
271 eb699783 2021-01-18 op block:
272 eb699783 2021-01-18 op .Bl -tag -width Ds
273 eb699783 2021-01-18 op .It Ic server Ar hostname Brq ...
274 75fbb178 2021-01-28 op Match the server name using shell globbing rules.
275 2b520ad5 2021-07-09 op It can be an explicit name,
276 de27389e 2021-01-21 op .Ar www.example.com ,
277 de27389e 2021-01-21 op or a name including a wildcards,
278 de27389e 2021-01-21 op .Ar *.example.com .
279 eb699783 2021-01-18 op .El
280 eb699783 2021-01-18 op .Pp
281 eb699783 2021-01-18 op Followed by a block of options that is enclosed in curly brackets:
282 eb699783 2021-01-18 op .Bl -tag -width Ds
283 cc8c2901 2021-04-29 op .It Ic alias Ar name
284 cc8c2901 2021-04-29 op Specify an additional alias
285 cc8c2901 2021-04-29 op .Ar name
286 cc8c2901 2021-04-29 op for this server.
287 2b92a447 2021-02-06 op .It Ic auto Ic index Ar bool
288 2b92a447 2021-02-06 op If no index file is found, automatically generate a directory listing.
289 2b520ad5 2021-07-09 op Disabled by default.
290 2b92a447 2021-02-06 op .It Ic block Op Ic return Ar code Op Ar meta
291 2b92a447 2021-02-06 op Send a reply and close the connection;
292 2b520ad5 2021-07-09 op by default
293 2b92a447 2021-02-06 op .Ar code
294 2b92a447 2021-02-06 op is 40
295 2b92a447 2021-02-06 op and
296 2b92a447 2021-02-06 op .Ar meta
297 2b92a447 2021-02-06 op is
298 2b520ad5 2021-07-09 op .Dq temporary failure .
299 2b92a447 2021-02-06 op If
300 2b92a447 2021-02-06 op .Ar code
301 2b92a447 2021-02-06 op is in the 3x range, then
302 2b92a447 2021-02-06 op .Ar meta
303 2b520ad5 2021-07-09 op is mandatory.
304 2b92a447 2021-02-06 op Inside
305 2b92a447 2021-02-06 op .Ar meta ,
306 2b520ad5 2021-07-09 op the following special sequences are supported:
307 fd1ae83d 2021-06-11 op .Bl -tag -width Ds -compact
308 2b92a447 2021-02-06 op .It \&%\&%
309 2b92a447 2021-02-06 op is replaced with a single
310 2b92a447 2021-02-06 op .Sq \&% .
311 2b92a447 2021-02-06 op .It \&%p
312 2b92a447 2021-02-06 op is replaced with the request path.
313 2b92a447 2021-02-06 op .It \&%q
314 2b92a447 2021-02-06 op is replaced with the query string of the request.
315 2b92a447 2021-02-06 op .It \&%P
316 2b92a447 2021-02-06 op is replaced with the server port.
317 2b92a447 2021-02-06 op .It \&%N
318 2b92a447 2021-02-06 op is replaced with the server name.
319 2b92a447 2021-02-06 op .El
320 eb699783 2021-01-18 op .It Ic cert Pa file
321 eb699783 2021-01-18 op Path to the certificate to use for this server.
322 eb699783 2021-01-18 op The
323 eb699783 2021-01-18 op .Pa file
324 eb699783 2021-01-18 op should contain a PEM encoded certificate.
325 eb699783 2021-01-18 op This option is mandatory.
326 eb699783 2021-01-18 op .It Ic cgi Pa path
327 301e039d 2021-07-29 op Execute
328 301e039d 2021-07-29 op .Sx CGI
329 301e039d 2021-07-29 op scripts that matches
330 eb699783 2021-01-18 op .Pa path
331 87f2b68b 2021-02-02 op using shell globbing rules.
332 6119e13e 2021-01-19 op .It Ic default type Ar string
333 6119e13e 2021-01-19 op Set the default media type that is used if the media type for a
334 6119e13e 2021-01-19 op specified extension is not found.
335 6119e13e 2021-01-19 op If not specified, the
336 6119e13e 2021-01-19 op .Ic default type
337 6119e13e 2021-01-19 op is set to
338 6119e13e 2021-01-19 op .Dq application/octet-stream .
339 2b92a447 2021-02-06 op .It Ic entrypoint Pa path
340 dafaf467 2021-04-15 op Handle all the requests for the current virtual host using the
341 301e039d 2021-07-29 op .Sx CGI
342 301e039d 2021-07-29 op script at
343 2b520ad5 2021-07-09 op .Pa path ,
344 2b520ad5 2021-07-09 op relative to the current document root.
345 efacb859 2021-07-09 op .It Ic env Ar name Cm = Ar value
346 9cc630aa 2021-04-28 op Set the environment variable
347 9cc630aa 2021-04-28 op .Ar name
348 9cc630aa 2021-04-28 op to
349 9cc630aa 2021-04-28 op .Ar value
350 9cc630aa 2021-04-28 op when executing CGI scripts.
351 9cc630aa 2021-04-28 op Can be provided more than once.
352 8ff40039 2021-05-24 op .\" don't document the "spawn <prog>" form because it probably won't
353 ada16f87 2021-06-11 op .\" be kept.
354 762b9b99 2021-07-09 op .It Ic fastcgi Oo Ic tcp Oc Pa socket Oo Cm port Ar port Oc
355 301e039d 2021-07-29 op Enable
356 301e039d 2021-07-29 op .Sx FastCGI
357 301e039d 2021-07-29 op instead of serving files.
358 8ff40039 2021-05-24 op The
359 8ff40039 2021-05-24 op .Pa socket
360 2b520ad5 2021-07-09 op can either be a UNIX-domain socket or a TCP socket.
361 8ff40039 2021-05-24 op If the FastCGI application is listening on a UNIX domain socket,
362 8ff40039 2021-05-24 op .Pa socket
363 8ff40039 2021-05-24 op is a local path name within the
364 8ff40039 2021-05-24 op .Xr chroot 2
365 8ff40039 2021-05-24 op root directory of
366 8ff40039 2021-05-24 op .Nm .
367 8ff40039 2021-05-24 op Otherwise, the
368 8ff40039 2021-05-24 op .Ic tcp
369 8ff40039 2021-05-24 op keyword must be provided and
370 8ff40039 2021-05-24 op .Pa socket
371 8ff40039 2021-05-24 op is interpreted as a hostname or an IP address.
372 8ff40039 2021-05-24 op .Ar port
373 8ff40039 2021-05-24 op can be either a port number or the name of a service enclosed in
374 8ff40039 2021-05-24 op double quotes.
375 2b520ad5 2021-07-09 op If not specified defaults to 9000.
376 2b92a447 2021-02-06 op .It Ic index Ar string
377 2b92a447 2021-02-06 op Set the directory index file.
378 2b92a447 2021-02-06 op If not specified, it defaults to
379 2b92a447 2021-02-06 op .Pa index.gmi .
380 2b92a447 2021-02-06 op .It Ic key Pa file
381 2b92a447 2021-02-06 op Specify the private key to use for this server.
382 2b92a447 2021-02-06 op The
383 2b92a447 2021-02-06 op .Pa file
384 2b92a447 2021-02-06 op should contain a PEM encoded private key.
385 2b92a447 2021-02-06 op This option is mandatory.
386 05c23a54 2021-01-19 op .It Ic lang Ar string
387 05c23a54 2021-01-19 op Specify the language tag for the text/gemini content served.
388 05c23a54 2021-01-19 op If not specified, no
389 05c23a54 2021-01-19 op .Dq lang
390 05c23a54 2021-01-19 op parameter will be added in the response.
391 c8b74339 2021-01-24 op .It Ic location Pa path Brq ...
392 c8b74339 2021-01-24 op Specify server configuration rules for a specific location.
393 c8b74339 2021-01-24 op The
394 c8b74339 2021-01-24 op .Pa path
395 c8b74339 2021-01-24 op argument will be matched against the request path with shell globbing
396 c8b74339 2021-01-24 op rules.
397 6016a593 2021-01-30 op In case of multiple location statements in the same context, the first
398 6016a593 2021-01-30 op matching location will be put into effect and the later ones ignored.
399 6016a593 2021-01-30 op Therefore is advisable to match for more specific paths first and for
400 6016a593 2021-01-30 op generic ones later on.
401 c8b74339 2021-01-24 op A
402 c8b74339 2021-01-24 op .Ic location
403 c8b74339 2021-01-24 op section may include most of the server configuration rules
404 c8b74339 2021-01-24 op except
405 3d132b28 2021-07-09 op .Ic alias , Ic cert , Ic cgi , Ic entrypoint , Ic env , Ic key ,
406 3d132b28 2021-07-09 op .Ic location No and Ic param .
407 2c43dcce 2021-06-17 op .It Ic log Ar bool
408 2c43dcce 2021-06-17 op Enable or disable the logging for the current server or location block.
409 efacb859 2021-07-09 op .It Ic param Ar name Cm = Ar value
410 ada16f87 2021-06-11 op Set the param
411 ada16f87 2021-06-11 op .Ar name
412 ada16f87 2021-06-11 op to
413 ada16f87 2021-06-11 op .Ar value
414 ada16f87 2021-06-11 op for FastCGI.
415 ff05125e 2021-10-15 op .It Ic ocsp Ar file
416 ff05125e 2021-10-15 op Specify an OCSP response to be stapled during TLS handshakes
417 ff05125e 2021-10-15 op with this server.
418 ff05125e 2021-10-15 op The
419 ff05125e 2021-10-15 op .Ar file
420 ff05125e 2021-10-15 op should contain a DER-format OCSP response retrieved from an
421 ff05125e 2021-10-15 op OCSP server for the
422 ff05125e 2021-10-15 op .Ic cert
423 ff05125e 2021-10-15 op in use.
424 ff05125e 2021-10-15 op If the OCSP response in
425 ff05125e 2021-10-15 op .Ar file
426 ff05125e 2021-10-15 op is empty, OCSP stapling will not be used.
427 ff05125e 2021-10-15 op The default is to not use OCSP stapling.
428 2b92a447 2021-02-06 op .It Ic root Pa directory
429 2b520ad5 2021-07-09 op Specify the root directory for this server
430 2b520ad5 2021-07-09 op .Pq alas the current Dq document root .
431 2b520ad5 2021-07-09 op It's relative to the chroot if enabled.
432 02be96c6 2021-02-09 op .It Ic require Ic client Ic ca Pa path
433 02be96c6 2021-02-09 op Allow requests only from clients that provide a certificate signed by
434 02be96c6 2021-02-09 op the CA certificate in
435 02be96c6 2021-02-09 op .Pa path .
436 02be96c6 2021-02-09 op It needs to be a PEM-encoded certificate and it's not relative to the
437 02be96c6 2021-02-09 op chroot.
438 6abda252 2021-02-06 op .It Ic strip Ar number
439 6abda252 2021-02-06 op Strip
440 6abda252 2021-02-06 op .Ar number
441 0773413c 2021-05-15 op components from the beginning of the path before doing a lookup in the
442 0773413c 2021-05-15 op root directory.
443 0773413c 2021-05-15 op It's also considered for the
444 6abda252 2021-02-06 op .Ar meta
445 2b92a447 2021-02-06 op parameter in the scope of a
446 6abda252 2021-02-06 op .Ic block return .
447 6abda252 2021-02-06 op .El
448 72342dc9 2020-11-06 op .Sh CGI
449 87f2b68b 2021-02-02 op When a request for an executable file matches the
450 87f2b68b 2021-02-02 op .Ic cgi
451 301e039d 2021-07-29 op rule, that file will be executed and its output fed to the client.
452 72342dc9 2020-11-06 op .Pp
453 ee655e64 2021-02-01 op The CGI scripts are executed in the directory they reside and inherit
454 a7b9bb4d 2021-01-24 op the environment from
455 0ed56567 2020-11-06 op .Nm
456 0ed56567 2020-11-06 op with these additional variables set:
457 ee655e64 2021-02-01 op .Bl -tag -width 24m
458 28ec6178 2021-01-24 op .It Ev GATEWAY_INTERFACE
459 ee655e64 2021-02-01 op .Dq CGI/1.1
460 ee655e64 2021-02-01 op .It Ev GEMINI_DOCUMENT_ROOT
461 ee655e64 2021-02-01 op The root directory of the virtual host.
462 ee655e64 2021-02-01 op .It Ev GEMINI_SCRIPT_FILENAME
463 ee655e64 2021-02-01 op Full path to the CGI script being executed.
464 ee655e64 2021-02-01 op .It Ev GEMINI_URL
465 ee655e64 2021-02-01 op The full IRI of the request.
466 ee655e64 2021-02-01 op .It Ev GEMINI_URL_PATH
467 ee655e64 2021-02-01 op The path of the request.
468 ee655e64 2021-02-01 op .It Ev PATH_INFO
469 ee655e64 2021-02-01 op The portion of the requested path that is derived from the the IRI
470 ee655e64 2021-02-01 op path hierarchy following the part that identifies the script itself.
471 ee655e64 2021-02-01 op Can be unset.
472 ee655e64 2021-02-01 op .It Ev PATH_TRANSLATED
473 ee655e64 2021-02-01 op Present if and only if
474 ee655e64 2021-02-01 op .Ev PATH_INFO
475 ee655e64 2021-02-01 op is set.
476 ee655e64 2021-02-01 op It represent the translation of the
477 ee655e64 2021-02-01 op .Ev PATH_INFO .
478 ee655e64 2021-02-01 op .Nm
479 ee655e64 2021-02-01 op builds this by appending the
480 ee655e64 2021-02-01 op .Ev PATH_INFO
481 ee655e64 2021-02-01 op to the virtual host directory root.
482 ee655e64 2021-02-01 op .It Ev QUERY_STRING
483 ee655e64 2021-02-01 op The decoded query string.
484 ee655e64 2021-02-01 op .It Ev REMOTE_ADDR , Ev REMOTE_HOST
485 ee655e64 2021-02-01 op Textual representation of the client IP.
486 ee655e64 2021-02-01 op .It Ev REQUEST_METHOD
487 ee655e64 2021-02-01 op This is present only for RFC3875 (CGI) compliance.
488 ee655e64 2021-02-01 op It's always set to the empty string.
489 ee655e64 2021-02-01 op .It Ev SCRIPT_NAME
490 ee655e64 2021-02-01 op The part of the
491 ee655e64 2021-02-01 op .Ev GEMINI_URL_PATH
492 ee655e64 2021-02-01 op that identifies the current CGI script.
493 ee655e64 2021-02-01 op .It Ev SERVER_NAME
494 ee655e64 2021-02-01 op The name of the server
495 ee655e64 2021-02-01 op .It Ev SERVER_PORT
496 ee655e64 2021-02-01 op The port the server is listening on.
497 28ec6178 2021-01-24 op .It Ev SERVER_PROTOCOL
498 ee655e64 2021-02-01 op .Dq GEMINI
499 0ed56567 2020-11-06 op .It Ev SERVER_SOFTWARE
500 ee655e64 2021-02-01 op The name and version of the server, i.e.
501 fba809b5 2021-09-19 op .Dq gmid/1.7.3
502 677afbd3 2020-12-02 op .It Ev AUTH_TYPE
503 28ec6178 2021-01-24 op The string "Certificate" if the client used a certificate, otherwise
504 28ec6178 2021-01-24 op unset.
505 677afbd3 2020-12-02 op .It Ev REMOTE_USER
506 677afbd3 2020-12-02 op The subject of the client certificate if provided, otherwise unset.
507 677afbd3 2020-12-02 op .It Ev TLS_CLIENT_ISSUER
508 28ec6178 2021-01-24 op The is the issuer of the client certificate if provided, otherwise
509 28ec6178 2021-01-24 op unset.
510 677afbd3 2020-12-02 op .It Ev TLS_CLIENT_HASH
511 677afbd3 2020-12-02 op The hash of the client certificate if provided, otherwise unset.
512 ee655e64 2021-02-01 op The format is
513 ee655e64 2021-02-01 op .Dq ALGO:HASH .
514 89541eee 2021-04-13 op .It Ev TLS_VERSION
515 89541eee 2021-04-13 op The TLS version negotiated with the peer.
516 89541eee 2021-04-13 op .It Ev TLS_CIPHER
517 89541eee 2021-04-13 op The cipher suite negotiated with the peer.
518 89541eee 2021-04-13 op .It Ev TLS_CIPHER_STRENGTH
519 89541eee 2021-04-13 op The strength in bits for the symmetric cipher that is being used with
520 89541eee 2021-04-13 op the peer.
521 b63e30ff 2021-02-07 op .It Ev TLS_CLIENT_NOT_AFTER
522 b63e30ff 2021-02-07 op The time corresponding to the end of the validity period of the peer
523 b63e30ff 2021-02-07 op certificate in the ISO 8601 format
524 b63e30ff 2021-02-07 op .Pq e.g. Dq 2021-02-07T20:17:41Z .
525 b63e30ff 2021-02-07 op .It Ev TLS_CLIENT_NOT_BEFORE
526 b63e30ff 2021-02-07 op The time corresponding to the start of the validity period of the peer
527 b63e30ff 2021-02-07 op certificate in the ISO 8601 format.
528 0ed56567 2020-11-06 op .El
529 ada16f87 2021-06-11 op .Sh FastCGI
530 ada16f87 2021-06-11 op .Nm
531 ada16f87 2021-06-11 op optionally supports FastCGI.
532 ada16f87 2021-06-11 op A
533 ada16f87 2021-06-11 op .Ic fastcgi
534 ada16f87 2021-06-11 op rule must be present in a server or location block.
535 ada16f87 2021-06-11 op Then, all requests matching that server or location will be handled
536 ada16f87 2021-06-11 op via the specified FastCGI backend.
537 a5d310bc 2020-11-10 op .Pp
538 ada16f87 2021-06-11 op By default the following variables
539 ada16f87 2021-06-11 op .Pq parameters
540 ada16f87 2021-06-11 op are sent, and carry the same semantics as with CGI.
541 ada16f87 2021-06-11 op More parameters can be added with the
542 ada16f87 2021-06-11 op .Ic param
543 ada16f87 2021-06-11 op option.
544 2b520ad5 2021-07-09 op .Pp
545 ada16f87 2021-06-11 op .Bl -bullet -compact
546 ada16f87 2021-06-11 op .It
547 ada16f87 2021-06-11 op GATEWAY_INTERFACE
548 ada16f87 2021-06-11 op .It
549 ada16f87 2021-06-11 op GEMINI_URL_PATH
550 ada16f87 2021-06-11 op .It
551 ada16f87 2021-06-11 op QUERY_STRING
552 ada16f87 2021-06-11 op .It
553 ada16f87 2021-06-11 op REMOTE_ADDR
554 ada16f87 2021-06-11 op .It
555 ada16f87 2021-06-11 op REMOTE_HOST
556 ada16f87 2021-06-11 op .It
557 ada16f87 2021-06-11 op REQUEST_METHOD
558 ada16f87 2021-06-11 op .It
559 ada16f87 2021-06-11 op SERVER_NAME
560 ada16f87 2021-06-11 op .It
561 ada16f87 2021-06-11 op SERVER_PROTOCOL
562 ada16f87 2021-06-11 op .It
563 ada16f87 2021-06-11 op SERVER_SOFTWARE
564 ada16f87 2021-06-11 op .It
565 ada16f87 2021-06-11 op AUTH_TYPE
566 ada16f87 2021-06-11 op .It
567 ada16f87 2021-06-11 op REMOTE_USER
568 ada16f87 2021-06-11 op .It
569 ada16f87 2021-06-11 op TLS_CLIENT_ISSUER
570 ada16f87 2021-06-11 op .It
571 ada16f87 2021-06-11 op TLS_CLIENT_HASH
572 ada16f87 2021-06-11 op .It
573 ada16f87 2021-06-11 op TLS_VERSION
574 ada16f87 2021-06-11 op .It
575 ada16f87 2021-06-11 op TLS_CIPHER
576 ada16f87 2021-06-11 op .It
577 ada16f87 2021-06-11 op TLS_CIPHER_STRENGTH
578 ada16f87 2021-06-11 op .It
579 ada16f87 2021-06-11 op TLS_CLIENT_NOT_BEFORE
580 ada16f87 2021-06-11 op .It
581 ada16f87 2021-06-11 op TLS_CLIENT_NOT_AFTER
582 ada16f87 2021-06-11 op .El
583 75fbb178 2021-01-28 op .Sh MIME
584 75fbb178 2021-01-28 op To auto-detect the MIME type of the response
585 75fbb178 2021-01-28 op .Nm
586 75fbb178 2021-01-28 op looks at the file extension and consults its internal table.
587 75fbb178 2021-01-28 op By default the following mappings are loaded, but they can be
588 75fbb178 2021-01-28 op overridden or extended using the
589 d19951cf 2021-07-09 op .Ic map
590 75fbb178 2021-01-28 op configuration option.
591 75fbb178 2021-01-28 op If no MIME is found, the value of
592 75fbb178 2021-01-28 op .Ic default type
593 75fbb178 2021-01-28 op matching the file
594 75fbb178 2021-01-28 op .Ic location
595 75fbb178 2021-01-28 op will be used, which is
596 75fbb178 2021-01-28 op .Dq application/octet-stream
597 75fbb178 2021-01-28 op by default.
598 75fbb178 2021-01-28 op .Pp
599 75fbb178 2021-01-28 op .Bl -tag -offset indent -width 14m -compact
600 4d820b6c 2021-04-21 op .It diff
601 4d820b6c 2021-04-21 op text/x-patch
602 75fbb178 2021-01-28 op .It gemini, gmi
603 75fbb178 2021-01-28 op text/gemini
604 75fbb178 2021-01-28 op .It gif
605 75fbb178 2021-01-28 op image/gif
606 75fbb178 2021-01-28 op .It jpeg
607 75fbb178 2021-01-28 op image/jpeg
608 75fbb178 2021-01-28 op .It jpg
609 75fbb178 2021-01-28 op image/jpeg
610 75fbb178 2021-01-28 op .It markdown, md
611 75fbb178 2021-01-28 op text/markdown
612 4d820b6c 2021-04-21 op .It patch
613 4d820b6c 2021-04-21 op text/x-patch
614 75fbb178 2021-01-28 op .It pdf
615 75fbb178 2021-01-28 op application/pdf
616 75fbb178 2021-01-28 op .It png
617 75fbb178 2021-01-28 op image/png
618 75fbb178 2021-01-28 op .It svg
619 75fbb178 2021-01-28 op image/svg+xml
620 75fbb178 2021-01-28 op .It txt
621 75fbb178 2021-01-28 op text/plain
622 75fbb178 2021-01-28 op .It xml
623 75fbb178 2021-01-28 op text/xml
624 75fbb178 2021-01-28 op .El
625 e58a447a 2021-07-29 op .Sh LOGGING
626 e58a447a 2021-07-29 op Messages and requests are logged by
627 e58a447a 2021-07-29 op .Xr syslog 3
628 e58a447a 2021-07-29 op using the
629 e58a447a 2021-07-29 op .Dv DAEMON
630 e58a447a 2021-07-29 op facility or printed on
631 e58a447a 2021-07-29 op .Em stderr .
632 e58a447a 2021-07-29 op .Pp
633 e58a447a 2021-07-29 op Requests are logged with the
634 e58a447a 2021-07-29 op .Dv NOTICE
635 e58a447a 2021-07-29 op severity.
636 e58a447a 2021-07-29 op Each request log entry has the following fields, separated by
637 e58a447a 2021-07-29 op whitespace:
638 e58a447a 2021-07-29 op .Pp
639 e58a447a 2021-07-29 op .Bl -bullet -compact
640 e58a447a 2021-07-29 op .It
641 e58a447a 2021-07-29 op Client IP address and the source port number, separated by a colon
642 e58a447a 2021-07-29 op .It
643 e58a447a 2021-07-29 op .Sy GET
644 e58a447a 2021-07-29 op keyword
645 e58a447a 2021-07-29 op .It
646 e58a447a 2021-07-29 op Request URL
647 e58a447a 2021-07-29 op .It
648 e58a447a 2021-07-29 op Response status
649 e58a447a 2021-07-29 op .It
650 e58a447a 2021-07-29 op Response meta
651 e58a447a 2021-07-29 op .El
652 3e4749f7 2020-10-02 op .Sh EXAMPLES
653 f28d96d3 2021-01-25 op Serve the current directory
654 6980aad6 2020-10-02 op .Bd -literal -offset indent
655 f28d96d3 2021-01-25 op $ gmid .
656 6980aad6 2020-10-02 op .Ed
657 3e4749f7 2020-10-02 op .Pp
658 f28d96d3 2021-01-25 op To serve the directory
659 f28d96d3 2021-01-25 op .Pa docs
660 f28d96d3 2021-01-25 op and enable CGI scripts inside
661 2b520ad5 2021-07-09 op .Pa docs/cgi
662 0ed56567 2020-11-06 op .Bd -literal -offset indent
663 f28d96d3 2021-01-25 op $ mkdir docs/cgi
664 b7a99061 2021-04-15 op $ cat <<EOF > docs/cgi/hello
665 0ed56567 2020-11-06 op #!/bin/sh
666 af5f9b27 2021-07-21 op printf "20 text/plain\er\en"
667 f28d96d3 2021-01-25 op echo "hello world"
668 0ed56567 2020-11-06 op EOF
669 f28d96d3 2021-01-25 op $ chmod +x docs/cgi/hello
670 b890467e 2021-03-20 op $ gmid -x '/cgi/*' docs
671 0ed56567 2020-11-06 op .Ed
672 e308526c 2021-07-29 op .Pp
673 e308526c 2021-07-29 op An X.509 certificate must be provided to run
674 e308526c 2021-07-29 op .Nm
675 e308526c 2021-07-29 op using a configuration file.
676 e308526c 2021-07-29 op First, the RSA certificate is created using a wildcard common name:
677 e308526c 2021-07-29 op .Bd -literal -offset indent
678 e308526c 2021-07-29 op # openssl genrsa \-out /etc/ssl/private/example.com.key 4096
679 1298e430 2021-10-09 op # openssl req \-new \-x509 \e
680 1298e430 2021-10-09 op \-key /etc/ssl/private/example.com.key \e
681 1298e430 2021-10-09 op \-out /etc/ssl/example.com.crt \e
682 1298e430 2021-10-09 op \-days 36500 \-nodes \e
683 2bb1776b 2021-07-29 op \-subj "/CN=example.com"
684 e308526c 2021-07-29 op # chmod 600 /etc/ssl/example.com.crt
685 e308526c 2021-07-29 op # chmod 600 /etc/ssl/private/example.com.key
686 e308526c 2021-07-29 op .Ed
687 e308526c 2021-07-29 op .Pp
688 e308526c 2021-07-29 op In the example above, a certificate is valid for one hundred years from
689 e308526c 2021-07-29 op the date it was created, which is normal for TOFU.
690 0ed56567 2020-11-06 op .Pp
691 eb699783 2021-01-18 op The following is an example of a possible configuration for a site
692 eb699783 2021-01-18 op that enables only TLSv1.3, adds a mime type for the file extension
693 e308526c 2021-07-29 op .Qq rtf
694 e308526c 2021-07-29 op and defines two virtual host:
695 eb699783 2021-01-18 op .Bd -literal -offset indent
696 eb699783 2021-01-18 op ipv6 on # enable ipv6
697 eb699783 2021-01-18 op
698 eb699783 2021-01-18 op protocols "tlsv1.3"
699 eb699783 2021-01-18 op
700 d19951cf 2021-07-09 op map "application/rtf" to-ext "rtf"
701 eb699783 2021-01-18 op
702 eb699783 2021-01-18 op server "example.com" {
703 e308526c 2021-07-29 op cert "/etc/ssl/example.com.crt"
704 e308526c 2021-07-29 op key "/etc/ssl/private/example.com.key"
705 eb699783 2021-01-18 op root "/var/gemini/example.com"
706 eb699783 2021-01-18 op }
707 eb699783 2021-01-18 op
708 eb699783 2021-01-18 op server "it.example.com" {
709 e308526c 2021-07-29 op cert "/etc/ssl/example.com.crt"
710 e308526c 2021-07-29 op key "/etc/ssl/private/example.com.key"
711 eb699783 2021-01-18 op root "/var/gemini/it.example.com"
712 2b520ad5 2021-07-09 op
713 2b520ad5 2021-07-09 op # enable cgi scripts inside "cgi-bin"
714 87f2b68b 2021-02-02 op cgi "/cgi-bin/*"
715 2b520ad5 2021-07-09 op
716 2b520ad5 2021-07-09 op # set the language for text/gemini files
717 de27389e 2021-01-21 op lang "it"
718 eb699783 2021-01-18 op }
719 eb699783 2021-01-18 op .Ed
720 f28d96d3 2021-01-25 op .Pp
721 f28d96d3 2021-01-25 op Yet another example, showing how to enable a
722 f28d96d3 2021-01-25 op .Ic chroot
723 f28d96d3 2021-01-25 op and use
724 f28d96d3 2021-01-25 op .Ic location
725 f28d96d3 2021-01-25 op rule
726 f28d96d3 2021-01-25 op .Bd -literal -offset indent
727 f28d96d3 2021-01-25 op chroot "/var/gemini"
728 f28d96d3 2021-01-25 op user "_gmid"
729 f28d96d3 2021-01-25 op
730 f28d96d3 2021-01-25 op server "example.com" {
731 2b520ad5 2021-07-09 op cert "/path/to/cert.pem" # absolute path
732 2b520ad5 2021-07-09 op key "/path/to/key.pem" # also absolute
733 2b520ad5 2021-07-09 op root "/example.com" # relative to the chroot
734 f28d96d3 2021-01-25 op
735 4ee08bd1 2021-02-03 op location "/static/*" {
736 2b520ad5 2021-07-09 op # load the following rules only for
737 2b520ad5 2021-07-09 op # requests that matches "/static/*"
738 2b520ad5 2021-07-09 op
739 f28d96d3 2021-01-25 op auto index on
740 f28d96d3 2021-01-25 op index "index.gemini"
741 f28d96d3 2021-01-25 op }
742 f28d96d3 2021-01-25 op }
743 f28d96d3 2021-01-25 op .Ed
744 ef04b551 2021-01-09 op .Sh ACKNOWLEDGEMENTS
745 ef04b551 2021-01-09 op .Nm
746 eb699783 2021-01-18 op uses the
747 eb699783 2021-01-18 op .Dq Flexible and Economical
748 eb699783 2021-01-18 op UTF-8 decoder written by
749 f28d96d3 2021-01-25 op .An Bjoern Hoehrmann .
750 714685c1 2021-01-30 op .Sh AUTHORS
751 714685c1 2021-01-30 op .An -nosplit
752 714685c1 2021-01-30 op The
753 714685c1 2021-01-30 op .Nm
754 714685c1 2021-01-30 op program was written by
755 714685c1 2021-01-30 op .An Omar Polo Aq Mt op@omarpolo.com .
756 3e4749f7 2020-10-02 op .Sh CAVEATS
757 3e4749f7 2020-10-02 op .Bl -bullet
758 3e4749f7 2020-10-02 op .It
759 2b520ad5 2021-07-09 op All the root directories are opened during the daemon startup; if a
760 2b520ad5 2021-07-09 op root directory is deleted and then re-created,
761 eb699783 2021-01-18 op .Nm
762 eb699783 2021-01-18 op won't be able to serve files inside that directory until a restart.
763 2b520ad5 2021-07-09 op This restriction only applies to the root directories and not their
764 2b520ad5 2021-07-09 op content.
765 043acc97 2020-12-25 op .It
766 714685c1 2021-01-30 op a %2F sequence is indistinguishable from a literal slash: this is not
767 714685c1 2021-01-30 op RFC3986-compliant.
768 00781742 2020-12-25 op .It
769 714685c1 2021-01-30 op a %00 sequence is treated as invalid character and thus rejected.
770 3e4749f7 2020-10-02 op .El