gmid/site/contrib.gmi

104 lines
2.5 KiB
Plaintext
Raw Permalink Normal View History

2022-01-28 09:34:39 +01:00
# contributed files
2021-10-04 12:42:35 +02:00
This directory is for additional contributed files which may be useful.
## Dockerfile
=> TREE/contrib/Dockerfile contrib/Dockerfile
2021-10-04 12:42:35 +02:00
A sample Dockerfile that builds an alpine linux-based image. To build the image:
2021-10-04 12:42:35 +02:00
```instructions to build the image
# docker build -f contrib/Dockerfile -t gmid .
```
2021-10-04 12:42:35 +02:00
and then run it with something along the lines of:
2021-10-04 12:42:35 +02:00
```instruction to run the image
# docker run --rm -it -p 1965:1965 \
-v /var/gemini:/path/to/gemini/root:ro \
gmid
2021-10-04 12:42:35 +02:00
```
By default a sample config that serves the content of /var/gemini using a self-signed certificate is included.
2021-10-09 16:16:28 +02:00
## gencert
=> TREE/contrib/gencert contrib/gencert
2021-10-09 16:16:28 +02:00
contrib/gencert is a simple script to generate self-signed certificates.
2022-01-28 09:34:39 +01:00
## systemd unit file
2021-10-04 12:42:35 +02:00
=> TREE/contrib/gmid.service contrib/gmid.service
=> TREE/contrib/gmid.sysusers contrib/gmid.sysusers
2021-10-04 12:42:35 +02:00
A simple service file for systemd. To install it
2021-10-04 12:42:35 +02:00
```instructions to install the system file
# cp contrib/gmid.service /etc/systemd/system/gmid.service
2022-04-07 14:29:04 +02:00
# systemctl daemon-reload
2021-10-04 12:42:35 +02:00
```
2021-10-04 12:42:35 +02:00
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
```
2021-10-04 12:42:35 +02:00
## mime.types
2024-01-05 20:13:59 +01:00
=> 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
2022-01-28 09:34:39 +01:00
## vim syntax files
2021-10-04 12:42:35 +02:00
=> TREE/contrib/vim contrib/vim
2021-10-04 12:42:35 +02:00
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.:
2021-10-04 12:42:35 +02:00
```install the vim syntax highlight in your home
$ mkdir -p ~/.vim
$ cp -R contrib/vim/* ~/.vim/
```
To enable Syntastic checker, add to your vimrc:
2021-10-04 12:42:35 +02:00
```
let g:syntastic_gmid_checkers = ['gmid']
```
2024-01-07 18:25:15 +01:00
Obligatory screenshot:
2021-10-04 12:42:35 +02:00
=> vim-screenshot.png Screenshot of vim editing gmid.conf