💾 Archived View for jsreed5.org › log › 2021 › 202110 › 20211027-guestbook.gmi captured on 2021-12-06 at 14:29:53. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-12-04)

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

Guestbook

2021-10-27

---

I added a guestbook to the capsule today. Visitors with a client certificate can sign the guestbook simply by following a link; the common name and the truncated SHA256 hash of the certificate will automatically be added to the guestbook. If the common name is detected to be empty, the user can manually add a name to sign.

There are a few reasons I wanted to implement such functionality. Of course I'm curious as to who visits the capsule, but I also want to get some experience using certificates in Gemini. I already have an inputless CGI script ("My Age in Miles") and a CGI script that involves asking the user for input ("US Local Weather"), but I haven't created a CGI script that requires a client certificate before.

It turns out implementing such functionality is almost trivial--and that simplicity is one thing I love about Gemini so much. All I had to do was print a "60" status code if a client certificate was not provided, and add to the guestbook otherwise. Once I figured out what I had to do, the script was up and running in minutes.

One problem I ran into was that gmnisrv needed to be updated. The version I had been running did not properly set the REMOTE_USER variable from the certificate, but the current version does. Re-cloning the repository and reinstalling solved the problem.

While I hope the guestbook is used by visitors, I'm content with simply having built it. It's quite fun to dig into the capabilities of Gemini.

---

Up One Level

Home

[Last updated: 2021-10-29]