Blame
Date:
Thu Sep 8 21:34:29 2022 UTC
Message:
change the flags to be consistent with other OpenBSD daemons -d is `debug' (run in the foreground) -f to load the configuration file adjust regress and contrib accordingly
001
2022-09-08
op
.\" Copyright (c) 2021, 2022 Omar Polo <op@omarpolo.com>
002
2022-09-08
op
.\"
003
2022-09-08
op
.\" Permission to use, copy, modify, and distribute this software for any
004
2022-09-08
op
.\" purpose with or without fee is hereby granted, provided that the above
005
2022-09-08
op
.\" copyright notice and this permission notice appear in all copies.
006
2022-09-08
op
.\"
007
2022-09-08
op
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
008
2022-09-08
op
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
009
2022-09-08
op
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
010
2022-09-08
op
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
011
2022-09-08
op
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
012
2022-09-08
op
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
013
2022-09-08
op
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
014
2022-09-08
op
.Dd September 8, 2022
015
2022-09-08
op
.Dt GMID 8
016
2022-09-08
op
.Os
017
2022-09-08
op
.Sh NAME
018
2022-09-08
op
.Nm gmid
019
2022-09-08
op
.Nd simple and secure Gemini server
020
2022-09-08
op
.Sh SYNOPSIS
021
2022-09-08
op
.Nm
022
2022-09-08
op
.Bk -words
023
2022-09-08
op
.Op Fl dhnVv
024
2022-09-08
op
.Op Fl D Ar macro Ns = Ns Ar value
025
2022-09-08
op
.Op Fl f Ar config
026
2022-09-08
op
.Op Fl P Ar pidfile
027
2022-09-08
op
.Ek
028
2022-09-08
op
.Sh DESCRIPTION
029
2022-09-08
op
.Nm
030
2022-09-08
op
is a simple and minimal gemini server that can serve static files,
031
2022-09-08
op
talk to FastCGI applications and act as a gemini reverse proxy.
032
2022-09-08
op
It can run without a configuration file with a limited set of features
033
2022-09-08
op
available.
034
2022-09-08
op
.Pp
035
2022-09-08
op
.Nm
036
2022-09-08
op
rereads the configuration file when it receives
037
2022-09-08
op
.Dv SIGHUP .
038
2022-09-08
op
.Pp
039
2022-09-08
op
The options are as follows:
040
2022-09-08
op
.Bl -tag -width 14m
041
2022-09-08
op
.It Fl D Ar macro Ns = Ns Ar value
042
2022-09-08
op
Define
043
2022-09-08
op
.Ar macro
044
2022-09-08
op
to be set to
045
2022-09-08
op
.Ar value
046
2022-09-08
op
on the command line.
047
2022-09-08
op
Overrides the definition of
048
2022-09-08
op
.Ar macro
049
2022-09-08
op
in the config file if present.
050
2022-09-08
op
.It Fl d
051
2022-09-08
op
Debug mode.
052
2022-09-08
op
Do not daemonize and log to stderr.
053
2022-09-08
op
.It Fl f Ar config
054
2022-09-08
op
Specifies the configuration file.
055
2022-09-08
op
The default is
056
2022-09-08
op
.Pa /etc/gmid.conf .
057
2022-09-08
op
.It Fl h , Fl -help
058
2022-09-08
op
Print the usage and exit.
059
2022-09-08
op
.It Fl n
060
2022-09-08
op
Check that the configuration is valid, but don't start the server.
061
2022-09-08
op
If specified two or more time, dump the configuration in addition to
062
2022-09-08
op
verify it.
063
2022-09-08
op
.It Fl P Ar pidfile
064
2022-09-08
op
Write daemon's pid to the given location.
065
2022-09-08
op
.Ar pidfile
066
2022-09-08
op
will also act as lock: if another process is holding a lock on that
067
2022-09-08
op
file,
068
2022-09-08
op
.Nm
069
2022-09-08
op
will refuse to start.
070
2022-09-08
op
.It Fl V , Fl -version
071
2022-09-08
op
Print the version and exit.
072
2022-09-08
op
.It Fl v
073
2022-09-08
op
Verbose mode.
074
2022-09-08
op
Multiple
075
2022-09-08
op
.Fl v
076
2022-09-08
op
options increase the verbosity.
077
2022-09-08
op
.El
078
2022-09-08
op
.Sh LOGGING
079
2022-09-08
op
Messages and requests are logged by
080
2022-09-08
op
.Xr syslog 3
081
2022-09-08
op
using the
082
2022-09-08
op
.Dv DAEMON
083
2022-09-08
op
facility or printed on
084
2022-09-08
op
.Em stderr .
085
2022-09-08
op
.Pp
086
2022-09-08
op
Requests are logged with the
087
2022-09-08
op
.Dv NOTICE
088
2022-09-08
op
severity.
089
2022-09-08
op
Each request log entry has the following fields, separated by
090
2022-09-08
op
whitespace:
091
2022-09-08
op
.Pp
092
2022-09-08
op
.Bl -bullet -compact
093
2022-09-08
op
.It
094
2022-09-08
op
Client IP address and the source port number, separated by a colon
095
2022-09-08
op
.It
096
2022-09-08
op
.Sy GET
097
2022-09-08
op
keyword
098
2022-09-08
op
.It
099
2022-09-08
op
Request URL
100
2022-09-08
op
.It
101
2022-09-08
op
Response status
102
2022-09-08
op
.It
103
2022-09-08
op
Response meta
104
2022-09-08
op
.El
105
2022-09-08
op
.Sh EXAMPLES
106
2022-09-08
op
To run
107
2022-09-08
op
.Nm
108
2022-09-08
op
a configuration file and a X.509 certificate must be provided.
109
2022-09-08
op
A self-signed certificate, which are commonly used in the Geminispace,
110
2022-09-08
op
can be generated using for e.g.\&
111
2022-09-08
op
.Xr openssl 1 :
112
2022-09-08
op
.Bd -literal -offset indent
113
2022-09-08
op
# openssl req \-x509 \-newkey rsa:4096 \-nodes \e
114
2022-09-08
op
\-keyout /etc/ssl/private/example.com.key \e
115
2022-09-08
op
\-out /etc/ssl/example.com.pem \e
116
2022-09-08
op
\-days 365 \-subj "/CN=example.com"
117
2022-09-08
op
# chmod 600 /etc/ssl/example.com.crt
118
2022-09-08
op
# chmod 600 /etc/ssl/private/example.com.key
119
2022-09-08
op
.Ed
120
2022-09-08
op
.Pp
121
2022-09-08
op
Then
122
2022-09-08
op
.Nm
123
2022-09-08
op
can be started with
124
2022-09-08
op
.Bd -literal -offset indent
125
2022-09-08
op
# gmid -c /etc/gmid.conf
126
2022-09-08
op
.Ed
127
2022-09-08
op
.Sh SEE ALSO
128
2022-09-08
op
.Xr gmid.conf 5
129
2022-09-08
op
.Sh ACKNOWLEDGEMENTS
130
2022-09-08
op
.Nm
131
2022-09-08
op
uses the
132
2022-09-08
op
.Dq Flexible and Economical
133
2022-09-08
op
UTF-8 decoder written by
134
2022-09-08
op
.An Bjoern Hoehrmann .
135
2022-09-08
op
.Sh AUTHORS
136
2022-09-08
op
.An -nosplit
137
2022-09-08
op
The
138
2022-09-08
op
.Nm
139
2022-09-08
op
program was written by
140
2022-09-08
op
.An Omar Polo Aq Mt op@omarpolo.com .
141
2022-09-08
op
.Sh CAVEATS
142
2022-09-08
op
.Bl -bullet
143
2022-09-08
op
.It
144
2022-09-08
op
All the root directories are opened during the daemon startup; if a
145
2022-09-08
op
root directory is deleted and then re-created,
146
2022-09-08
op
.Nm
147
2022-09-08
op
won't be able to serve files inside that directory until a restart.
148
2022-09-08
op
This restriction only applies to the root directories and not their
149
2022-09-08
op
content.
150
2022-09-08
op
.It
151
2022-09-08
op
a %2F sequence is indistinguishable from a literal slash: this is not
152
2022-09-08
op
RFC3986-compliant.
153
2022-09-08
op
.It
154
2022-09-08
op
a %00 sequence is treated as invalid character and thus rejected.
155
2022-09-08
op
.El
Omar Polo