add gemini server

This commit is contained in:
Malin Freeborn 2021-02-24 04:50:05 +01:00
parent 5ad21e4712
commit b1d163f6ee

View File

@ -0,0 +1,49 @@
Make sure your dns is in order.
My domain name is `belgradecats.tk`, so put your own in there.
Install agate by placing the binary somewhere or (on Arch):
> yay -S agate
---
> sudo mkdir -p /usr/share/gemini/{certs,gemini}
> sudo useradd gemini -d /usr/share/gemini
> sudo chown -R gemini:gemini /usr/share/gemini
> sudo su gemini
> cd
> echo 'Hello Gemworld!' > gemini/index.gmi
> cd /usr/share/gemini/certs
> openssl req -new -subj "/CN=belgradecats.tk" -x509 -newkey ec pkeyopt ec_paramgen_curve:prime256v1 -days 3000 -nodes -out cert.pem keyout key.pem
Make a service file.
> sudo vim /etc/systemd/system/multi-user.target.wants/agate.service
```
[Unit]
Description=agate
After=network.target
[Service]
User=gemini
Type=simple
ExecStart=/usr/bin/agate -s --content /usr/share/gemini/gemini --key /usr/share/gemini/certs/key.pem --cert /usr/share/gemini/certs/cert.pem --hostname belgradecats.tk --lang en-GB
[Install]
WantedBy=default.target
```
> sudo systemctl daemon-reload
> sudo systemctl enable --now agate