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 | contrib</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; }
125 ae6870fa 2021-10-04 op <a href="/">Home</a> | contrib | <a href="gmid.1.html">docs</a>
128 ae6870fa 2021-10-04 op <h1>contrib</h1>
130 ae6870fa 2021-10-04 op This directory is for additional contributed files which may be
133 ae6870fa 2021-10-04 op <p>Contents:</p>
135 ae6870fa 2021-10-04 op <li><a href="#dockerfile">Dockerfile</a></li>
136 ae6870fa 2021-10-04 op <li><a href="#openbsd-rc">OpenBSD rc file</a></li>
137 ae6870fa 2021-10-04 op <li><a href="#systemd-unit-file">Systemd unit file</a></li>
138 ae6870fa 2021-10-04 op <li><a href="#vim-syntax-files">Vim syntax files</a></li>
141 ae6870fa 2021-10-04 op <h2 id="dockerfile">Dockerfile</h2>
143 ae6870fa 2021-10-04 op <a href="https://git.omarpolo.com/gmid/tree/contrib/Dockerfile">
144 ae6870fa 2021-10-04 op <code>contrib/Dockerfile</code></a>
145 ae6870fa 2021-10-04 op is a simple Dockerfile. The resulting image is a classic alpine
146 ae6870fa 2021-10-04 op linux image with a statically linked gmid installed as
147 ae6870fa 2021-10-04 op <code>/bin/gmid</code>.
149 ae6870fa 2021-10-04 op <p>To build the image:</p>
150 ae6870fa 2021-10-04 op <pre># docker build -f contrib/Dockerfile -t gmid .</pre>
151 ae6870fa 2021-10-04 op <p>and then run it with something along the lines of:</p>
152 ae6870fa 2021-10-04 op <pre># docker run --rm -it -p 1965:1965 \
153 ae6870fa 2021-10-04 op -v gmid.conf:/etc/gmid.conf:ro \
154 ae6870fa 2021-10-04 op -v path/to/keys:/tls:ro \
155 ae6870fa 2021-10-04 op -v /var/gemini:/var/gemini:ro \
156 ae6870fa 2021-10-04 op gmid -c /etc/gmid.conf</pre>
157 ae6870fa 2021-10-04 op <h2 id="openbsd-rc">OpenBSD rc file</h2>
159 ae6870fa 2021-10-04 op <a href="https://git.omarpolo.com/gmid/tree/contrib/gmid">contrib/gmid</a>
160 ae6870fa 2021-10-04 op is a sample service file for OpenBSD <code>rc(8)</code>.
161 ae6870fa 2021-10-04 op To install it:
163 ae6870fa 2021-10-04 op <pre># cp contrib/gmid /etc/rc.d</pre>
165 ae6870fa 2021-10-04 op then the usual
166 ae6870fa 2021-10-04 op <code>rcctl [start|stop|enable|restart] gmid</code>
167 ae6870fa 2021-10-04 op are available.
169 ae6870fa 2021-10-04 op <h2 id="systemd-unit-file">Systemd unit file</h2>
171 ae6870fa 2021-10-04 op <a href="https://git.omarpolo.com/gmid/tree/contrib/gmid.service">
172 ae6870fa 2021-10-04 op <code>contrib/gmid.service</code></a>
173 ae6870fa 2021-10-04 op is a simple service file for
174 ae6870fa 2021-10-04 op systemd. To install it:
176 ae6870fa 2021-10-04 op <pre># cp contrib/gmid.service /lib/systemd/system/gmid.service</pre>
178 ae6870fa 2021-10-04 op then the usual
179 ae6870fa 2021-10-04 op <code>systemctl [status|start|enable|stop] gmid</code>
180 ae6870fa 2021-10-04 op commands can be used to manage the server.
182 ae6870fa 2021-10-04 op <p>Some things to keep in mind:</p>
185 eb82dcfb 2021-10-04 op the <code>ExecStart</code> path may depend on the installation.
188 eb82dcfb 2021-10-04 op a <code>gmid</code> user needs to be created for e.g. with:
189 eb82dcfb 2021-10-04 op <pre># useradd --system --no-create-home -s /bin/nologin -c "gmid Gemini server" gmid</pre>
192 eb82dcfb 2021-10-04 op logs can be inspected with <code>journalctl(1)</code>:
193 eb82dcfb 2021-10-04 op <pre># journalctl -t gmid</pre>
196 ae6870fa 2021-10-04 op <h2 id="vim-syntax-files">Vim syntax files</h2>
198 ae6870fa 2021-10-04 op <a href="https://git.omarpolo.com/gmid/tree/contrib/vim">
199 ae6870fa 2021-10-04 op <code>contrib/vim</code></a>
200 ae6870fa 2021-10-04 op contains a syntax highlighting for vim. To install it, just
201 ae6870fa 2021-10-04 op copy the files to <code>~/.vim</code>
202 ae6870fa 2021-10-04 op or <code>/usr/share/vim/vimfiles</code>, e.g.
204 ae6870fa 2021-10-04 op <pre>$ mkdir -p ~/.vim
205 ae6870fa 2021-10-04 op $ cp -R contrib/vim/* ~/.vim/</pre>
206 ae6870fa 2021-10-04 op <p>To enable Syntastic checker, add to your vimrc:</p>
207 ae6870fa 2021-10-04 op <pre>let g:syntastic_gmid_checkers = ['gmid']</pre>
208 ae6870fa 2021-10-04 op <p>The end result is something like this:</p>
209 ae6870fa 2021-10-04 op <a href="vim-screenshot.png">
210 ae6870fa 2021-10-04 op <img src="vim-screenshot.png" alt="Screenshot of vim editing gmid.conf with syntax highlighting" />