4 <title>gmid | contrib</title>
5 <meta charset="utf8" />
6 <meta name="viewport" content="width=device-width, initial-scale=1" />
9 font-family: monospace;
51 strong::before { content: "*" }
52 strong::after { content: "*" }
57 background-color: #222;
70 background-color: #f0f0f0;
77 justify-content: center;
90 @media (prefers-color-scheme: dark) {
92 background-color: #222;
101 background-color: #ddd;
105 background-color: #353535;
113 @media (max-width: 400px) {
114 pre.banner { font-size: 9px; }
117 @media (max-width: 500px) {
118 pre.banner { font-size: 10px; }
126 <a href="contrib.html">contrib</a> |
127 <a href="quickstart.html">Quickstart</a> |
128 <a href="gmid.1.html">docs</a>
133 This directory is for additional contributed files which may be
138 <li><a href="#dockerfile">Dockerfile</a></li>
139 <li><a href="#gencert">gencert</a></li>
140 <li><a href="#openbsd-rc">OpenBSD rc file</a></li>
141 <li><a href="#systemd-unit-file">Systemd unit file</a></li>
142 <li><a href="#vim-syntax-files">Vim syntax files</a></li>
145 <h2 id="dockerfile">Dockerfile</h2>
147 <a href="https://git.omarpolo.com/gmid/tree/contrib/Dockerfile">
148 <code>contrib/Dockerfile</code></a>
149 is a simple Dockerfile. The resulting image is a classic alpine
150 linux image with a statically linked gmid installed as
151 <code>/bin/gmid</code>.
153 <p>To build the image:</p>
154 <pre># docker build -f contrib/Dockerfile -t gmid .</pre>
155 <p>and then run it with something along the lines of:</p>
156 <pre># docker run --rm -it -p 1965:1965 \
157 -v gmid.conf:/etc/gmid.conf:ro \
158 -v path/to/keys:/tls:ro \
159 -v /var/gemini:/var/gemini:ro \
160 gmid -c /etc/gmid.conf</pre>
161 <h2 id="gencert">gencert</h2>
163 <a href="https://git.omarpolo.com/gmid/tree/contrib/gencert">contrib/gencert</a>
164 is a simple script to generate self-signed certificates.
166 <h2 id="openbsd-rc">OpenBSD rc file</h2>
168 <a href="https://git.omarpolo.com/gmid/tree/contrib/gmid">contrib/gmid</a>
169 is a sample service file for OpenBSD <code>rc(8)</code>.
172 <pre># cp contrib/gmid /etc/rc.d</pre>
175 <code>rcctl [start|stop|enable|restart] gmid</code>
178 <h2 id="systemd-unit-file">Systemd unit file</h2>
180 <a href="https://git.omarpolo.com/gmid/tree/contrib/gmid.service">
181 <code>contrib/gmid.service</code></a>
182 is a simple service file for
183 systemd. To install it:
185 <pre># cp contrib/gmid.service /lib/systemd/system/gmid.service</pre>
188 <code>systemctl [status|start|enable|stop] gmid</code>
189 commands can be used to manage the server.
191 <p>Some things to keep in mind:</p>
194 the <code>ExecStart</code> path may depend on the installation.
197 a <code>gmid</code> user needs to be created for e.g. with:
198 <pre># useradd --system --no-create-home -s /bin/nologin -c "gmid Gemini server" gmid</pre>
201 logs can be inspected with <code>journalctl(1)</code>:
202 <pre># journalctl -t gmid</pre>
205 <h2 id="vim-syntax-files">Vim syntax files</h2>
207 <a href="https://git.omarpolo.com/gmid/tree/contrib/vim">
208 <code>contrib/vim</code></a>
209 contains a syntax highlighting for vim. To install it, just
210 copy the files to <code>~/.vim</code>
211 or <code>/usr/share/vim/vimfiles</code>, e.g.
213 <pre>$ mkdir -p ~/.vim
214 $ cp -R contrib/vim/* ~/.vim/</pre>
215 <p>To enable Syntastic checker, add to your vimrc:</p>
216 <pre>let g:syntastic_gmid_checkers = ['gmid']</pre>
217 <p>The end result is something like this:</p>
218 <a href="vim-screenshot.png">
219 <img src="vim-screenshot.png" alt="Screenshot of vim editing gmid.conf with syntax highlighting" />