Blob


1 # contributed files
3 This directory is for additional contributed files which may be useful.
5 ## Dockerfile
7 => TREE/contrib/Dockerfile contrib/Dockerfile
9 A sample Dockerfile that builds an alpine linux-based image. To build the image:
11 ```instructions to build the image
12 # docker build -f contrib/Dockerfile -t gmid .
13 ```
15 and then run it with something along the lines of:
17 ```instruction to run the image
18 # docker run --rm -it -p 1965:1965 \
19 -v /var/gemini:/path/to/gemini/root:ro \
20 gmid
21 ```
23 By default a sample config that serves the content of /var/gemini using a self-signed certificate is included.
26 ## gencert
28 => TREE/contrib/gencert contrib/gencert
30 contrib/gencert is a simple script to generate self-signed certificates.
32 ## systemd unit file
34 => TREE/contrib/gmid.service contrib/gmid.service
35 => TREE/contrib/gmid.sysusers contrib/gmid.sysusers
37 A simple service file for systemd. To install it
39 ```instructions to install the system file
40 # cp contrib/gmid.service /etc/systemd/system/gmid.service
41 # systemctl daemon-reload
42 ```
44 then the usual ‘systemctl [status|start|enable|stop] gmid’ commands can be used to manage the server.
46 Some things to keep in mind:
47 * the ExecStart path may depend on the installation
48 * a ‘gmid’ user needs to be created with systemd-sysusers or useradd:
50 ```how to create a dedicated user
51 # systemd-sysusers contrib/gmid.sysusers
52 or
53 # useradd --system --no-create-home -s /bin/nologin -c "gmid Gemini server" gmid
54 ```
56 * logs can be inspected with journalctl(1)
58 ```reads gmid logs with journalctl
59 # journalctl -t gmid
60 ```
62 ## mime.types
64 => TREE/contrib/mime.types contrib/mime.types
66 A copy of OpenBSD' /usr/share/misc/mime.types to be used as
68 ```
69 # /etc/gmid.conf
71 types {
72 include "/path/to/mime.types"
73 }
74 ```
76 ## renew certificates automatically
78 => TREE/contrib/renew-certs contrib/renew-certs
80 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.
82 Read the documentation with: perldoc renew-certs
84 ## vim syntax files
86 => TREE/contrib/vim contrib/vim
88 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.:
90 ```install the vim syntax highlight in your home
91 $ mkdir -p ~/.vim
92 $ cp -R contrib/vim/* ~/.vim/
93 ```
95 To enable Syntastic checker, add to your vimrc:
97 ```
98 let g:syntastic_gmid_checkers = ['gmid']
99 ```
101 Obligatory screenshot:
103 => vim-screenshot.png Screenshot of vim editing gmid.conf