💾 Archived View for livk.dev › agate-setup.gmi captured on 2022-04-28 at 17:43:14. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

Agate Setup

gemini://qwertqwefsday.eu/agate.gmi

It's easy enough to run, but I've got it on a server and want it do run at boot. I also want to be able to edit locally and push to the server.

I have a single folder with everything needed called `gemini`. The location isn't important, I've put it in a folder synced by syncthing, but it could just as easily be a git repository.

Let's get it to run locally first. Download the latest agate release, and decompress it into the `gemini` folder. In this folder, run:

mkdir livk.dev
echo '# Hello there' > livk.dev/index.gmi
./agate --content livk.dev --hostname livk.dev

It'll generate self-signed certificates in a new directory called `.certificates` in the current directory.

Here's the systemd unit file.

[Unit]
Description=agate
After=network.target

[Service]
User=liv
Type=simple
ExecStart=/home/liv/gemini/start.sh

[Install]
WantedBy=default.target

In start.sh, we'll include a line to make sure we're in the right directory so it can find our certificates.

#!/bin/sh

cd $(dirname $0)
./agate --content livk.dev --hostname livk.dev

We can sync all this to the server using rsync. I've put this in a script so I don't have to type it out. This will copy the whole folder, sync script, systemd unit, gmi files, certificates (if you've already generated them), the whole lot.

#!/bin/sh

rsync -aP . liv@livk.dev:/home/liv/gemini

Once the files are all on the server, we can log in to the server and set up the service.

sudo ln -s /home/liv/gemini/agate.service /lib/systemd/system
sudo systemctl enable --now agate

And lastly, if you use ufw, don't forget to allow traffic on port 1965.

sudo ufw allow 1965/tcp

This page in other languages

Esperanto