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 a9dc6fc6 2022-04-07 op A sample Dockerfile that builds an alpine linux-based image with a statically linked gmid installed as /bin/gmid. 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 ae6870fa 2021-10-04 op # docker run --rm -it -p 1965:1965 \
19 ae6870fa 2021-10-04 op -v gmid.conf:/etc/gmid.conf:ro \
20 ae6870fa 2021-10-04 op -v path/to/keys:/tls:ro \
21 ae6870fa 2021-10-04 op -v /var/gemini:/var/gemini:ro \
22 ae6870fa 2021-10-04 op gmid -c /etc/gmid.conf
23 ae6870fa 2021-10-04 op ```
24 ae6870fa 2021-10-04 op
25 a83ba844 2021-10-09 op ## gencert
26 a83ba844 2021-10-09 op
27 1b626eae 2022-01-28 op => TREE/contrib/gencert contrib/gencert
28 a83ba844 2021-10-09 op
29 a83ba844 2021-10-09 op contrib/gencert is a simple script to generate self-signed certificates.
30 a83ba844 2021-10-09 op
31 ae6870fa 2021-10-04 op ## OpenBSD rc file
32 ae6870fa 2021-10-04 op
33 1b626eae 2022-01-28 op => TREE/contrib/gmid contrib/gmid
34 ae6870fa 2021-10-04 op
35 ae6870fa 2021-10-04 op contrib/gmid is a sample service file for OpenBSD rc(8). To install it:
36 9212cf1b 2021-10-04 op
37 ae6870fa 2021-10-04 op ```command to install the rc file
38 ae6870fa 2021-10-04 op # cp contrib/gmid /etc/rc.d
39 ae6870fa 2021-10-04 op ```
40 9212cf1b 2021-10-04 op
41 ae6870fa 2021-10-04 op then the usual ‘rcctl [start|stop|enable|restart] gmid’ are available.
42 ae6870fa 2021-10-04 op
43 21dc3794 2022-01-28 op ## systemd unit file
44 ae6870fa 2021-10-04 op
45 1b626eae 2022-01-28 op => TREE/contrib/gmid.service contrib/gmid.service
46 a00e67f1 2022-03-09 op => TREE/contrib/gmid.sysusers contrib/gmid.sysusers
47 ae6870fa 2021-10-04 op
48 ae6870fa 2021-10-04 op A simple service file for systemd. To install it
49 9212cf1b 2021-10-04 op
50 ae6870fa 2021-10-04 op ```instructions to install the system file
51 379d2608 2022-04-07 op # cp contrib/gmid.service /etc/systemd/system/gmid.service
52 effbc069 2022-04-07 op # systemctl daemon-reload
53 ae6870fa 2021-10-04 op ```
54 9212cf1b 2021-10-04 op
55 ae6870fa 2021-10-04 op then the usual ‘systemctl [status|start|enable|stop] gmid’ commands can be used to manage the server.
56 ae6870fa 2021-10-04 op
57 ae6870fa 2021-10-04 op Some things to keep in mind:
58 eb82dcfb 2021-10-04 op * the ExecStart path may depend on the installation
59 a00e67f1 2022-03-09 op * a ‘gmid’ user needs to be created with systemd-sysusers or useradd:
60 ae6870fa 2021-10-04 op
61 eb82dcfb 2021-10-04 op ```how to create a dedicated user
62 a00e67f1 2022-03-09 op # systemd-sysusers contrib/gmid.sysusers
63 a00e67f1 2022-03-09 op or
64 eb82dcfb 2021-10-04 op # useradd --system --no-create-home -s /bin/nologin -c "gmid Gemini server" gmid
65 eb82dcfb 2021-10-04 op ```
66 eb82dcfb 2021-10-04 op
67 eb82dcfb 2021-10-04 op * logs can be inspected with journalctl(1)
68 eb82dcfb 2021-10-04 op
69 eb82dcfb 2021-10-04 op ```reads gmid logs with journalctl
70 eb82dcfb 2021-10-04 op # journalctl -t gmid
71 eb82dcfb 2021-10-04 op ```
72 eb82dcfb 2021-10-04 op
73 c0f81ed3 2021-10-11 op ## renew certificates automatically
74 c0f81ed3 2021-10-11 op
75 1b626eae 2022-01-28 op => TREE/contrib/renew-certs contrib/renew-certs
76 c0f81ed3 2021-10-11 op
77 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.
78 c0f81ed3 2021-10-11 op
79 c0f81ed3 2021-10-11 op Read the documentation with: perldoc renew-certs
80 c0f81ed3 2021-10-11 op
81 21dc3794 2022-01-28 op ## vim syntax files
82 ae6870fa 2021-10-04 op
83 1b626eae 2022-01-28 op => TREE/contrib/vim contrib/vim
84 ae6870fa 2021-10-04 op
85 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.:
86 9212cf1b 2021-10-04 op
87 ae6870fa 2021-10-04 op ```install the vim syntax highlight in your home
88 ae6870fa 2021-10-04 op $ mkdir -p ~/.vim
89 ae6870fa 2021-10-04 op $ cp -R contrib/vim/* ~/.vim/
90 ae6870fa 2021-10-04 op ```
91 ae6870fa 2021-10-04 op
92 ae6870fa 2021-10-04 op To enable Syntastic checker, add to your vimrc:
93 9212cf1b 2021-10-04 op
94 ae6870fa 2021-10-04 op ```
95 ae6870fa 2021-10-04 op let g:syntastic_gmid_checkers = ['gmid']
96 ae6870fa 2021-10-04 op ```
97 ae6870fa 2021-10-04 op
98 ae6870fa 2021-10-04 op => vim-screenshot.png Screenshot of vim editing gmid.conf