Link Updates

2024-10-08

---

Since I first launched my capsule, I've always used absolute URLs for both internal and external links. Every link from one document to another on my capsule included "gemini://jsreed5.org" as part of its URL. This was fine, as long as I had no plans to change any part of the domain in the future.

Now, three and a half years later, I want to expand some of the services I run on the AWS EC2 instance that runs Rob's Gemini Capsule. I want to set up a reverse proxy and delegate subdomains to different services. In order to do that, I needed to change all my internal links from absolute to relative--instead of a home link pointing to "gemini://jsreed5.org/index.gmi", it would now point to "/index.gmi". I spent Sunday and Monday converting all those links.

Conversion took much more effort than I thought it would. I serve hundreds of (non-OEIS) gemtext documents on the capsule, and replacing the links in all of them wasn't always as simple as finding and replacing part of the URL programmatically. Most of these documents are tracked by git, but some are not, and I had to edit those documents on the EC2 instance itself. I then had to modify all my CGIs to print relative links and edit any gemtext documents generated by those CGIs, such as my guestbook page. I also use some local scripts and template gemtexts when writing logs; those need to be modified separately on each of my devices.

The real behemoth was my OEIS mirror. Updating the backend scripts that generate the gemtexts was simple enough, but I then had to change all the existing gemtexts, of which there are over 375,000. I had to rely on `find | sed` to take care of them all, and even then, it took a few hours to run successfully.

In total, about 2.14 million internal links were replaced on my capsule, not counting links generated by CGIs. With that many links to handle, I'm sure I've broken something somewhere. If you find any broken links on Rob's Gemini Capsule, please let me know.

I've received a recommendation to use Traefik as my reverse proxy. My goal is to allow connections to the capsule using either the domain "jsreed5.org" or the subdomain "gemini.jsreed5.org", while all other services require a subdomain (gopher.jsreed5.org, finger.jsreed5.org, etc.). I hope Traefik will allow me to do just that.

---

Up One Level

Home

[Last updated: 2024-10-08]


Source