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 c7b79c9e 2021-10-09 op <a href="index.html">Home</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>contrib</h1>
133 ae6870fa 2021-10-04 op This directory is for additional contributed files which may be
136 ae6870fa 2021-10-04 op <p>Contents:</p>
138 ae6870fa 2021-10-04 op <li><a href="#dockerfile">Dockerfile</a></li>
139 a83ba844 2021-10-09 op <li><a href="#gencert">gencert</a></li>
140 ae6870fa 2021-10-04 op <li><a href="#openbsd-rc">OpenBSD rc file</a></li>
141 ae6870fa 2021-10-04 op <li><a href="#systemd-unit-file">Systemd unit file</a></li>
142 c0f81ed3 2021-10-11 op <li><a href="#renew-certs">renew certificates automatically</a></li>
143 ae6870fa 2021-10-04 op <li><a href="#vim-syntax-files">Vim syntax files</a></li>
146 ae6870fa 2021-10-04 op <h2 id="dockerfile">Dockerfile</h2>
148 c6bcc919 2021-10-09 op <a href="https://git.omarpolo.com/gmid/tree/contrib/Dockerfile">contrib/Dockerfile</a>
149 ae6870fa 2021-10-04 op is a simple Dockerfile. The resulting image is a classic alpine
150 ae6870fa 2021-10-04 op linux image with a statically linked gmid installed as
151 ae6870fa 2021-10-04 op <code>/bin/gmid</code>.
153 ae6870fa 2021-10-04 op <p>To build the image:</p>
154 ae6870fa 2021-10-04 op <pre># docker build -f contrib/Dockerfile -t gmid .</pre>
155 ae6870fa 2021-10-04 op <p>and then run it with something along the lines of:</p>
156 ae6870fa 2021-10-04 op <pre># docker run --rm -it -p 1965:1965 \
157 ae6870fa 2021-10-04 op -v gmid.conf:/etc/gmid.conf:ro \
158 ae6870fa 2021-10-04 op -v path/to/keys:/tls:ro \
159 ae6870fa 2021-10-04 op -v /var/gemini:/var/gemini:ro \
160 ae6870fa 2021-10-04 op gmid -c /etc/gmid.conf</pre>
161 a83ba844 2021-10-09 op <h2 id="gencert">gencert</h2>
163 a83ba844 2021-10-09 op <a href="https://git.omarpolo.com/gmid/tree/contrib/gencert">contrib/gencert</a>
164 a83ba844 2021-10-09 op is a simple script to generate self-signed certificates.
166 ae6870fa 2021-10-04 op <h2 id="openbsd-rc">OpenBSD rc file</h2>
168 ae6870fa 2021-10-04 op <a href="https://git.omarpolo.com/gmid/tree/contrib/gmid">contrib/gmid</a>
169 ae6870fa 2021-10-04 op is a sample service file for OpenBSD <code>rc(8)</code>.
170 ae6870fa 2021-10-04 op To install it:
172 ae6870fa 2021-10-04 op <pre># cp contrib/gmid /etc/rc.d</pre>
174 ae6870fa 2021-10-04 op then the usual
175 ae6870fa 2021-10-04 op <code>rcctl [start|stop|enable|restart] gmid</code>
176 ae6870fa 2021-10-04 op are available.
178 ae6870fa 2021-10-04 op <h2 id="systemd-unit-file">Systemd unit file</h2>
180 c6bcc919 2021-10-09 op <a href="https://git.omarpolo.com/gmid/tree/contrib/gmid.service">contrib/gmid.service</a>
181 ae6870fa 2021-10-04 op is a simple service file for
182 ae6870fa 2021-10-04 op systemd. To install it:
184 ae6870fa 2021-10-04 op <pre># cp contrib/gmid.service /lib/systemd/system/gmid.service</pre>
186 ae6870fa 2021-10-04 op then the usual
187 ae6870fa 2021-10-04 op <code>systemctl [status|start|enable|stop] gmid</code>
188 ae6870fa 2021-10-04 op commands can be used to manage the server.
190 ae6870fa 2021-10-04 op <p>Some things to keep in mind:</p>
193 eb82dcfb 2021-10-04 op the <code>ExecStart</code> path may depend on the installation.
196 eb82dcfb 2021-10-04 op a <code>gmid</code> user needs to be created for e.g. with:
197 eb82dcfb 2021-10-04 op <pre># useradd --system --no-create-home -s /bin/nologin -c "gmid Gemini server" gmid</pre>
200 eb82dcfb 2021-10-04 op logs can be inspected with <code>journalctl(1)</code>:
201 eb82dcfb 2021-10-04 op <pre># journalctl -t gmid</pre>
204 c0f81ed3 2021-10-11 op <h2 id="renew-certs">renew certificates automatically</h2>
206 c0f81ed3 2021-10-11 op <a href="https://git.omarpolo.com/gmid/tree/contrib/renew-certs">contrib/renew-certs</a>
207 c0f81ed3 2021-10-11 op is a script meant to be run in a crontab that watch for
208 c0f81ed3 2021-10-11 op certificate expiration. It can optionally renew the certs and
209 c0f81ed3 2021-10-11 op restart gmid too.
211 c0f81ed3 2021-10-11 op <p>Read the documentation with: <code>perldoc renew-certs</code></p>
212 ae6870fa 2021-10-04 op <h2 id="vim-syntax-files">Vim syntax files</h2>
214 c6bcc919 2021-10-09 op <a href="https://git.omarpolo.com/gmid/tree/contrib/vim">contrib/vim</a>
215 ae6870fa 2021-10-04 op contains a syntax highlighting for vim. To install it, just
216 ae6870fa 2021-10-04 op copy the files to <code>~/.vim</code>
217 ae6870fa 2021-10-04 op or <code>/usr/share/vim/vimfiles</code>, e.g.
219 ae6870fa 2021-10-04 op <pre>$ mkdir -p ~/.vim
220 ae6870fa 2021-10-04 op $ cp -R contrib/vim/* ~/.vim/</pre>
221 ae6870fa 2021-10-04 op <p>To enable Syntastic checker, add to your vimrc:</p>
222 ae6870fa 2021-10-04 op <pre>let g:syntastic_gmid_checkers = ['gmid']</pre>
223 ae6870fa 2021-10-04 op <p>The end result is something like this:</p>
224 ae6870fa 2021-10-04 op <a href="vim-screenshot.png">
225 ae6870fa 2021-10-04 op <img src="vim-screenshot.png" alt="Screenshot of vim editing gmid.conf with syntax highlighting" />