1 ae6870fa 2021-10-04 op <!doctype html>
2 ae6870fa 2021-10-04 op <html lang="en">
4 ae6870fa 2021-10-04 op <title>gmid</title>
5 ae6870fa 2021-10-04 op <meta charset="utf8">
6 ae6870fa 2021-10-04 op <meta name="viewport" content="width=device-width, initial-scale=1">
9 ae6870fa 2021-10-04 op font-family: monospace;
10 ae6870fa 2021-10-04 op font-size: 14px;
11 ae6870fa 2021-10-04 op max-width: 780px;
12 ae6870fa 2021-10-04 op margin: 0 auto;
13 ae6870fa 2021-10-04 op padding: 20px;
14 ae6870fa 2021-10-04 op padding-bottom: 80px;
18 ae6870fa 2021-10-04 op content: "# ";
22 ae6870fa 2021-10-04 op margin-top: 40px;
26 ae6870fa 2021-10-04 op content: "## ";
30 ae6870fa 2021-10-04 op content: "### ";
38 ae6870fa 2021-10-04 op blockquote::before {
39 ae6870fa 2021-10-04 op content: "> ";
42 ae6870fa 2021-10-04 op blockquote p {
43 ae6870fa 2021-10-04 op font-style: italic;
44 ae6870fa 2021-10-04 op display: inline;
47 ae6870fa 2021-10-04 op p.link::before {
48 ae6870fa 2021-10-04 op content: "→ ";
51 ae6870fa 2021-10-04 op strong::before { content: "*" }
52 ae6870fa 2021-10-04 op strong::after { content: "*" }
57 ae6870fa 2021-10-04 op background-color: #222;
59 ae6870fa 2021-10-04 op display: block;
60 ae6870fa 2021-10-04 op margin: 2em auto;
64 ae6870fa 2021-10-04 op border-radius: 5px;
68 ae6870fa 2021-10-04 op overflow: auto;
69 ae6870fa 2021-10-04 op padding: 1rem;
70 ae6870fa 2021-10-04 op background-color: #f0f0f0;
71 ae6870fa 2021-10-04 op border-radius: 3px;
75 ae6870fa 2021-10-04 op display: flex;
76 ae6870fa 2021-10-04 op flex-direction: row;
77 ae6870fa 2021-10-04 op justify-content: center;
81 ae6870fa 2021-10-04 op color: #9d109d;
85 ae6870fa 2021-10-04 op display: block;
86 ae6870fa 2021-10-04 op margin: 0 auto;
87 ae6870fa 2021-10-04 op max-width: 100%;
90 ae6870fa 2021-10-04 op @media (prefers-color-scheme: dark) {
92 ae6870fa 2021-10-04 op background-color: #222;
101 ae6870fa 2021-10-04 op background-color: #ddd;
105 ae6870fa 2021-10-04 op background-color: #353535;
109 ae6870fa 2021-10-04 op color: #ff4cff;
113 ae6870fa 2021-10-04 op @media (max-width: 400px) {
114 ae6870fa 2021-10-04 op pre.banner { font-size: 9px; }
117 ae6870fa 2021-10-04 op @media (max-width: 500px) {
118 ae6870fa 2021-10-04 op pre.banner { font-size: 10px; }
126 0111ad5d 2021-10-09 op <a href="contrib.html">contrib</a> |
127 0111ad5d 2021-10-09 op <a href="quickstart.html">Quickstart</a> |
128 0111ad5d 2021-10-09 op <a href="gmid.1.html">docs</a>
131 ae6870fa 2021-10-04 op <h1>gmid</h1>
133 ae6870fa 2021-10-04 op <p>A Gemini server</p>
134 ae6870fa 2021-10-04 op </blockquote>
135 ae6870fa 2021-10-04 op <h2>Features</h2>
137 ae6870fa 2021-10-04 op <li>sandboxed by default on OpenBSD, FreeBSD and Linux</li>
138 ae6870fa 2021-10-04 op <li>able to reload the configuration on-the-fly without loosing connections</li>
139 ae6870fa 2021-10-04 op <li>punycode and IRI support</li>
140 c3eb759a 2021-12-29 op <li>reverse proxying</li>
141 ae6870fa 2021-10-04 op <li>CGI and FastCGI support</li>
142 ae6870fa 2021-10-04 op <li>virtual hosts and per-location rules</li>
143 ae6870fa 2021-10-04 op <li>low memory footprint</li>
144 ae6870fa 2021-10-04 op <li>event-based asynchronous I/O model</li>
145 ae6870fa 2021-10-04 op <li>rich configuration file</li>
147 ae6870fa 2021-10-04 op <h2>Install</h2>
148 ae6870fa 2021-10-04 op <p>Some distros provide a package — thanks to the maintainers!</p>
150 ae6870fa 2021-10-04 op <a href="https://repology.org/project/gmid/versions">
151 ae6870fa 2021-10-04 op <img src="https://repology.org/badge/vertical-allrepos/gmid.svg" alt="Packaging status">
154 ae6870fa 2021-10-04 op <p>Source code and precompiled binaries for linux are available:</p>
157 e84ee6a7 2021-10-15 op <a href="https://github.com/omar-polo/gmid/releases/download/1.7.5/gmid-1.7.5.tar.gz">gmid-1.7.5.tar.gz</a>
162 ae6870fa 2021-10-04 op <a href="https://git.omarpolo.com/gmid/">git repository</a>
165 ae6870fa 2021-10-04 op <a href="gemini://git.omarpolo.com/gmid.git/">git repository via Gemini</a>
168 ae6870fa 2021-10-04 op <a href="https://github.com/omar-polo/gmid">GitHub mirror</a>
173 e84ee6a7 2021-10-15 op <a href="https://github.com/omar-polo/gmid/releases/download/1.7.5/gmid.linux.aarch64">gmid.linux.aarch64</a>
176 e84ee6a7 2021-10-15 op <a href="https://github.com/omar-polo/gmid/releases/download/1.7.5/gmid.linux.amd64">gmid.linux.amd64</a>
180 ae6870fa 2021-10-04 op When in doubt, compile from source: it’s easy and takes less
181 ae6870fa 2021-10-04 op than a minute on a raspberry pi 3. The dependencies are:
184 ae6870fa 2021-10-04 op <li>libevent</li>
185 ae6870fa 2021-10-04 op <li>OpenSSL/LibreSSL</li>
186 ae6870fa 2021-10-04 op <li>libtls (from either LibreSSL or LibreTLS)</li>
187 ae6870fa 2021-10-04 op <li>yacc or GNU bison</li>
189 ae6870fa 2021-10-04 op <p>Once all the dependencies are installed, building is as easy as:</p>
190 e84ee6a7 2021-10-15 op <pre>$ curl -LO https://github.com/omar-polo/gmid/releases/download/1.7.5/gmid-1.7.5.tar.gz
191 e84ee6a7 2021-10-15 op $ tar xzvf gmid-1.7.5.tar.gz
192 e84ee6a7 2021-10-15 op $ cd gmid-1.7.5
193 ae6870fa 2021-10-04 op $ ./configure
195 ae6870fa 2021-10-04 op $ sudo make install # eventually</pre>
197 ae6870fa 2021-10-04 op A SHA256 file is available. However, that only checks for
198 ae6870fa 2021-10-04 op accidental corruption: you can use signify (SHA256.sig and the
199 ae6870fa 2021-10-04 op public key gmid-1.7.pub) or GPG. The hash of the signify public
200 ae6870fa 2021-10-04 op key is also included in the SHA256 file and thus signed with my
201 ae6870fa 2021-10-04 op GPG. The signify public key for the next release ‘gmid-1.8.pub’
202 ae6870fa 2021-10-04 op is also included.
206 e84ee6a7 2021-10-15 op <a href="https://github.com/omar-polo/gmid/releases/download/1.7.5/SHA256">SHA256</a>
209 e84ee6a7 2021-10-15 op <a href="https://github.com/omar-polo/gmid/releases/download/1.7.5/SHA256.gpg">SHA256.gpg</a>
212 e84ee6a7 2021-10-15 op <a href="https://github.com/omar-polo/gmid/releases/download/1.7.5/SHA256.sig">SHA256.sig</a>
215 ae6870fa 2021-10-04 op <p>To verify the signatures with signify(1)</p>
216 ae6870fa 2021-10-04 op <pre>$ signify -C -p gmid-1.7.pub -x SHA256.sig
217 ae6870fa 2021-10-04 op Signature Verified
218 ae6870fa 2021-10-04 op gmid-1.7.pub: OK
219 e84ee6a7 2021-10-15 op gmid-1.7.5.tar.gz: OK
220 ae6870fa 2021-10-04 op gmid-1.8.pub: OK
221 ae6870fa 2021-10-04 op gmid.linux.aarch64: OK
222 ae6870fa 2021-10-04 op gmid.linux.amd64: OK</pre>
223 ae6870fa 2021-10-04 op <h2>Changelog for the last versions</h2>
224 f8bcc138 2021-10-15 op <p>1.7.5 “Space-dye Vest” fifth bugfix release — Released October 15, 2021</p>
225 e84ee6a7 2021-10-15 op <p>This version includes the following bugfix:</p>
227 e84ee6a7 2021-10-15 op <li>don't die when a connection is closed before being accepted by gmid (i.e. handle <code>ECONNRESET</code>)</li>
230 ae6870fa 2021-10-04 op <p>1.7.4 “Space-dye Vest” fourth bugfix release — Released September 24, 2021</p>
231 ae6870fa 2021-10-04 op <p>This version includes the following bugfix:</p>
234 ae6870fa 2021-10-04 op fix a possible out-of-bound access when handling a request for
235 ae6870fa 2021-10-04 op a non-existent file in the root directory of a vhost that's
236 ae6870fa 2021-10-04 op matched by the cgi option
239 ae6870fa 2021-10-04 op <p>and the relative regression test.</p>
241 ae6870fa 2021-10-04 op <p>1.7.3 “Space-dye Vest” third bugfix release — Released September 18, 2021</p>
242 ae6870fa 2021-10-04 op <h3>Improvements</h3>
244 ae6870fa 2021-10-04 op <li>follows symlinks</li>
245 ae6870fa 2021-10-04 op <li>improved documentation and added key generation example (thanks! Anna)</li>
247 ae6870fa 2021-10-04 op <h3>Bugfix</h3>
249 ae6870fa 2021-10-04 op <li>fix syslog logging on FreeBSD. Reported by Karl Jeacle, thanks!</li>
250 ae6870fa 2021-10-04 op <li>don't crash if <code>-c</code> is missing in configtest mode (<code>-n</code>). Reported by heph, thanks!</li>
251 ae6870fa 2021-10-04 op <li>allow fstat64 on linux (needed by glibc on aarch64). Reported by pine, thanks!</li>
254 ae6870fa 2021-10-04 op <p>1.7.2 “Space-dye Vest” second bugfix release — Released July 19, 2021</p>
255 ae6870fa 2021-10-04 op <p>This version includes the following bugfix:</p>
258 ae6870fa 2021-10-04 op An un-initialized field in the configless code path leads to a
259 ae6870fa 2021-10-04 op crash on the first request.
262 ae6870fa 2021-10-04 op <p>and the relative regression test.</p>
264 ae6870fa 2021-10-04 op <p>1.7.1 “Space-dye Vest” bugfix release — Released July 11, 2021</p>
265 ae6870fa 2021-10-04 op <p>This version includes two bugfixes:</p>
267 ae6870fa 2021-10-04 op <li>use <code>${MAKE}</code> to recursively call make.</li>
269 ae6870fa 2021-10-04 op fix the misleading example in the manpage: macros name may not
270 ae6870fa 2021-10-04 op be reserved words.
274 ae6870fa 2021-10-04 op <p>1.7 “Space-dye Vest” — Released July 10, 2021</p>
276 ae6870fa 2021-10-04 op Starting from this version gmid doesn't depend on lex anymore,
277 ae6870fa 2021-10-04 op but yacc is still needed.
279 ae6870fa 2021-10-04 op <h3>New Features</h3>
281 ae6870fa 2021-10-04 op <li>initial fastcgi support! (it’s still young!)</li>
283 ae6870fa 2021-10-04 op added user-defined macros, either via <code>-Dname=val</code> or
284 ae6870fa 2021-10-04 op directly in the configuration file.
286 ae6870fa 2021-10-04 op <li>new <code>include</code> keyword to load additional configuration files.</li>
287 ae6870fa 2021-10-04 op <li>new <code>env</code> rule to define environment vars for CGI scripts.</li>
288 ae6870fa 2021-10-04 op <li>new <code>alias</code> rule to define hostname aliases for a server.</li>
289 ae6870fa 2021-10-04 op <li>allow <code>root</code> to be specified per-location block.</li>
290 ae6870fa 2021-10-04 op <li>pidfile support with the new <code>-P</code> cli flag.</li>
292 ae6870fa 2021-10-04 op define <code>TLS_VERSION</code>, <code>TLS_CIPHER</code> and
293 ae6870fa 2021-10-04 op <code>TLS_CIPHER_STRENGTH</code> for CGI scripts.
296 ae6870fa 2021-10-04 op <h3>Improvements</h3>
299 ae6870fa 2021-10-04 op remove limits on the number of virtual hosts and location
300 ae6870fa 2021-10-04 op blocks that can be defined.
302 ae6870fa 2021-10-04 op <li>print the datetime when logging to stderr.</li>
304 ae6870fa 2021-10-04 op use <code>text/x-patch</code> for <code>.patch</code> and <code>.diff</code> files.
306 ae6870fa 2021-10-04 op <li>sort the auto index alphabetically.</li>
307 ae6870fa 2021-10-04 op <li>various improvements to the log management.</li>
308 ae6870fa 2021-10-04 op <li>drop the dependency on lex.</li>
310 ae6870fa 2021-10-04 op added <code>--help</code> as synonym of <code>-h</code> and
311 ae6870fa 2021-10-04 op <code>-V</code>/<code>--version</code> to print the version.
314 ae6870fa 2021-10-04 op c-like handling of strings in the configuration file: when
315 ae6870fa 2021-10-04 op two or more strings are next to each-others, are
316 ae6870fa 2021-10-04 op automatically joined into a single string. This is
317 ae6870fa 2021-10-04 op particularly useful with <code>$</code>-macros.
320 ae6870fa 2021-10-04 op <h3>Bug fixes</h3>
323 ae6870fa 2021-10-04 op correctly handle CGI scripts that replies with the maxium
324 ae6870fa 2021-10-04 op header length allowed.
326 ae6870fa 2021-10-04 op <li>fixed the <code>static</code> target.</li>
328 ae6870fa 2021-10-04 op fixed recursive mkdirs for configless mode (i.e. create
329 ae6870fa 2021-10-04 op <code>~/.local/share/gmid</code>)
332 ae6870fa 2021-10-04 op logs sent to syslog now have proper priority (before every
333 ae6870fa 2021-10-04 op message ended up as LOG_CRIT). Found by Anna
334 ae6870fa 2021-10-04 op “CyberTailor”, thanks!
337 ae6870fa 2021-10-04 op ensure <code>%p</code> (path) is always absolute in
338 ae6870fa 2021-10-04 op <code>block return</code> rules.
341 ae6870fa 2021-10-04 op fix automatic certificate generation, it caused problems on
342 ae6870fa 2021-10-04 op some adroid devices. Found by Gnuserland, thanks!
344 ae6870fa 2021-10-04 op <li>document the <code>log</code> rule.</li>
346 ae6870fa 2021-10-04 op the seccomp filter was reworked and now it’s known to
347 ae6870fa 2021-10-04 op work properly on a vast range of architectures (to be more
348 ae6870fa 2021-10-04 op specific: all the architectures supported by alpine linux),
349 ae6870fa 2021-10-04 op see github issue #4. Prompted and tested by @begss, thanks!
352 ae6870fa 2021-10-04 op various improvements to the configure script, notified and
353 ae6870fa 2021-10-04 op fixed by Anna “CyberTailor”, thanks!
355 ae6870fa 2021-10-04 op <li>added a timeout to the regression tests.</li>
357 ae6870fa 2021-10-04 op <h3>Breaking changes</h3>
360 ae6870fa 2021-10-04 op if duplicate rules are found in the configuration file, an
361 ae6870fa 2021-10-04 op error is now raised instead of silently using only the last
365 ae6870fa 2021-10-04 op (sort of) <code>gg</code> moved to <code>regress</code> as
366 ae6870fa 2021-10-04 op it's only used in the regression suite.
369 ae6870fa 2021-10-04 op (notice) the <code>mime "mime-type" "extension"</code> rule was deprecated and
370 ae6870fa 2021-10-04 op replaced by the new <code>map "mime-type" to-ext "extension"</code>. The
371 ae6870fa 2021-10-04 op <code>mime</code> rule will be removed in a future version
372 ae6870fa 2021-10-04 op because its syntax is incompatible with the new string
373 ae6870fa 2021-10-04 op auto-concat mechanism.