In comparison to Linux installation guides, getting a Gemini server up and running in 9front is pretty straightforward.
First, I would recommend installing git9.
% cd /tmp
% hget https://orib.dev/git/git9/HEAD/snap.tar.gz | tar xvz
% cd git9
% mk all
% mk install
We now need to install the Gemini server rc script.
% webfs
% mkdir /rc/bin/rc-gemd
% cd /rc/bin/rc-gemd
% git/clone https://git.sr.ht/~moody/rc-gemd
Generate the required TLS key and certificate. Note that you should replace “your.domain.here” with the relevant domain name.
% mkdir -p /lib/ssl
% auth/rsagen -t 'service=tls owner=*' >/lib/ssl/gem.key
% auth/rsa2x509 'C=US CN=your.domain.here' gem.key | auth/pemencode CERTIFICATE >/lib/ssl/gem.cert
Add the generated key in the previous step to factotum.
% cat /lib/ssl/gem.key >> /mnt/factotum/ctl
By default, all capsule files reside in /lib/gem/. A simple gemlog file structure might look something like the following.
/lib/gem/
├── 2021
│ └── 03
│ ├── 03-9front-linode-vm.gem
│ ├── 04-9front-remote-cpu.gem
│ ├── 05-9front-gemini-server.gem
│ ├── 06-sam-cheatsheet.gem
│ ├── 07-bookmarks.gem
│ └── 08-irc2.gem
└── index.gem
I find it helpful to have all of my capsule files one one git repository called “gem”.
% cd /lib
% git/clone http://github.com/[USERNAME]/gem
Start the server using the following command.
% aux/listen1 tcp!*!1965 tlssrv -c /lib/ssl/gem.cert /rc/bin/rc-gemd/rc-gemd
We add this command to an rc script that can be run at startup.
% cd $home/bin/rc
% sam -d gemstart
1
c
#!/bin/rc
aux/listen1 tcp!*!1965 tlssrv -c /lib/ssl/gem.cert /rc/bin/rc-gemd/rc-gemd
.
w
q
% chmod +x gemstart