My thoughts on Slackware, life and everything

Tag: wordpress (Page 1 of 2)

Heads-up: Alien Pastures blog will become Hugo-powered

I have been playing with the idea of leaving Wordpress behind as the content publishing platform for my Alien Pastures blog.
Wordpress is great software and it's versatile and offers a wealth of plugins that allow the blog owner to do all kinds of nice stuff. For me it was the ideal solution at the time when I wanted to create a blog and was looking for something self-hosted but also self-contained (the whole blog in one single directory). I was not sure if I would be able to keep running it on the server where the blog was born, therefore something like Wordpress CMS combined with a SQLite file-based database backend was perfect.

That was 16 years ago, and the blog moved servers, grew a lot in content and it uses a proper MariaDB backend now. But it puts a strain on the servers where I host(ed) it; the stable Slackware versions (first 14.2, then 15.0) have become stale and Wordpress started requiring versions of PHP and MariaDB that were not available for the Slackware version I was using... also the blog increasingly needs protection from scammers, spammers, AI-bot-scrapers and hackers; it needs performance tweaks to deal with server load and executing the interpreted PHP code in which Wordpress is written, and there are security vulnerabilities discovered in Wordpress and its plugins all the time.

When today I had to upgrade the Wordpress code and a good ten plugins again because of a un-authenticated Remote Code Execution (RCE) vulnerability, accompanied by stern warnings to "backup your database first!", I knew that my research would ultimately pay off.

I decided to move forward with an experiment I have been conducting for a while. My future blog pages will all be static HTML. Nothing is interpreted, nothing is vulnerable other than potentially Apache or Slackware itself, and I will use a Docker container for a part of the new setup.

