Today I Learned ...

Welcome!

This little sub-blog is supposed to be a space for me to write down smaller technical discoveries that I stumble upon during my Development/Software Architecture work. Why? Because too often I run into the same thing twice only vaguely remembering how I did it and what resources I used to find out.

... How To Keep Your Hugo Site's Content In A Different Repository

I use vim as my primary editor for everything related to code. But when it comes to writing blog posts, I don’t always use vim. In fact I don’t always use my laptop. I resort to a Markdown-Editor that is available on all my devices and has basic git-capability, so I can push it to a remote repository.

But how do I get the files from this repository into my blog?

... about GitLab Caches and Artifacts (and which to use for node_modules)

When you deploy a NodeJS application with GitLab, one of the first steps is the installation of the dependencies. Many subsequent pipeline jobs will depend on the installation result, which is the node_modules folder (or several folders).

GitLab jobs, however, runs completely independent from each other and don’t share any resulting output by default. So how can subsequent jobs use the node_modules folder?

In GitLab there are two ways to hand over files to other jobs: Artifacts and Caching. Here are some of the basic characteristics.

... A Number of Things about Gitlab Ci and Npm

Recently I had to add a semi-complex TS application to quite-complex GitLab CI/CD pipeline.

Here are a number of resources that helped me understand some of the peculiarities of running npm inside GitLab:

... npm config and Workspaces

npm workspaces can be a handy thing: They’re a small, under-appreciated feature that let’s you create a simple mono-repo with a single entry in your package.json file.

There’s one thing that recently got me confused though: I had one app inside a workspace that used a custom npm registry. I tried to set the registry url using a local .npmrc file but it didn’t work. Had I looked more closely I would’ve seen the little ENOWORKSPACES message. Turns out npm ignores the local config if there is a different setting for the whole repository. I think it kind of makes sense due to potential conflicts in the overall mono-repo.

... How Hugo Server Treats The BaseURL setting

I was just wondering why my RSS URLs don’t work in the deployed version of this site. All Feed Links were pointing to localhost:1313 instead of the baseURL set in my hugo.toml configuration file.

Turns out hugo server ignores the baseURL setting. The reason, I assume, is that hugo server is used as a dev server and you shouldn’t have to point your configuration to localhost while developing and then switching to the live URL when deploying.

... About Podman Quadlets

If you run your containers in production it makes a whole lot of sense to tie them into systemd. It’s incredibly easy to do. This is an excellent blog post that tells you how to do it:

Quadlet: Running Podman containers under systemd.

... Hugomods Container Images and rootless vs. non-root

This blog is powered by the Hugo static site generator. I run this Hugo installation in a rootless podman container. While looking for a fitting container image (so I don’t have to maintain my own) I found the hugomods docker images. They have a ton of images to run Hugo for all kinds of environments. I found various images tagged non-root and thought: Bam! That’s what I’m looking for! I was pretty surprised that it didn’t work. Instead this (simplified) podman call would give me a permission error: