Blame


1 ae6870fa 2021-10-04 op <!doctype html>
2 ae6870fa 2021-10-04 op <html lang="en">
3 ae6870fa 2021-10-04 op <head>
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" />
7 ae6870fa 2021-10-04 op <style>
8 ae6870fa 2021-10-04 op body {
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;
15 ae6870fa 2021-10-04 op }
16 ae6870fa 2021-10-04 op
17 ae6870fa 2021-10-04 op h1::before {
18 ae6870fa 2021-10-04 op content: "# ";
19 ae6870fa 2021-10-04 op }
20 ae6870fa 2021-10-04 op
21 ae6870fa 2021-10-04 op h2 {
22 ae6870fa 2021-10-04 op margin-top: 40px;
23 ae6870fa 2021-10-04 op }
24 ae6870fa 2021-10-04 op
25 ae6870fa 2021-10-04 op h2::before {
26 ae6870fa 2021-10-04 op content: "## ";
27 ae6870fa 2021-10-04 op }
28 ae6870fa 2021-10-04 op
29 ae6870fa 2021-10-04 op h3::before {
30 ae6870fa 2021-10-04 op content: "### ";
31 ae6870fa 2021-10-04 op }
32 ae6870fa 2021-10-04 op
33 ae6870fa 2021-10-04 op blockquote {
34 ae6870fa 2021-10-04 op margin: 0;
35 ae6870fa 2021-10-04 op padding: 0;
36 ae6870fa 2021-10-04 op }
37 ae6870fa 2021-10-04 op
38 ae6870fa 2021-10-04 op blockquote::before {
39 ae6870fa 2021-10-04 op content: "> ";
40 ae6870fa 2021-10-04 op }
41 ae6870fa 2021-10-04 op
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;
45 ae6870fa 2021-10-04 op }
46 ae6870fa 2021-10-04 op
47 ae6870fa 2021-10-04 op p.link::before {
48 ae6870fa 2021-10-04 op content: "→ ";
49 ae6870fa 2021-10-04 op }
50 ae6870fa 2021-10-04 op
51 ae6870fa 2021-10-04 op strong::before { content: "*" }
52 ae6870fa 2021-10-04 op strong::after { content: "*" }
53 ae6870fa 2021-10-04 op
54 ae6870fa 2021-10-04 op hr {
55 ae6870fa 2021-10-04 op border: 0;
56 ae6870fa 2021-10-04 op height: 1px;
57 ae6870fa 2021-10-04 op background-color: #222;
58 ae6870fa 2021-10-04 op width: 100%;
59 ae6870fa 2021-10-04 op display: block;
60 ae6870fa 2021-10-04 op margin: 2em auto;
61 ae6870fa 2021-10-04 op }
62 ae6870fa 2021-10-04 op
63 ae6870fa 2021-10-04 op img {
64 ae6870fa 2021-10-04 op border-radius: 5px;
65 ae6870fa 2021-10-04 op }
66 ae6870fa 2021-10-04 op
67 ae6870fa 2021-10-04 op pre {
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;
72 ae6870fa 2021-10-04 op }
73 ae6870fa 2021-10-04 op
74 ae6870fa 2021-10-04 op pre.banner {
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;
78 ae6870fa 2021-10-04 op }
79 ae6870fa 2021-10-04 op
80 ae6870fa 2021-10-04 op code, kbd {
81 ae6870fa 2021-10-04 op color: #9d109d;
82 ae6870fa 2021-10-04 op }
83 ae6870fa 2021-10-04 op
84 ae6870fa 2021-10-04 op img {
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%;
88 ae6870fa 2021-10-04 op }
89 ae6870fa 2021-10-04 op
90 ae6870fa 2021-10-04 op @media (prefers-color-scheme: dark) {
91 ae6870fa 2021-10-04 op body {
92 ae6870fa 2021-10-04 op background-color: #222;
93 ae6870fa 2021-10-04 op color: white;
94 ae6870fa 2021-10-04 op }
95 ae6870fa 2021-10-04 op
96 ae6870fa 2021-10-04 op a {
97 ae6870fa 2021-10-04 op color: aqua;
98 ae6870fa 2021-10-04 op }
99 ae6870fa 2021-10-04 op
100 ae6870fa 2021-10-04 op hr {
101 ae6870fa 2021-10-04 op background-color: #ddd;
102 ae6870fa 2021-10-04 op }
103 ae6870fa 2021-10-04 op
104 ae6870fa 2021-10-04 op pre {
105 ae6870fa 2021-10-04 op background-color: #353535;
106 ae6870fa 2021-10-04 op }
107 ae6870fa 2021-10-04 op
108 ae6870fa 2021-10-04 op code, kbd {
109 ae6870fa 2021-10-04 op color: #ff4cff;
110 ae6870fa 2021-10-04 op }
111 ae6870fa 2021-10-04 op }
112 ae6870fa 2021-10-04 op
113 ae6870fa 2021-10-04 op @media (max-width: 400px) {
114 ae6870fa 2021-10-04 op pre.banner { font-size: 9px; }
115 ae6870fa 2021-10-04 op }
116 ae6870fa 2021-10-04 op
117 ae6870fa 2021-10-04 op @media (max-width: 500px) {
118 ae6870fa 2021-10-04 op pre.banner { font-size: 10px; }
119 ae6870fa 2021-10-04 op }
120 ae6870fa 2021-10-04 op </style>
121 ae6870fa 2021-10-04 op </head>
122 ae6870fa 2021-10-04 op <body>
123 ae6870fa 2021-10-04 op <header>
124 ae6870fa 2021-10-04 op <nav>
125 ae6870fa 2021-10-04 op <a href="/">Home</a> | contrib | <a href="gmid.1.html">docs</a>
126 ae6870fa 2021-10-04 op </nav>
127 ae6870fa 2021-10-04 op </header>
128 ae6870fa 2021-10-04 op <h1>contrib</h1>
129 ae6870fa 2021-10-04 op <p>
130 ae6870fa 2021-10-04 op This directory is for additional contributed files which may be
131 ae6870fa 2021-10-04 op useful.
132 ae6870fa 2021-10-04 op </p>
133 ae6870fa 2021-10-04 op <p>Contents:</p>
134 ae6870fa 2021-10-04 op <ul>
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>
139 ae6870fa 2021-10-04 op </ul>
140 ae6870fa 2021-10-04 op <hr />
141 ae6870fa 2021-10-04 op <h2 id="dockerfile">Dockerfile</h2>
142 ae6870fa 2021-10-04 op <p>
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>.
148 ae6870fa 2021-10-04 op </p>
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>
158 ae6870fa 2021-10-04 op <p>
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:
162 ae6870fa 2021-10-04 op </p>
163 ae6870fa 2021-10-04 op <pre># cp contrib/gmid /etc/rc.d</pre>
164 ae6870fa 2021-10-04 op <p>
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.
168 ae6870fa 2021-10-04 op </p>
169 ae6870fa 2021-10-04 op <h2 id="systemd-unit-file">Systemd unit file</h2>
170 ae6870fa 2021-10-04 op <p>
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:
175 ae6870fa 2021-10-04 op </p>
176 ae6870fa 2021-10-04 op <pre># cp contrib/gmid.service /lib/systemd/system/gmid.service</pre>
177 ae6870fa 2021-10-04 op <p>
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.
181 ae6870fa 2021-10-04 op </p>
182 ae6870fa 2021-10-04 op <p>Some things to keep in mind:</p>
183 ae6870fa 2021-10-04 op <ul>
184 ae6870fa 2021-10-04 op <li>
185 eb82dcfb 2021-10-04 op the <code>ExecStart</code> path may depend on the installation.
186 ae6870fa 2021-10-04 op </li>
187 ae6870fa 2021-10-04 op <li>
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>
190 ae6870fa 2021-10-04 op </li>
191 eb82dcfb 2021-10-04 op <li>
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>
194 eb82dcfb 2021-10-04 op </li>
195 ae6870fa 2021-10-04 op </ul>
196 ae6870fa 2021-10-04 op <h2 id="vim-syntax-files">Vim syntax files</h2>
197 ae6870fa 2021-10-04 op <p>
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.
203 ae6870fa 2021-10-04 op </p>
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" />
211 ae6870fa 2021-10-04 op </a>
212 ae6870fa 2021-10-04 op </body>
213 ae6870fa 2021-10-04 op </html>