1 b3010dbb 2023-06-24 op .\" Copyright (c) 2021, 2022, 2023 Omar Polo <op@omarpolo.com>
3 9b15e4c6 2022-09-08 op .\" Permission to use, copy, modify, and distribute this software for any
4 9b15e4c6 2022-09-08 op .\" purpose with or without fee is hereby granted, provided that the above
5 9b15e4c6 2022-09-08 op .\" copyright notice and this permission notice appear in all copies.
7 9b15e4c6 2022-09-08 op .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8 9b15e4c6 2022-09-08 op .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9 9b15e4c6 2022-09-08 op .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10 9b15e4c6 2022-09-08 op .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11 9b15e4c6 2022-09-08 op .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12 9b15e4c6 2022-09-08 op .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13 9b15e4c6 2022-09-08 op .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14 b3010dbb 2023-06-24 op .Dd June 24, 2023
19 9b15e4c6 2022-09-08 op .Nd simple and secure Gemini server
24 0ac785a6 2023-06-05 op .Op Fl c Ar config
25 9b15e4c6 2022-09-08 op .Op Fl D Ar macro Ns = Ns Ar value
26 9b15e4c6 2022-09-08 op .Op Fl P Ar pidfile
28 9b15e4c6 2022-09-08 op .Sh DESCRIPTION
30 9b15e4c6 2022-09-08 op is a simple and minimal gemini server that can serve static files,
31 9b15e4c6 2022-09-08 op talk to FastCGI applications and act as a gemini reverse proxy.
34 9b15e4c6 2022-09-08 op rereads the configuration file when it receives
37 9b15e4c6 2022-09-08 op The options are as follows:
38 9b15e4c6 2022-09-08 op .Bl -tag -width 14m
39 0ac785a6 2023-06-05 op .It Fl c Ar config
40 0ac785a6 2023-06-05 op Specifies the configuration file.
41 0ac785a6 2023-06-05 op The default is
42 0ac785a6 2023-06-05 op .Pa /etc/gmid.conf .
43 9b15e4c6 2022-09-08 op .It Fl D Ar macro Ns = Ns Ar value
48 9b15e4c6 2022-09-08 op on the command line.
49 9b15e4c6 2022-09-08 op Overrides the definition of
51 9b15e4c6 2022-09-08 op in the config file if present.
53 0ac785a6 2023-06-05 op Stays and logs on the foreground.
54 9b15e4c6 2022-09-08 op .It Fl h , Fl -help
55 9b15e4c6 2022-09-08 op Print the usage and exit.
57 9b15e4c6 2022-09-08 op Check that the configuration is valid, but don't start the server.
58 9b15e4c6 2022-09-08 op If specified two or more time, dump the configuration in addition to
60 9b15e4c6 2022-09-08 op .It Fl P Ar pidfile
61 9b15e4c6 2022-09-08 op Write daemon's pid to the given location.
63 9b15e4c6 2022-09-08 op will also act as lock: if another process is holding a lock on that
66 9b15e4c6 2022-09-08 op will refuse to start.
67 9b15e4c6 2022-09-08 op .It Fl V , Fl -version
68 9b15e4c6 2022-09-08 op Print the version and exit.
73 9b15e4c6 2022-09-08 op Messages and requests are logged by
77 9b15e4c6 2022-09-08 op facility or printed on
80 9b15e4c6 2022-09-08 op Requests are logged with the
83 9b15e4c6 2022-09-08 op Each request log entry has the following fields, separated by
86 9b15e4c6 2022-09-08 op .Bl -bullet -compact
88 9b15e4c6 2022-09-08 op Client IP address and the source port number, separated by a colon
95 9b15e4c6 2022-09-08 op Response status
102 9b15e4c6 2022-09-08 op a configuration file and a X.509 certificate must be provided.
103 9b15e4c6 2022-09-08 op A self-signed certificate, which are commonly used in the Geminispace,
104 9b15e4c6 2022-09-08 op can be generated using for e.g.\&
105 9b15e4c6 2022-09-08 op .Xr openssl 1 :
106 9b15e4c6 2022-09-08 op .Bd -literal -offset indent
107 9b15e4c6 2022-09-08 op # openssl req \-x509 \-newkey rsa:4096 \-nodes \e
108 9b15e4c6 2022-09-08 op \-keyout /etc/ssl/private/example.com.key \e
109 9b15e4c6 2022-09-08 op \-out /etc/ssl/example.com.pem \e
110 9b15e4c6 2022-09-08 op \-days 365 \-subj "/CN=example.com"
111 9b15e4c6 2022-09-08 op # chmod 600 /etc/ssl/example.com.crt
112 9b15e4c6 2022-09-08 op # chmod 600 /etc/ssl/private/example.com.key
117 9b15e4c6 2022-09-08 op can be started with
118 9b15e4c6 2022-09-08 op .Bd -literal -offset indent
119 9b15e4c6 2022-09-08 op # gmid -c /etc/gmid.conf
122 9b15e4c6 2022-09-08 op .Xr gmid.conf 5
123 9b15e4c6 2022-09-08 op .Sh ACKNOWLEDGEMENTS
126 9b15e4c6 2022-09-08 op .Dq Flexible and Economical
127 9b15e4c6 2022-09-08 op UTF-8 decoder written by
128 9b15e4c6 2022-09-08 op .An Bjoern Hoehrmann .
133 9b15e4c6 2022-09-08 op program was written by
134 9b15e4c6 2022-09-08 op .An Omar Polo Aq Mt op@omarpolo.com .
138 b3010dbb 2023-06-24 op All the root directories are opened during the daemon configuration;
139 b3010dbb 2023-06-24 op if a root directory is deleted and then re-created,
141 b3010dbb 2023-06-24 op won't be able to serve files inside that directory until a reload.
142 9b15e4c6 2022-09-08 op This restriction only applies to the root directories and not their
145 9b15e4c6 2022-09-08 op a %2F sequence is indistinguishable from a literal slash: this is not
146 9b15e4c6 2022-09-08 op RFC3986-compliant.
148 9b15e4c6 2022-09-08 op a %00 sequence is treated as invalid character and thus rejected.