I'm blogging about Emacs, Drupal, php and exciting subjects

· Lars Nielsen

Self-Hosted Gitea Behind Caddy and an SSH Tunnel: HTTP Through the Proxy, SSH Straight Through

My search engine project hosted its own git server, a Gitea instance on one of its four machines. Until July, the only way to reach it was an SSH tunnel I started by hand in a terminal, which disappeared whenever that terminal did. In July, it got a proper public address, with HTTPS from Caddy and SSH for clone and push.

Read article Self-Hosted Gitea Behind Caddy and an SSH Tunnel: HTTP Through the Proxy, SSH Straight Through
· Lars Nielsen

From Ivy and Counsel to Vertico, Consult and Orderless: Moving Emacs Completion Onto the Built-in Interfaces

In an article about my Emacs config this summer, I wrote that my completion stack was Ivy, Counsel and Swiper rather than "the newer Vertico-and-consult combination everyone reaches for now", because the old stack still did the job and switching wasn't worth the churn.

Read article From Ivy and Counsel to Vertico, Consult and Orderless: Moving Emacs Completion Onto the Built-in Interfaces
· Lars Nielsen

composer-patches 2.0 on a Drupal Site: patches.lock.json, relock and repatch, and a Leftover From Version 1

"How do I apply a patch with Composer?" is one of the most-viewed Drupal questions on Stack Exchange, and the plugin behind the usual answer, cweagans/composer-patches, changed its workflow in version 2. This site upgraded to version 2.0 in August, as one of the build-tool upgrades before Drupal 11.

Read article composer-patches 2.0 on a Drupal Site: patches.lock.json, relock and repatch, and a Leftover From Version 1
· Lars Nielsen

Ansible Vault Problems That Weren't Leaks: A Placeholder That Broke Every Deploy and a Password in the Wrong File

My search engine's servers were configured with Ansible, and their secrets lived in Ansible Vault files: database passwords, the admin password, API keys, encrypted in the repository and decrypted at deploy time. In mid-August, I cleaned up two problems in those files. Neither was a leak, but each was the kind of thing that makes the next leak, or the next outage, more likely.

Read article Ansible Vault Problems That Weren't Leaks: A Placeholder That Broke Every Deploy and a Password in the Wrong File
· Lars Nielsen

Swapping MySQL for Percona Server in Docker: The Config File It Silently Stopped Reading

In July my search engine's MySQL server, running in Docker on the pipeline server, was replaced with Percona Server. The reason was a plan to move the biggest table, the link graph, to the RocksDB storage engine later, and Percona Server ships it as MyRocks; the image includes the ha_rocksdb.so plugin.

Read article Swapping MySQL for Percona Server in Docker: The Config File It Silently Stopped Reading
· Lars Nielsen

Memory Limits on Database Containers: What Has to Fit Under mem_limit for MySQL and OpenSearch

Nearly every service in my search engine's Docker setup had a mem_limit. That's good practice on small shared servers, and it was behind a good part of the summer's mysterious slowness, because a limit only works if you know everything that has to fit under it. Over July and August, the MySQL container and the OpenSearch container each had their limits changed three times.

Read article Memory Limits on Database Containers: What Has to Fit Under mem_limit for MySQL and OpenSearch
· Lars Nielsen

cAdvisor Saw No Containers: Docker's containerd Snapshotter and a Missing mount-id File

The per-container panels in my search engine's Grafana had shown almost nothing. Memory per container, CPU per container: mostly empty, apart from a single series for the whole machine. The comments in the monitoring config blamed a known limitation, that filesystem metrics didn't work with Docker's newer storage backend. That was wrong in an important way.

Read article cAdvisor Saw No Containers: Docker's containerd Snapshotter and a Missing mount-id File
· Lars Nielsen

Caddy Wouldn't Start: Docker Compose Passed an Empty Variable and the Caddyfile Default Never Applied

My search engine's public server put Caddy in front of everything to get Let's Encrypt certificates automatically. While setting it up, I used Let's Encrypt's staging service, to avoid burning the production rate limit on failed attempts, and switched to production by removing the setting from .env. Caddy then refused to start.

Read article Caddy Wouldn't Start: Docker Compose Passed an Empty Variable and the Caddyfile Default Never Applied
· Lars Nielsen

A Backup Script Where a Failed Dump Can't Look Like a Backup: pipefail, Temp Files and Per-Label Retention

CaRMen, my CRM, has a backup script that's 22 lines long. It runs every night from cron and before every deploy, and the deploy script restores from it automatically when a release changes the schema and then fails its health check. A script that a rollback depends on has to be right in the boring details. Three of them are worth spelling out.

Read article A Backup Script Where a Failed Dump Can't Look Like a Backup: pipefail, Temp Files and Per-Label Retention
Subscribe to Linkhub