Blame


1 21dc3794 2022-01-28 op # contributed files
2 ae6870fa 2021-10-04 op
3 ae6870fa 2021-10-04 op This directory is for additional contributed files which may be useful.
4 ae6870fa 2021-10-04 op
5 ae6870fa 2021-10-04 op ## Dockerfile
6 ae6870fa 2021-10-04 op
7 1b626eae 2022-01-28 op => TREE/contrib/Dockerfile contrib/Dockerfile
8 ae6870fa 2021-10-04 op
9 ad3bf176 2024-01-11 op A sample Dockerfile that builds an alpine linux-based image. To build the image:
10 ae6870fa 2021-10-04 op
11 ae6870fa 2021-10-04 op ```instructions to build the image
12 ae6870fa 2021-10-04 op # docker build -f contrib/Dockerfile -t gmid .
13 ae6870fa 2021-10-04 op ```
14 9212cf1b 2021-10-04 op
15 ae6870fa 2021-10-04 op and then run it with something along the lines of:
16 9212cf1b 2021-10-04 op
17 ae6870fa 2021-10-04 op ```instruction to run the image
18 ad3bf176 2024-01-11 op # docker run --rm -it -p 1965:1965 \
19 ad3bf176 2024-01-11 op -v /var/gemini:/path/to/gemini/root:ro \
20 ad3bf176 2024-01-11 op gmid
21 ae6870fa 2021-10-04 op ```
22 ae6870fa 2021-10-04 op
23 ad3bf176 2024-01-11 op By default a sample config that serves the content of /var/gemini using a self-signed certificate is included.
24 ad3bf176 2024-01-11 op
25 ad3bf176 2024-01-11 op
26 a83ba844 2021-10-09 op ## gencert
27 a83ba844 2021-10-09 op
28 1b626eae 2022-01-28 op => TREE/contrib/gencert contrib/gencert
29 a83ba844 2021-10-09 op
30 a83ba844 2021-10-09 op contrib/gencert is a simple script to generate self-signed certificates.
31 a83ba844 2021-10-09 op
32 21dc3794 2022-01-28 op ## systemd unit file
33 ae6870fa 2021-10-04 op
34 1b626eae 2022-01-28 op => TREE/contrib/gmid.service contrib/gmid.service
35 a00e67f1 2022-03-09 op => TREE/contrib/gmid.sysusers contrib/gmid.sysusers
36 ae6870fa 2021-10-04 op
37 ae6870fa 2021-10-04 op A simple service file for systemd. To install it
38 9212cf1b 2021-10-04 op
39 ae6870fa 2021-10-04 op ```instructions to install the system file
40 379d2608 2022-04-07 op # cp contrib/gmid.service /etc/systemd/system/gmid.service
41 effbc069 2022-04-07 op # systemctl daemon-reload
42 ae6870fa 2021-10-04 op ```
43 9212cf1b 2021-10-04 op
44 ae6870fa 2021-10-04 op then the usual ‘systemctl [status|start|enable|stop] gmid’ commands can be used to manage the server.
45 ae6870fa 2021-10-04 op
46 ae6870fa 2021-10-04 op Some things to keep in mind:
47 eb82dcfb 2021-10-04 op * the ExecStart path may depend on the installation
48 a00e67f1 2022-03-09 op * a ‘gmid’ user needs to be created with systemd-sysusers or useradd:
49 ae6870fa 2021-10-04 op
50 eb82dcfb 2021-10-04 op ```how to create a dedicated user
51 a00e67f1 2022-03-09 op # systemd-sysusers contrib/gmid.sysusers
52 a00e67f1 2022-03-09 op or
53 eb82dcfb 2021-10-04 op # useradd --system --no-create-home -s /bin/nologin -c "gmid Gemini server" gmid
54 eb82dcfb 2021-10-04 op ```
55 eb82dcfb 2021-10-04 op
56 eb82dcfb 2021-10-04 op * logs can be inspected with journalctl(1)
57 eb82dcfb 2021-10-04 op
58 eb82dcfb 2021-10-04 op ```reads gmid logs with journalctl
59 eb82dcfb 2021-10-04 op # journalctl -t gmid
60 eb82dcfb 2021-10-04 op ```
61 eb82dcfb 2021-10-04 op
62 b6c093c9 2022-04-08 op ## mime.types
63 b6c093c9 2022-04-08 op
64 ac6c76f8 2024-01-05 op => TREE/contrib/mime.types contrib/mime.types
65 b6c093c9 2022-04-08 op
66 b6c093c9 2022-04-08 op A copy of OpenBSD' /usr/share/misc/mime.types to be used as
67 b6c093c9 2022-04-08 op
68 b6c093c9 2022-04-08 op ```
69 b6c093c9 2022-04-08 op # /etc/gmid.conf
70 b6c093c9 2022-04-08 op
71 b6c093c9 2022-04-08 op types {
72 b6c093c9 2022-04-08 op include "/path/to/mime.types"
73 b6c093c9 2022-04-08 op }
74 b6c093c9 2022-04-08 op ```
75 b6c093c9 2022-04-08 op
76 c0f81ed3 2021-10-11 op ## renew certificates automatically
77 c0f81ed3 2021-10-11 op
78 1b626eae 2022-01-28 op => TREE/contrib/renew-certs contrib/renew-certs
79 c0f81ed3 2021-10-11 op
80 c0f81ed3 2021-10-11 op contrib/renew-certs is a script meant to be run in a crontab that watch for certificate expiration. It can optionally renew the certs and restart gmid too.
81 c0f81ed3 2021-10-11 op
82 c0f81ed3 2021-10-11 op Read the documentation with: perldoc renew-certs
83 c0f81ed3 2021-10-11 op
84 21dc3794 2022-01-28 op ## vim syntax files
85 ae6870fa 2021-10-04 op
86 1b626eae 2022-01-28 op => TREE/contrib/vim contrib/vim
87 ae6870fa 2021-10-04 op
88 ae6870fa 2021-10-04 op contrib/vim contains a syntax highlighting for vim. To install it, just copy the files to ~/.vim or to /usr/share/vim/vimfiles, e.g.:
89 9212cf1b 2021-10-04 op
90 ae6870fa 2021-10-04 op ```install the vim syntax highlight in your home
91 ae6870fa 2021-10-04 op $ mkdir -p ~/.vim
92 ae6870fa 2021-10-04 op $ cp -R contrib/vim/* ~/.vim/
93 ae6870fa 2021-10-04 op ```
94 ae6870fa 2021-10-04 op
95 ae6870fa 2021-10-04 op To enable Syntastic checker, add to your vimrc:
96 9212cf1b 2021-10-04 op
97 ae6870fa 2021-10-04 op ```
98 ae6870fa 2021-10-04 op let g:syntastic_gmid_checkers = ['gmid']
99 ae6870fa 2021-10-04 op ```
100 ae6870fa 2021-10-04 op
101 b8537c1c 2024-01-07 op Obligatory screenshot:
102 b8537c1c 2024-01-07 op
103 ae6870fa 2021-10-04 op => vim-screenshot.png Screenshot of vim editing gmid.conf