aboutsummaryrefslogtreecommitdiff
path: root/site/contrib.gmi
blob: 52530ea9194365b7b6368fbe3eb88e04d271d43c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# contributed files

This directory is for additional contributed files which may be useful.

## Dockerfile

=> TREE/contrib/Dockerfile contrib/Dockerfile

A sample Dockerfile that builds an alpine linux-based image.  To build the image:

```instructions to build the image
# docker build -f contrib/Dockerfile -t gmid .
```

and then run it with something along the lines of:

```instruction to run the image
# docker run --rm -it -p 1965:1965 \
        -v /var/gemini:/path/to/gemini/root:ro \
	gmid
```

By default a sample config that serves the content of /var/gemini using a self-signed certificate is included.


## gencert

=> TREE/contrib/gencert contrib/gencert

contrib/gencert is a simple script to generate self-signed certificates.

## systemd unit file

=> TREE/contrib/gmid.service contrib/gmid.service
=> TREE/contrib/gmid.sysusers contrib/gmid.sysusers

A simple service file for systemd.  To install it

```instructions to install the system file
# cp contrib/gmid.service /etc/systemd/system/gmid.service
# systemctl daemon-reload
```

then the usual ‘systemctl [status|start|enable|stop] gmid’ commands can be used to manage the server.

Some things to keep in mind:
* the ExecStart path may depend on the installation
* a ‘gmid’ user needs to be created with systemd-sysusers or useradd:

```how to create a dedicated user
# systemd-sysusers contrib/gmid.sysusers
 or
# useradd --system --no-create-home -s /bin/nologin -c "gmid Gemini server" gmid
```

* logs can be inspected with journalctl(1)

```reads gmid logs with journalctl
# journalctl -t gmid
```

## mime.types

=> TREE/contrib/mime.types contrib/mime.types

A copy of OpenBSD' /usr/share/misc/mime.types to be used as

```
# /etc/gmid.conf

types {
	include "/path/to/mime.types"
}
```

## renew certificates automatically

=> TREE/contrib/renew-certs contrib/renew-certs

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.

Read the documentation with: perldoc renew-certs

## vim syntax files

=> TREE/contrib/vim contrib/vim

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.:

```install the vim syntax highlight in your home
$ mkdir -p ~/.vim
$ cp -R contrib/vim/* ~/.vim/
```

To enable Syntastic checker, add to your vimrc:

```
let g:syntastic_gmid_checkers = ['gmid']
```

Obligatory screenshot:

=> vim-screenshot.png Screenshot of vim editing gmid.conf