Agate Setup
In the time-honoured tradition of "blog which only has a post about setting it up," here's some notes for my future self to come back to when I've forgotten what I did a few years down the line and I'm migrating it to another server or something.
It's easy enough to run, but I've got it on a server and want it to 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 cd "$(dirname $0)" 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