Blob


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