Agate on Arch Linux

Docs are here.

You will need DNS set up before proceeding.

Install agate.

yay -S agate

Be root!

In my case the domain is 'splint.rs'.

DOMAIN1=splint.rs

You can set up any number of domain names.

DOMAIN2=ttrpgs.com

Make a directory to serve the gemini files from:

GEMDIR=/srv/gemini

mkdir -p $GEMDIR/$DOMAIN1

mkdir -p $GEMDIR/$DOMAIN2

Put at least one gemini file into the directory:

1echo Welcome to $DOMAIN1 > $GEMDIR/$DOMAIN1/index.gmi
2echo Welcome to $DOMAIN2 > $GEMDIR/$DOMAIN2/index.gmi

Set a language variable:

LANG=en_GB

You need to run the agate command once interactively, in order to create certs:

1agate --content $GEMDIR --certs $GEMDIR/.certs \
2    --addr [::]:1965 --addr 0.0.0.0:1965
3    --hostname $DOMAIN1 --hostname $DOMAIN2
4    --lang $LANG

Once that works, it's time to make a service file; select any name for it:

SVFILE=st

1echo "
2CONTENT=--content $GEMDIR
3CERT=--certs $GEMDIR/.certs
4ADDR=--addr [::]:1965 --addr 0.0.0.0:1965
5HOSTNAME=--hostname $DOMAIN1 --hostname $DOMAIN2
6LANG=--lang $LANG
7" > $SVFILE.conf

Check the service file has all those variables and looks right:

cat $SVFILE.conf

Now move it into the agate config directory:

mv $SVFILE.conf /etc/agate/

And finally, start the service:

1systemctl daemon-reload
2systemctl enable --now agate@$SVFILE.conf

Your Gemini capsule should be available, and you should be able to see any access in the logs:

1journalctl -xeu agate@$SVFILE.conf