Table of Contents
Welcome to fiwswe's BLOG
Currently there are 19 entries in this BLOG.
Installing DokuWiki from packages vs. manually
Many operating systems (OSes) have package managers that offer a DokuWiki package.
The advantages of using such a package are:
-
OS-specific issues are generally handled in the package.
-
Often dependencies are automatically installed.
But there are disadvantages as well:
-
Often the packages contain out-of-date versions of DokuWiki.
-
When manually upgrading such a DokuWiki installation there may be conflicts with the package mechanism. These may lead to upgrades being overwritten by older versions in the package.
-
Often there is a default version of PHP associated with the the packaged version of DokuWiki. But this version may not be the newest compatible version of PHP available for the OS.
So an admin needs to decide whether to use an OS package or a manual method for installing DokuWiki.
Using the package is generally easier and gets your DokuWiki up and running faster. But for best results it may be better to install DokuWiki manually.
Tip: Install DokuWiki using a package and note the OS-specific things this package does. Then apply that to your manual install. This wastes a bit of disk space by having an unused version of DokuWiki and potentially some unused dependencies installed. But in most cases that is negligible.
Updating DokuWiki on OpenBSD
Note 1: The following may partially apply to other UN*X operating systems as well with minor adaptations.
Note 2: As a general rule, before making significant changes to your wiki, make sure you have a good backup. A simple copy (including file system permissions) of your DokuWiki root directory will suffice.
DokuWiki is available as a port on OpenBSD. So the seemingly easiest way to update is to execute:
$ doas pkg_add -u
.
There are two drawbacks though:
-
The port is not always updated to the latest version of DokuWiki.
-
At the time of writing, the port in OpenBSD 7.4 is
dokuwiki-2023.04.04p0
("Jack Jackrum") while the latest offcial release is DokuWiki 2024-02-06a "Kaos".
If you want your DokuWiki to live anywhere else than in/var/www/dokuwiki/
you are out of luck.-
This also means that running a second instance of DokuWiki on the same host is impossible without manual intervention.
You could use the upgrade Plugin. However that requires the whole DokuWiki directory tree to be writable by the web server. Personally I feel that this is a potential security issue. though not exploitable on its own.
So IMHO it makes sense to decouple the OpenBSD port from the running instance(s) of DokuWiki. You could let your DokuWiki live in e.g.
/var/www/mywiki/
or, if you use a web server other than the chroot(2)ed httpd(8),/home/my-web-user/mywiki/
.You could still install the OpenBSD port just to get all of the minimum dependencies taken care of. But you might just as well install the dependencies manually. (This would also allow you to set up a more modern version of PHP for DokuWiki instead of the default version corresponding with the particular OpenBSD release.)
So I have come up with a script to handle the updates. This script downloads the latest stable release of DokuWiki, sets the permissions (minimal required for correct operation of the wiki), updates a working DokuWiki instance and does cleanup such as deleting files that are no longer needed.
See GitHub for the actual script.
It may be a good idea to invalidate the DokuWiki caches after the upgrade. This can be accomplished simply by saving the DokuWiki configuration.
DokuWiki 2024-02-06 "Kaos" has been released
Overall a good release with many internal improvements to the code. But there are a few issues that may cause early adopters some grief. Patches for most of them exist and I'm sure an updated release will include the fixes soon.
Note hat PHP 7.4 or higher is now required. As PHP 7.4 is already out of maintenance / end of life, PHP 8.x is highly recommended. I have had no issues running DokuWiki on PHP 8.2 and 8.3 so far.
So far the most troublesome issues seem to be:
-
parsing of formated tables fails in Dokuwiki 2024-02-06 "Kaos" (#4186)
-
This can be a show-stopper. But a fix already exists:
-
✔ Fixed in DokuWiki 2024-02-06a "Kaos".
Wiki Logo aspect ratio broken after update to 2024-02-06 "Kaos" (#4187)-
Specific to the DokuWiki Template.
-
✔ Fixed in DokuWiki 2024-02-06a "Kaos".
It may be a good idea to invalidate the DokuWiki cache after the update. This can be accomplished by simply saving the Configuration (no actual changes required).No Content-Type header sent by Kaos' feed.php (#4203)-
✔ Fixed in DokuWiki 2024-02-06a "Kaos".
Plugins work fine for the most part in my experience. But many plugins have not had their plugin pages updated to indicate compatibility with "Kaos" yet. And PHP 8 compatibility still needs work for some plugins, though the issues are mostly PHP warnings.
I can't comment much on templates, but sprintDoc Template and of course the built-in DokuWiki Template work fine.
Update 2024.02.12: Less than a week after the initial release, the hotfix version DokuWiki 2024-02-06a "Kaos" has been released, fixing the problems mentioned above. It may still be necessary to invalidate the DokuWiki cache after the update.
OpenBSD 7.4 has been released
Again, not surprising for those who follow the OpenBSD mailing lists, on 2023.10.16 OpenBSD 7.4 was released.
As usual the Upgrade instructions work fine and the first impression is good.
The one thing that might cause issues on some of the servers I administer is the fact that the included LibreSSL 3.8.2 no longer supports TLSv1.0 and TLSv1.1. TLSv1.2 and TLSv1.3 are now the only versions supported. Generally this is good, because the older versions were deprecated 2½ years ago, see RFC 8996 Deprecating TLS 1.0 and TLS 1.1. But there might be issues with IoT devices or even some older computers sending emails. We'll see…
AI?
In recent weeks there seems to have been a huge hype about “AI”.
However from what I can see of the results, “AI” must refer to “Artificial Idiot“ as none of them seem to bear any relation to “Intelligence“.
The only danger I can see is that people will take the output from artificial idiots as gospel. Nothing new there as lots of people listen to human idiots as well.
cron-like execution of PHP code more often than every minute
A friend of mine recently asked me how to modify a PHP script that collects data into an RRDtool database so it could be triggered more often than once per minute. He is currently using cron(8) to trigger the script.
Of course cron(8) has a granularity of 1 minute so there is nothing that can be done there.
The basic solution is to start the script once and have it loop infinitely with each loop iteration performing the action and then waiting until the next time the action should be performed. Thus the run interval can be specified with sub-second precision.
There are a few minor catches though:
-
In order to not use CPU when waiting for the next execution time, the script sleeps (time_sleep_until). However a sleeping process/script can not be signaled to stop. Thus e.g. ⌃C will not work until the script wakes from sleep.
-
So the instead of sleeping the script will take short naps of ≤0.5s until the target time has been reached. Thus any signal to the process will take 0.5s at most to be processed.
We want the run interval to be constant no matter the actual runtime of the action. In other words, we do not want there to be any significant drift.-
In case the runtime of the action happens to be longer than than the interval the script should just skip to the next interval. So it makes a best effort at performing the action at each interval but is tolerant if that fails due to time overruns.
The script does need to use the PHP pcntl extension for the signal handling code.-
Please note that this extension is considered to be a potential security risk when used with PHP code that is executed from a web server. So you should make sure that the
php.ini
used for the web server does not include this extension. -
For a CLI script, like the one we are talking about here, it is fine though, as long as you take care with the permissions, etc. (which you should in any case).
Explaining all of this to someone who can read and unterstand code, even modify it, but who is not an actual software developer, seemed complicated. So I decided on building some heavily commented sample code to illustrate the concepts and as a potential starting point for useful scripts based on this concept. You can find it here: https://github.com/fiwswe/simpleservice
OpenBSD 7.3 has been released
Not surprising for those who follow the OpenBSD mailing lists, on 2023.04.10 OpenBSD 7.3 was released.
As usual the Upgrade instructions work fine and the first impression is good.
Site creation
After using the moniker fiwswe for some time now, I have decided to have a website for this identity. This is it!
In late 2022 everything came together for this:
-
I found a way to reasonably assure the anonyomity of using the fiwswe alias.
-
I found relatively cheap domain registration, E-Mail, hosting and other services while retaining all technical features I wanted for this private, non-critical, non-commercial website.
-
I had the time and inclination.
Real content will probably arrive irregularly. Do not expect high a volume of content from this website.
weblog.txt · Last modified: by fiwswe
-
-
-