From b1d163f6eee6a28600999698b8bc3d6d88ee2954 Mon Sep 17 00:00:00 2001 From: Malin Freeborn Date: Wed, 24 Feb 2021 04:50:05 +0100 Subject: [PATCH] add gemini server --- networking/servers/agate.md | 49 +++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 networking/servers/agate.md diff --git a/networking/servers/agate.md b/networking/servers/agate.md new file mode 100644 index 0000000..8bcce7f --- /dev/null +++ b/networking/servers/agate.md @@ -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 +