If you, like me, are excited about Project Gemini and want to create your own capsule (Gemini site), you will probably wonder how you would test your capsule on your local machine before putting it out there.
This small (and dirty!) guide aims to remove that doubt.
So, without further dillydally, here goes:
Install GmCapsule by running the following command, assuming that Python is installed:
pip install gmcapsule
Now, create a .gmcapsulerc
file in your home directory, with the following content:
[static]
root = /home/moena/gemini/capsule/
root
should point to where the Gemini files are to be served from.
Notice that the server name is appended to the path above, which means that the real path to the index.gmi
file for the root of the site is located in /home/moena/gemini/capsule/localhost
.
Now we need to create a server certificate and the corresponding key.
Create a directory called .certs
in your home directory, cd into it, and run the following command:
openssl req -new -x509 -days 365 -nodes -out cert.pem -keyout key.pem -subj "/CN=localhost" -newkey rsa:4096 -addext "subjectAltName = DNS:localhost"
The .certs
directory should now contain two files, cert.pem
and key.pem
. The GmCapsule server loads the certificate upon startup.
Now, start the server by running:
gmcapsuled
Use a Gemini client, like amfora
to browse your local Gemini capsule:
amfora gemini://localhost/
Now, enjoy creating content for Gemini!
I am excited about the whole idea of the small internet, and the syntax for the .gmi
files are so simple, much simpler than even Markdown. I like not having to mess around with HTML, CSS, JavaScript, fonts … Just plain text.
I will probably be writing more about Gemini in the future ☺
PS: you might have to open port 1965 if you are running a firewall.