That setup is based on a new (private) git repository which will hold my blog's content after it has been converted from Wordpress syntax into Hugo syntax and layout. Hugo is a static site generator, written in Go. How that will work with this git repository?

  • I run a converter on a full export of the Wordpress blog (that's a single XML file containing everything except the media files) to generate a collection of static HTML pages that will become the "legacy" part of the new blog.
  • In a private repository on the Slackware Forge I will store the Hugo framework defining the layout of my blog, the theme for my blog (a Hugo port of the GPL-licensed Wordpress theme 'Hemingway' by Anders Norén which I currently use), the converted legacy (Wordpress) content plus the Sveltia in-browser editor which I will be using to write and publish new articles. Sveltia can read the repository's full content and can also write to that repository.
  • Since a Hugo-generated static web site does not know the concept of a comments section because that goes against the static page concept, I will run a self-hosted Artalk comments server in Docker. My new blog will load the comments below each blog article by asking the Artalk server for them over a trusted connection, protected by Docker secrets.
  • When someone posts a comment, it is held in a moderation queue, unless that someone (the combination of nickname and email address) already has an earlier approved comment, in which case the comment will automatically be approved by a moderator bot within the minute. This moderation plugs into an Akismet anti-spam service just like I have right now on the Wordpress blog. It will prevent me from having to deal with a hundred spam comments per day.
  • When I make a change to the repository (updating the blog layout, adding a new theme, whatever) this triggers a Forgejo CI workflow in git. Those triggers are very similar to Github runners if you use CI on Github (or any other git platform). The Forgejo runner starts a Docker image which contains Hugo; Hugo fetches the repository content, renders the lot into static HTML pages and packs the whole set into a registry package.
  • A cron job on the blog server polls the Forge for updated site content packages every two minutes, and pulls that package when one becomes available. It unpacks the tarball (it's nothing more than that), checks if the sha256 checksum is correct and then refreshes the blog's content - the pages which you are seeing.
  • When I want to write or update an article, I launch Sveltia (via a hidden URL on the blog), login to the Slackware Forge and start writing.  When I click "publish", Sveltia will commit my article to the private repository, triggering the CI workflow, and two minutes later the new article is online.
    When I save an article in Draft, then Sveltia commits the article in a temporary git branch; any branch except "main" will never trigger the CI workflow, so you will never see my drafts by accident :-)

There's a lot of moving parts in that setup, and it is not as straight-forward as Wordpress; but it is a good learning experience into Git workflows. Also, the constituent parts (except for the free tier of the online Akismet anti-spam service) that I deploy locally are not tied to any kind of commercial entity and fully open source. And it's a hundred percent safe solution.

And... you may have noticed that I wrote the above plan in great detail. That is because I have all of this already running as a staging server while I debug this new setup, remove the kinks and tweak everything to my liking. Feel free to look and click around, post comments if you want, but know that all of that will be wiped again when I make the switch. Also the content of that staging server is frozen to the moment when I did the last content conversion. This new post will not appear there.

Have a look at https://hugo.slackware.nl/ and tell me when you find bugs. I need some time for an actual cut-over and I am not yet completely happy with the Sveltia editor setup, so Wordpress will remain the blog's CMS for a while.

The hugo-builder repository on the Slackware Forge on the other hand, is open to anyone who is curious to start experimenting with Hugo themselves; it contains the code that generates the Docker image used by the aforementioned CI workflow.
I added a subdirectory 'workflow-example' which contains a copy of the actual CI runner that I am using for the new Alien Pastures blog. You can copy that into your own repository and rename the directory to '.forgejo'; you'd also have to do some small modifications and define some variables and secrets in your Forge account to make it work for your own future Hugo website.

New URL: blog.slackware.nl

Me

Hi all.
It was time to migrate my blog to a new server. The URL 'alien.slackbook.org/blog/' has changed to 'blog.slackware.nl'.

For years, my hosting server has been https://harrier.slackbuilds.org/ - ever since I had to move away from the original host, the slackware.com server (Pat does not trust PHP code).
I am eternally grateful to the team of people (Robby Workman and friends) who purchased its hardware and have been maintaining it in a US datacenter for all that time. They gave me full root rights over my virtual machine. Also many thanks to Teklinks for offering colocation and bandwidth!
Check out harrier's frontpage to get an idea of all the Slackware community services are hosted on that iron.

But the QEMU VM which runs on harrier and which essentially hosted my blog, is still on Slackware 14.2. Over time I had to upgrade httpd, mariadb and php to keep the Wordpress code happy, but now Wordpress is again nagging me about not having PHP 8 and to be honest, Slackware 14.2 has not received security updates for two years now. I am not feeling comfortable with that.
I had a short chat with Robby and he indicated that there's just too much to be done and too little time to do it. I fully understand that and I have not bothered him with my worries.

I decided to migrate the blog to a new Slackware -current host. I have done a few trial runs over the years; it is not trivial to move a Wordpress blog to a new domain and at the same time to a new host. But I think I figured out the challenges and ironed out the kinks.

Also, this was a good opportunity to reconsider the hosting location. Harrier runs in a US datacenter. I am not at all happy with the racist and autocratic direction the US is taking under Trump and his MAGA cult. I've seen people being detained and/or sent back at airport border control checkpoints simply because they have written online posts that are unfavorable to Trump. Look at my previous posts here on the blog - I will not attempt to enter the US as long as Trump is its dictator. And therefore it makes sense to choose the European Union as the new location for my blog server.

Welcome to blog.slackware.nl! Please update your bookmarks.
I am creating a redirect for alien.slackbook.org/blog/ to get that forwarded to the new URL, but it never hurts to spread the word to your friends.

Cheers, Eric

I switched the blog's theme

A blog  is something personal, and theming it just right is a challenge. You'll surely have noticed that the theme of Alien Pastures has been changed overnight.

This blog started out with a theme by Andreas Viklund (wp-andreas01) but that did not scale well on mobile devices, also it did weird stuff with user comments. I liked its visual quality a lot but the usability challenges were not fixable even by rummaging around in its code.
Eventually I replaced that with a new theme by Rajeeb Banstola (techism) but during my recent Wordpress blog-code update I realized that this techism theme had not been updated for years, the author's website has disappeared and the Freemius SDK from which that theme is created has a XSS vulnerability. Real shame because I thought it was beautiful, light, responsive and it fixed the user comment issues I mentioned previously.

So I have used my December holiday to look for another theme, experimenting with several, but I wanted to end with one that at a minimum allows me to have two columns: one for the articles and one as a sidebar with widgets showing all kinds of permanent info. Three columns was what I had with wp-andreas01 and techism, but I could live without one of the two sidebars.

I finally found a theme collection created by Anders Norén. On his page teman he showcases several that I find appealing, but after some experimenting I chose his Lovecraft and Hemingway themes over Baskerville. I kept the visual style of the new theme as close as possible to the old one (header image, top menu, sidebar widgets etc).
A note about the header image - that one has changed a few times over the years. I always use a picture I have taken myself and I rotate them on occasion.

At the bottom I was able to add three widgets that otherwise would have gone into a left sidebar. I think it's cleaner now. Plus, one of these bottom widgets shows posts that have been most popular during recent weeks. That's always interesting information to you (visitors), previously I would be the only one with that overview - it shows in the blog's admin dashboard.

I am still undecided whether Hemingway or Lovecraft will make it as my final choice. Hemingway theme shows the number of comments to each article and it's visually somewhat more condensed. Lovecraft on the other hand is aesthetically more pleasing to my eye.

I hope you like and appreciate the change and the new interface does not pose any difficulty writing and posting your comments. Feel free to comment below of course!

Cheers, Eric

Alien Pastures switched to HTTPS

The "Alien Pastures" blog has been moved into a Virtual Machine (hence the short downtime yesterday) after its previous host hardware was replaced with a much beefier machine. This was a nice opportunity to configure the VM with a SSL certificate issued by LetsEncrypt (again, thanks Robby Workman).

So, from now on, the blog is served with a HTTPS URL by default. I hope you understand, this is a process seen on many other web sites too.

Cheers, Eric

New SQLite driver for the blog

Ever since this blog's inception I have used a plugin called “PDO for WordPress” which allowed me to have a SQLite (file-based) database instead of the default MySQL database used by Wordpress.

There are a couple of bugs in PDO for Wordpress that I was getting tired of, and perhaps some of the people writing comments have been annoyed too, when their post failed to show up on the blog. Most notorious bug was that any text containing the two characters ) and ' immediately after eachother would silently be discarded by the driver... the only way to get your precious text back was to hit your browser's "Back" button and try to find out what was wrong with the text.

The PDO for Wordpress plugin has not been maintained for a while, mostly because the development pace of the Wordpress code was faster than the PDO for Wordpress author could manage. Some of the bugs were addressed with patches, but these were never incorporated into a new release.

I was finally so irritated with this that I was going to attempt to apply these patches to my own blog. Luckily, I did my research properly and I ran into a new plugin that can replace the old PDO for Wordpress plugin: it is called "SQLite Integration". This plugin uses PDO just like the old one.

Remember, PDO stands for PHP Data Objects. Quoting the PHP manual: "PDO provides a data-access abstraction layer, which means that, regardless of which database you're using, you use the same functions to issue queries and fetch data. PDO does not provide a database abstraction; it doesn't rewrite SQL or emulate missing features". This is what allows the use of a different database than MySQL and at the same time is the cause of the bugs in my blog - there are incompatibilities in the way Wordpress creates SQL queries (targeted at MySQL syntax which does not always work for SQLite).

Interesting enough, the discussion among the WordPress developers about the possible use of PDO has been revived now that the  mysql_* functions are officially deprecated in PHP 5.4.

This new SQLite Integration plugin will work with versions of WordPress starting with 3.3. My blog is at the latest 3.8 release so that is OK.  Thus I proceeded to do the installation of the plugin and re-configuration of the blog, following the instructions (I always RTFM before applying irreversible changes - and make a full backup too ;-)

As you can see, the blog is still here. I have not checked whether the text entry bugs have gone now, but at least I am running on a well-maintained database driver again.

Eric

« Older posts

© 2026 Alien Pastures · Entries feed

Theme based on Hemingway by Anders Norén — Up ↑